Merge lp:~openerp-dev/openobject-addons/trunk-yaml-access-rights-sgo into lp:openobject-addons

Proposed by Sanjay Gohel (Open ERP)
Status: Superseded
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-yaml-access-rights-sgo
Merge into: lp:openobject-addons
Diff against target: 3160 lines (+1292/-416)
100 files modified
account/__openerp__.py (+1/-0)
account/security/ir.model.access.csv (+3/-0)
account/test/account_customer_invoice.yml (+5/-0)
account/test/account_invoice_state.yml (+5/-0)
account/test/account_supplier_invoice.yml (+5/-0)
account/test/account_test_users.yml (+31/-0)
account/test/account_validate_account_move.yml (+5/-0)
account_voucher/__openerp__.py (+1/-0)
account_voucher/test/account_voucher.yml (+6/-0)
account_voucher/test/account_voucher_users.yml (+32/-0)
account_voucher/test/case_eur_usd.yml (+5/-0)
account_voucher/test/sales_payment.yml (+5/-0)
account_voucher/test/sales_receipt.yml (+5/-0)
crm/__openerp__.py (+1/-0)
crm/security/crm_security.xml (+1/-0)
crm/security/ir.model.access.csv (+1/-0)
crm/test/crm_access_group_users.yml (+30/-0)
crm/test/crm_lead_cancel.yml (+11/-8)
crm/test/crm_lead_merge.yml (+5/-3)
crm/test/crm_lead_message.yml (+5/-0)
crm/test/crm_lead_onchange.yml (+9/-5)
crm/test/crm_lead_unlink.yml (+4/-1)
crm/test/lead2opportunity2win.yml (+5/-0)
crm/test/lead2opportunity_assign_salesmen.yml (+43/-38)
crm/test/phonecalls.yml (+5/-0)
event/__openerp__.py (+1/-1)
event/security/event_security.xml (+1/-0)
event/test/process/event_draft2done.yml (+5/-0)
event/test/ui/event_users.yml (+30/-0)
hr/__openerp__.py (+1/-0)
hr/test/hr_demo.yml (+5/-0)
hr/test/hr_users.yml (+42/-0)
hr/test/open2recruit2close_job.yml (+5/-0)
hr_attendance/test/attendance_process.yml (+19/-0)
hr_recruitment/security/hr_recruitment_security.xml (+3/-0)
hr_recruitment/test/recruitment_process.yml (+19/-1)
hr_timesheet/__openerp__.py (+1/-0)
hr_timesheet/test/hr_timesheet_demo.yml (+5/-0)
hr_timesheet/test/hr_timesheet_users.yml (+45/-0)
hr_timesheet/test/test_hr_timesheet.yml (+10/-0)
mrp/__openerp__.py (+4/-3)
mrp/security/ir.model.access.csv (+1/-0)
mrp/security/mrp_security.xml (+1/-0)
mrp/test/cancel_order.yml (+5/-0)
mrp/test/mrp_users.yml (+30/-0)
mrp/test/order_demo.yml (+5/-0)
mrp/test/order_process.yml (+16/-11)
mrp_operations/__openerp__.py (+1/-1)
mrp_operations/test/workcenter_operations.yml (+21/-3)
mrp_repair/__openerp__.py (+2/-1)
mrp_repair/test/mrp_repair_users.yml (+30/-0)
mrp_repair/test/test_mrp_repair_afterinv.yml (+4/-1)
mrp_repair/test/test_mrp_repair_b4inv.yml (+4/-1)
mrp_repair/test/test_mrp_repair_cancel.yml (+4/-1)
mrp_repair/test/test_mrp_repair_noneinv.yml (+4/-1)
project/__openerp__.py (+1/-0)
project/security/ir.model.access.csv (+1/-0)
project/security/project_security.xml (+1/-0)
project/test/project_demo.yml (+17/-6)
project/test/project_process.yml (+5/-0)
project/test/project_users.yml (+30/-0)
project/test/task_process.yml (+20/-15)
project_issue/__openerp__.py (+1/-0)
project_issue/test/cancel_issue.yml (+5/-0)
project_issue/test/issue_demo.yml (+4/-3)
project_issue/test/issue_process.yml (+15/-0)
project_issue/test/issue_users.yml (+30/-0)
project_issue/test/subscribe_issue.yml (+1/-1)
purchase/__openerp__.py (+1/-0)
purchase/purchase_order_demo.yml (+2/-0)
purchase/test/process/cancel_order.yml (+5/-0)
purchase/test/process/generate_invoice_from_reception.yml (+5/-0)
purchase/test/process/invoice_on_poline.yml (+6/-7)
purchase/test/process/merge_order.yml (+5/-0)
purchase/test/ui/delete_order.yml (+5/-0)
purchase/test/ui/purchase_users.yml (+30/-0)
purchase_requisition/__openerp__.py (+1/-0)
purchase_requisition/security/purchase_tender.xml (+1/-0)
purchase_requisition/test/cancel_purchase_requisition.yml (+5/-0)
purchase_requisition/test/purchase_requisition.yml (+5/-0)
purchase_requisition/test/purchase_requisition_demo.yml (+5/-0)
purchase_requisition/test/purchase_requisition_users.yml (+30/-0)
sale/__openerp__.py (+1/-0)
sale/test/cancel_order.yml (+5/-0)
sale/test/create_sale_users.yml (+30/-0)
sale/test/delete_order.yml (+5/-0)
sale/test/sale_order_demo.yml (+0/-36)
sale_stock/__openerp__.py (+2/-1)
sale_stock/test/cancel_order_sale_stock.yml (+15/-2)
sale_stock/test/picking_order_policy.yml (+24/-1)
sale_stock/test/prepaid_order_policy.yml (+4/-1)
sale_stock/test/sale_order_onchange.yml (+10/-0)
sale_stock/test/sale_stock_users.yml (+61/-0)
stock/__openerp__.py (+5/-4)
stock/security/stock_security.xml (+1/-1)
stock/stock_demo.yml (+77/-69)
stock/test/opening_stock.yml (+66/-36)
stock/test/shipment.yml (+157/-149)
stock/test/stock_report.yml (+9/-4)
stock/test/stock_users.yml (+30/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-yaml-access-rights-sgo
Reviewer Review Type Date Requested Status
Martin Trigaux (OpenERP) (community) Needs Fixing
OpenERP Core Team Pending
Review via email: mp+161428@code.launchpad.net

This proposal supersedes a proposal from 2013-03-06.

This proposal has been superseded by a proposal from 2013-05-07.

Description of the change

Hello,

    Give contact creation rights to account user and voucher user now runbot turns to green for this.

Thank You.

To post a comment you must log in.
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote : Posted in a previous version of this proposal

Yaml tests fail for the module 'account' "Access Denied by ACLs for operation: create, uid: 86, model: ir.property"
look at http://runbot.openerp.com/openerp-dev-trunk-yaml-access-rights-sgo-7935/logs/test-all.txt

review: Needs Fixing
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Why did you removed a test in invoice_on_poline.yml ? It raises a permission error

Revision history for this message
Sanjay Gohel (Open ERP) (sgo-openerp) wrote :

Hello Martin,

     That test in invoice_on_poline will create in purchase.config.settings. for this we have to give rights of purchase manager to test this ivoice_on_poline.yml while purchase manager have no rights to see settings menu also. and this test will create problem when you commit yml with test commit option.

Thanks.

Revision history for this message
Sanjay Gohel (Open ERP) (sgo-openerp) wrote :

And if i test it with purchase manager for that we have to give create rights for ir.values as it gives error for not have rights for creating ir.values.
And also don't need to set the default invoicing control method "Based on Purchase Order Lines" as invoice was already created before this test.

Thanks.

Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Ok I see. Then simply execute this test with the uid base.user_root. So you still test this functionality while having a correct access rights.

Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

The file test/ui/purchase_users.yml should be a test file and not a demo file (defined in __openerp__.py).

review: Needs Fixing
Revision history for this message
Martin Trigaux (OpenERP) (mat-openerp) wrote :

Also why did you put the groups_id in 'default_groups_ref' instead of setting it in user record ?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/__openerp__.py'
2--- account/__openerp__.py 2012-12-20 10:43:45 +0000
3+++ account/__openerp__.py 2013-05-07 09:48:32 +0000
4@@ -146,6 +146,7 @@
5 'account_unit_test.xml',
6 ],
7 'test': [
8+ 'test/account_test_users.yml',
9 'test/account_customer_invoice.yml',
10 'test/account_supplier_invoice.yml',
11 'test/account_change_currency.yml',
12
13=== modified file 'account/security/ir.model.access.csv'
14--- account/security/ir.model.access.csv 2012-12-12 12:59:12 +0000
15+++ account/security/ir.model.access.csv 2013-05-07 09:48:32 +0000
16@@ -37,6 +37,7 @@
17 access_account_payment_term_line_manager,account.payment.term.line,model_account_payment_term_line,account.group_account_manager,1,1,1,1
18 access_account_tax_manager,account.tax,model_account_tax,account.group_account_manager,1,1,1,1
19 access_account_journal_manager,account.journal,model_account_journal,account.group_account_manager,1,1,1,1
20+access_account_journal_user,account.journal,model_account_journal,account.group_account_user,1,1,1,0
21 access_account_journal_invoice,account.journal invoice,model_account_journal,account.group_account_invoice,1,0,0,0
22 access_account_period_manager,account.period,model_account_period,account.group_account_manager,1,1,1,1
23 access_account_period_invoice,account.period invoice,model_account_period,account.group_account_invoice,1,0,0,0
24@@ -71,6 +72,7 @@
25 access_report_account_sales,report.account.sales,model_report_account_sales,account.group_account_manager,1,1,1,1
26 access_account_invoice_report,account.invoice.report,model_account_invoice_report,account.group_account_manager,1,1,1,1
27 access_res_partner_group_account_manager,res_partner group_account_manager,model_res_partner,account.group_account_manager,1,0,0,0
28+access_res_partner_group_account_user,res_partner group_account_user,model_res_partner,account.group_account_user,1,1,1,0
29 access_account_invoice_accountant,account.invoice accountant,model_account_invoice,account.group_account_user,1,0,0,0
30 access_account_tax_code_accountant,account.tax.code accountant,model_account_tax_code,account.group_account_user,1,1,1,1
31 access_account_move_line_manager,account.move.line manager,model_account_move_line,account.group_account_manager,1,0,0,0
32@@ -98,3 +100,4 @@
33 access_account_treasury_report_manager,account.treasury.report.manager,model_account_treasury_report,account.group_account_manager,1,0,0,0
34 access_account_financial_report,account.financial.report,model_account_financial_report,account.group_account_user,1,1,1,1
35 access_account_financial_report_invoice,account.financial.report invoice,model_account_financial_report,account.group_account_invoice,1,0,0,0
36+access_res_partner_bank,res.partner.bank,model_res_partner_bank,account.group_account_user,1,1,1,0
37
38=== modified file 'account/test/account_customer_invoice.yml'
39--- account/test/account_customer_invoice.yml 2012-11-29 22:26:45 +0000
40+++ account/test/account_customer_invoice.yml 2013-05-07 09:48:32 +0000
41@@ -1,4 +1,9 @@
42 -
43+ Test with that user which have rights to make Invoicing and payment and who is accountant.
44+-
45+ !context
46+ uid: 'res_users_account_user'
47+-
48 In order to test account invoice I create a new customer invoice
49 -
50 I will create bank detail
51
52=== modified file 'account/test/account_invoice_state.yml'
53--- account/test/account_invoice_state.yml 2012-11-29 22:26:45 +0000
54+++ account/test/account_invoice_state.yml 2013-05-07 09:48:32 +0000
55@@ -1,4 +1,9 @@
56 -
57+ Test with that user which have rights to make Invoicing.
58+-
59+ !context
60+ uid: 'res_users_account_user'
61+-
62 In order to test Confirm Draft Invoice wizard I create an invoice and confirm it with this wizard
63 -
64 !record {model: account.invoice, id: account_invoice_state}:
65
66=== modified file 'account/test/account_supplier_invoice.yml'
67--- account/test/account_supplier_invoice.yml 2012-11-29 22:26:45 +0000
68+++ account/test/account_supplier_invoice.yml 2013-05-07 09:48:32 +0000
69@@ -1,4 +1,9 @@
70 -
71+ Test with that Finance manager who can only create supplier invoice.
72+-
73+ !context
74+ uid: 'res_users_account_manager'
75+-
76 In order to test account invoice I create a new supplier invoice
77 -
78 I create a Tax Codes
79
80=== added file 'account/test/account_test_users.yml'
81--- account/test/account_test_users.yml 1970-01-01 00:00:00 +0000
82+++ account/test/account_test_users.yml 2013-05-07 09:48:32 +0000
83@@ -0,0 +1,31 @@
84+-
85+ Create a user as 'Accountant'
86+-
87+ !record {model: res.users, id: res_users_account_user}:
88+ company_id: base.main_company
89+ name: Accountant
90+ login: acc
91+ password: acc
92+ email: accountuser@yourcompany.com
93+-
94+ I added groups for Accountant.
95+-
96+ !record {model: res.users, id: res_users_account_user}:
97+ groups_id:
98+ - account.group_account_user
99+ - base.group_partner_manager
100+-
101+ Create a user as 'Financial Manager'
102+-
103+ !record {model: res.users, id: res_users_account_manager}:
104+ company_id: base.main_company
105+ name: Financial Manager
106+ login: fm
107+ password: fm
108+ email: accountmanager@yourcompany.com
109+-
110+ I added groups for Financial Manager.
111+-
112+ !record {model: res.users, id: res_users_account_manager}:
113+ groups_id:
114+ - account.group_account_manager
115\ No newline at end of file
116
117=== modified file 'account/test/account_validate_account_move.yml'
118--- account/test/account_validate_account_move.yml 2012-11-29 22:26:45 +0000
119+++ account/test/account_validate_account_move.yml 2013-05-07 09:48:32 +0000
120@@ -1,4 +1,9 @@
121 -
122+ Test validate account move with user who is accountant which have its rights.'
123+-
124+ !context
125+ uid: 'res_users_account_user'
126+-
127 In order to test the account move lines in OpenERP, I create account move
128 -
129 I create a Account tax code
130
131=== modified file 'account_voucher/__openerp__.py'
132--- account_voucher/__openerp__.py 2013-01-31 18:41:41 +0000
133+++ account_voucher/__openerp__.py 2013-05-07 09:48:32 +0000
134@@ -61,6 +61,7 @@
135 'account_voucher_data.xml',
136 ],
137 'test' : [
138+ 'test/account_voucher_users.yml',
139 'test/case5_suppl_usd_usd.yml',
140 'test/account_voucher.yml',
141 'test/sales_receipt.yml',
142
143=== modified file 'account_voucher/test/account_voucher.yml'
144--- account_voucher/test/account_voucher.yml 2012-11-29 22:26:45 +0000
145+++ account_voucher/test/account_voucher.yml 2013-05-07 09:48:32 +0000
146@@ -1,4 +1,10 @@
147 -
148+ I check the voucher module with user who is accountant.
149+-
150+ !context
151+ uid: 'res_users_account_voucher_user'
152+
153+-
154 In order to check account voucher module in OpenERP I create a customer voucher
155 -
156 !record {model: account.voucher, id: account_voucher_voucherforaxelor0, view: view_sale_receipt_form}:
157
158=== added file 'account_voucher/test/account_voucher_users.yml'
159--- account_voucher/test/account_voucher_users.yml 1970-01-01 00:00:00 +0000
160+++ account_voucher/test/account_voucher_users.yml 2013-05-07 09:48:32 +0000
161@@ -0,0 +1,32 @@
162+-
163+ Create a user as 'Accountant for account voucher'
164+-
165+ !record {model: res.users, id: res_users_account_voucher_user}:
166+ company_id: base.main_company
167+ name: Voucher Accountant
168+ login: vacc
169+ password: acc
170+ email: accountant@yourcompany.com
171+-
172+ I added groups to Accountant for account voucher.
173+-
174+ !record {model: res.users, id: res_users_account_voucher_user}:
175+ groups_id:
176+ - base.group_partner_manager
177+ - account.group_account_user
178+-
179+ Create a user as 'Financial Manager for account voucher'
180+-
181+ !record {model: res.users, id: res_users_account_voucher_manager}:
182+ company_id: base.main_company
183+ name: Financial Manager for voucher
184+ login: fmv
185+ password: fmv
186+ email: finmanager@yourcompany.com
187+-
188+ I added groups to Financial Manager for account voucher.
189+-
190+ !record {model: res.users, id: res_users_account_voucher_manager}:
191+ groups_id:
192+ - base.group_partner_manager
193+ - account.group_account_manager
194
195=== modified file 'account_voucher/test/case_eur_usd.yml'
196--- account_voucher/test/case_eur_usd.yml 2012-11-29 22:26:45 +0000
197+++ account_voucher/test/case_eur_usd.yml 2013-05-07 09:48:32 +0000
198@@ -1,5 +1,10 @@
199 ##YAML test on the account_voucher as depicted in this bug report: https://bugs.launchpad.net/openobject-addons/+bug/954155
200 -
201+ Only manager can create and take decision about bank and currency there I checkd this test with user who is finance manager.
202+-
203+ !context
204+ uid: 'res_users_account_voucher_manager'
205+-
206 In order to check the payment with multi-currency in OpenERP,
207 I create an invoice in EUR and make payment in USD based on the currency rating.
208 -
209
210=== modified file 'account_voucher/test/sales_payment.yml'
211--- account_voucher/test/sales_payment.yml 2013-02-22 16:10:29 +0000
212+++ account_voucher/test/sales_payment.yml 2013-05-07 09:48:32 +0000
213@@ -1,3 +1,8 @@
214+-
215+ I test sales payment with user who is accountant.
216+-
217+ !context
218+ uid: 'res_users_account_voucher_user'
219 -
220 Create an invoice for the partner Seagate with amount 450.0
221 -
222
223=== modified file 'account_voucher/test/sales_receipt.yml'
224--- account_voucher/test/sales_receipt.yml 2013-02-22 16:10:29 +0000
225+++ account_voucher/test/sales_receipt.yml 2013-05-07 09:48:32 +0000
226@@ -1,3 +1,8 @@
227+-
228+ Accountant can also be created receipt and validate it there for I checked it with that user who is accountant.
229+-
230+ !context
231+ uid: 'res_users_account_voucher_user'
232 -
233 Creating a Voucher Receipt for partner Seagate with amount 30000.0
234 -
235
236=== modified file 'crm/__openerp__.py'
237--- crm/__openerp__.py 2013-05-02 10:30:44 +0000
238+++ crm/__openerp__.py 2013-05-07 09:48:32 +0000
239@@ -106,6 +106,7 @@
240 'crm_action_rule_demo.xml',
241 ],
242 'test': [
243+ 'test/crm_access_group_users.yml',
244 'test/crm_lead_message.yml',
245 'test/lead2opportunity2win.yml',
246 'test/lead2opportunity_assign_salesmen.yml',
247
248=== modified file 'crm/security/crm_security.xml'
249--- crm/security/crm_security.xml 2013-03-28 16:07:04 +0000
250+++ crm/security/crm_security.xml 2013-05-07 09:48:32 +0000
251@@ -5,6 +5,7 @@
252 <record id="base.group_sale_salesman" model="res.groups">
253 <field name="name">User: Own Leads Only</field>
254 <field name="category_id" ref="base.module_category_sales_management"/>
255+ <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
256 <field name="comment">the user will have access to his own data in the sales application.</field>
257 </record>
258
259
260=== modified file 'crm/security/ir.model.access.csv'
261--- crm/security/ir.model.access.csv 2013-05-02 10:30:44 +0000
262+++ crm/security/ir.model.access.csv 2013-05-07 09:48:32 +0000
263@@ -35,5 +35,6 @@
264 access_crm_phonecall_partner_manager,crm.phonecall.partner.manager,model_crm_phonecall,base.group_partner_manager,1,1,1,1
265 access_crm_payment_mode_user,crm.payment.mode,model_crm_payment_mode,base.group_sale_salesman,1,0,0,0
266 access_crm_payment_mode,crm.payment.mode,model_crm_payment_mode,base.group_sale_manager,1,1,1,1
267+access_ir_property_salesman,ir_property_salesman,base.model_ir_property,base.group_sale_salesman,1,1,1,0
268 access_base_partner_merge_line_manager,base_partner_merge_line.manager,model_base_partner_merge_line,base.group_system,1,1,1,1
269 access_base_partner_merge_manager,base_partner_merge.manager,model_base_partner_merge_automatic_wizard,base.group_system,1,1,1,1
270
271=== added file 'crm/test/crm_access_group_users.yml'
272--- crm/test/crm_access_group_users.yml 1970-01-01 00:00:00 +0000
273+++ crm/test/crm_access_group_users.yml 2013-05-07 09:48:32 +0000
274@@ -0,0 +1,30 @@
275+-
276+ Create a user as 'Crm Salesmanager'
277+-
278+ !record {model: res.users, id: crm_res_users_salesmanager}:
279+ company_id: base.main_company
280+ name: Crm Sales manager
281+ login: csm
282+ password: csm
283+ email: crmmanager@yourcompany.com
284+-
285+ I added groups for Crm Salesmanager.
286+-
287+ !record {model: res.users, id: crm_res_users_salesmanager}:
288+ groups_id:
289+ - base.group_sale_manager
290+-
291+ Create a user as 'Crm Salesman'
292+-
293+ !record {model: res.users, id: crm_res_users_salesman}:
294+ company_id: base.main_company
295+ name: Crm Salesman
296+ login: csu
297+ password: csu
298+ email: crmuser@yourcompany.com
299+-
300+ I added groups for Crm Salesman.
301+-
302+ !record {model: res.users, id: crm_res_users_salesman}:
303+ groups_id:
304+ - base.group_sale_salesman_all_leads
305
306=== modified file 'crm/test/crm_lead_cancel.yml'
307--- crm/test/crm_lead_cancel.yml 2013-03-21 11:26:47 +0000
308+++ crm/test/crm_lead_cancel.yml 2013-05-07 09:48:32 +0000
309@@ -1,10 +1,13 @@
310 -
311- I cancel unqualified lead.
312+ Salesman can also cancelled unqualified lead and re-open lead so giving access rights of salesman.
313+-
314+ !context
315+ uid: 'crm_res_users_salesman'
316 -
317 !python {model: crm.lead}: |
318 self.case_cancel(cr, uid, [ref("crm_case_1")])
319 -
320- I check cancelled lead.
321+ Salesman check cancelled lead.
322 -
323 !python {model: crm.lead}: |
324 lead = self.browse(cr, uid, ref('crm_case_1'))
325@@ -12,34 +15,34 @@
326 assert lead.state == 'cancel', "Opportunity is not in 'cancel' state."
327 assert lead.probability == 0.0, 'Opportunity is probably wrong and should be 0.0.'
328 -
329- I reset cancelled lead into unqualified lead.
330+ Salesman reset cancelled lead into unqualified lead.
331 -
332 !python {model: crm.lead}: |
333 self.case_reset(cr, uid, [ref("crm_case_1")])
334 -
335- I check unqualified lead after reset.
336+ Salesman check unqualified lead after reset.
337 -
338 !assert {model: crm.lead, id: crm.crm_case_1, string: Lead is in draft state}:
339 - state == "draft"
340 -
341- I re-open the lead
342+ Salesman re-open the lead
343 -
344 !python {model: crm.lead}: |
345 self.case_open(cr, uid, [ref("crm_case_1")])
346 -
347- I check stage and state of the re-opened lead
348+ Salesman check stage and state of the re-opened lead
349 -
350 !python {model: crm.lead}: |
351 lead = self.browse(cr, uid, ref('crm.crm_case_1'))
352 assert lead.stage_id.id == ref('crm.stage_lead2'), "Opportunity stage should be 'Qualification'."
353 assert lead.state == 'open', "Opportunity should be in 'open' state."
354 -
355- I escalate the lead to parent team.
356+ Salesman escalate the lead to parent team.
357 -
358 !python {model: crm.lead}: |
359 self.case_escalate(cr, uid, [ref("crm_case_1")])
360 -
361- I check the lead is correctly escalated to the parent team.
362+ Salesman check the lead is correctly escalated to the parent team.
363 -
364 !assert {model: crm.lead, id: crm.crm_case_1, string: Escalate lead to parent team}:
365 - section_id.name == "Support Department"
366
367=== modified file 'crm/test/crm_lead_merge.yml'
368--- crm/test/crm_lead_merge.yml 2013-03-29 13:06:15 +0000
369+++ crm/test/crm_lead_merge.yml 2013-05-07 09:48:32 +0000
370@@ -1,6 +1,8 @@
371-
372--
373- During a mixed merge (involving leads and opps), data should be handled a certain way following their type (m2o, m2m, text, ...) Start by creating two leads and an opp.
374+-
375+ During a mixed merge (involving leads and opps), data should be handled a certain way following their type (m2o, m2m, text, ...) Start by creating two leads and an opp and giving the rights of Sales manager.
376+-
377+ !context
378+ uid: 'crm_res_users_salesmanager'
379 -
380 !record {model: crm.lead, id: test_crm_lead_01}:
381 type: 'lead'
382
383=== modified file 'crm/test/crm_lead_message.yml'
384--- crm/test/crm_lead_message.yml 2013-04-16 15:18:44 +0000
385+++ crm/test/crm_lead_message.yml 2013-05-07 09:48:32 +0000
386@@ -1,4 +1,9 @@
387 -
388+ Give the access rights of Salesman to communicat with customer.
389+-
390+ !context
391+ uid: 'crm_res_users_salesman'
392+-
393 Customer interested in our product, so he sends request by email to get more details.
394 -
395 Mail script will fetch his request from mail server. Then I process that mail after read EML file.
396
397=== modified file 'crm/test/crm_lead_onchange.yml'
398--- crm/test/crm_lead_onchange.yml 2013-03-21 11:26:47 +0000
399+++ crm/test/crm_lead_onchange.yml 2013-05-07 09:48:32 +0000
400@@ -1,5 +1,9 @@
401--
402- I create a lead record to call a partner onchange, stage onchange and mailing opt-in onchange method.
403+
404+-
405+ Sales manager create a lead record to call a partner onchange, stage onchange and mailing opt-in onchange method.
406+-
407+ !context
408+ uid: 'crm_res_users_salesmanager'
409 -
410 !record {model: crm.lead, id: crm_case_25}:
411 name: 'Need more info about your pc2'
412@@ -8,7 +12,7 @@
413 stage_id: crm.stage_lead1
414 state: draft
415 -
416- I create a lead record to call a mailing opt-out onchange method.
417+ Sales manager create a lead record to call a mailing opt-out onchange method.
418 -
419 !record {model: crm.lead, id: crm_case_18}:
420 name: 'Need 20 Days of Consultancy'
421@@ -16,13 +20,13 @@
422 state: draft
423 opt_out: True
424 -
425- I create a phonecall record to call a partner onchange method.
426+ Sales manager create a phonecall record to call a partner onchange method.
427 -
428 !record {model: crm.phonecall, id: crm_phonecall_5}:
429 name: 'Bad time'
430 partner_id: base.res_partner_5
431 -
432- I set the next stage to "New" for the lead.
433+ Sales manager set the next stage to "New" for the lead.
434 -
435 !python {model: crm.lead}: |
436 self.stage_next(cr, uid, [ref("crm_case_4")], context={'stage_type': 'lead'})
437
438=== modified file 'crm/test/crm_lead_unlink.yml'
439--- crm/test/crm_lead_unlink.yml 2013-03-21 11:26:47 +0000
440+++ crm/test/crm_lead_unlink.yml 2013-05-07 09:48:32 +0000
441@@ -1,5 +1,8 @@
442 -
443- I Unlink the Lead.
444+ Only Sales manager Unlink the Lead so test with Manager's access rights'.
445+-
446+ !context
447+ uid: 'crm_res_users_salesmanager'
448 -
449 !python {model: crm.lead}: |
450 self.unlink(cr, uid, [ref("crm_case_4")])
451
452=== modified file 'crm/test/lead2opportunity2win.yml'
453--- crm/test/lead2opportunity2win.yml 2013-03-21 11:26:47 +0000
454+++ crm/test/lead2opportunity2win.yml 2013-05-07 09:48:32 +0000
455@@ -1,4 +1,9 @@
456 -
457+ Giving access rights of salesman to convert the lead into opportunity.
458+-
459+ !context
460+ uid: 'crm_res_users_salesman'
461+-
462 In order to test the conversion of a lead into a opportunity,
463 -
464 I open a lead.
465
466=== modified file 'crm/test/lead2opportunity_assign_salesmen.yml'
467--- crm/test/lead2opportunity_assign_salesmen.yml 2013-03-21 11:26:47 +0000
468+++ crm/test/lead2opportunity_assign_salesmen.yml 2013-05-07 09:48:32 +0000
469@@ -1,41 +1,5 @@
470 -
471- During a lead to opp conversion, salesmen should be assigned to leads following the round-robin method. Start by creating 6 leads (1 to 6) and 4 salesmen (A to D).
472--
473- !record {model: crm.lead, id: test_crm_lead_01}:
474- type: 'lead'
475- name: 'Test lead 1'
476- email_from: 'Raoul Grosbedon <raoul@grosbedon.fr>'
477- stage_id: stage_lead1
478--
479- !record {model: crm.lead, id: test_crm_lead_02}:
480- type: 'lead'
481- name: 'Test lead 2'
482- email_from: 'Raoul Grosbedon <raoul@grosbedon.fr>'
483- stage_id: stage_lead1
484--
485- !record {model: crm.lead, id: test_crm_lead_03}:
486- type: 'lead'
487- name: 'Test lead 3'
488- email_from: 'Raoul Grosbedon <raoul@grosbedon.fr>'
489- stage_id: stage_lead1
490--
491- !record {model: crm.lead, id: test_crm_lead_04}:
492- type: 'lead'
493- name: 'Test lead 4'
494- contact_name: 'Fabrice Lepoilu'
495- stage_id: stage_lead1
496--
497- !record {model: crm.lead, id: test_crm_lead_05}:
498- type: 'lead'
499- name: 'Test lead 5'
500- contact_name: 'Fabrice Lepoilu'
501- stage_id: stage_lead1
502--
503- !record {model: crm.lead, id: test_crm_lead_06}:
504- type: 'lead'
505- name: 'Test lead 6'
506- partner_name: 'Agrolait SuperSeed SA'
507- stage_id: stage_lead1
508+ During a lead to opp conversion, salesmen should be assigned to leads following the round-robin method. Start by creating 4 salesmen (A to D) and 6 leads (1 to 6).
509 -
510 !record {model: res.users, id: test_res_user_01}:
511 name: 'Test user A'
512@@ -57,7 +21,48 @@
513 login: 'tud'
514 new_password: 'tud'
515 -
516- I create a mass convert wizard and convert all the leads.
517+ Salesman also creates lead so giving access rights of salesman.
518+-
519+ !context
520+ uid: 'crm_res_users_salesman'
521+-
522+ !record {model: crm.lead, id: test_crm_lead_01}:
523+ type: 'lead'
524+ name: 'Test lead 1'
525+ email_from: 'Raoul Grosbedon <raoul@grosbedon.fr>'
526+ stage_id: stage_lead1
527+-
528+ !record {model: crm.lead, id: test_crm_lead_02}:
529+ type: 'lead'
530+ name: 'Test lead 2'
531+ email_from: 'Raoul Grosbedon <raoul@grosbedon.fr>'
532+ stage_id: stage_lead1
533+-
534+ !record {model: crm.lead, id: test_crm_lead_03}:
535+ type: 'lead'
536+ name: 'Test lead 3'
537+ email_from: 'Raoul Grosbedon <raoul@grosbedon.fr>'
538+ stage_id: stage_lead1
539+-
540+ !record {model: crm.lead, id: test_crm_lead_04}:
541+ type: 'lead'
542+ name: 'Test lead 4'
543+ contact_name: 'Fabrice Lepoilu'
544+ stage_id: stage_lead1
545+-
546+ !record {model: crm.lead, id: test_crm_lead_05}:
547+ type: 'lead'
548+ name: 'Test lead 5'
549+ contact_name: 'Fabrice Lepoilu'
550+ stage_id: stage_lead1
551+-
552+ !record {model: crm.lead, id: test_crm_lead_06}:
553+ type: 'lead'
554+ name: 'Test lead 6'
555+ partner_name: 'Agrolait SuperSeed SA'
556+ stage_id: stage_lead1
557+-
558+ Salesman create a mass convert wizard and convert all the leads.
559 -
560 !python {model: crm.lead2opportunity.partner.mass}: |
561 context.update({'active_model': 'crm.lead', 'active_ids': [ref("test_crm_lead_01"), ref("test_crm_lead_02"), ref("test_crm_lead_03"), ref("test_crm_lead_04"), ref("test_crm_lead_05"), ref("test_crm_lead_06")], 'active_id': ref("test_crm_lead_01")})
562
563=== modified file 'crm/test/phonecalls.yml'
564--- crm/test/phonecalls.yml 2013-03-21 11:26:47 +0000
565+++ crm/test/phonecalls.yml 2013-05-07 09:48:32 +0000
566@@ -1,4 +1,9 @@
567 -
568+ Salesman check the phone calls data so test with the access rights of salesman.
569+-
570+ !context
571+ uid: 'crm_res_users_salesman'
572+-
573 I schedule a phone call with a customer.
574 -
575 !python {model: crm.phonecall2phonecall}: |
576
577=== modified file 'event/__openerp__.py'
578--- event/__openerp__.py 2013-01-31 18:41:41 +0000
579+++ event/__openerp__.py 2013-05-07 09:48:32 +0000
580@@ -52,7 +52,7 @@
581 'email_template.xml',
582 ],
583 'demo': ['event_demo.xml'],
584- 'test': ['test/process/event_draft2done.yml'],
585+ 'test': ['test/ui/event_users.yml','test/process/event_draft2done.yml'],
586 'css': ['static/src/css/event.css'],
587 'installable': True,
588 'application': True,
589
590=== modified file 'event/security/event_security.xml'
591--- event/security/event_security.xml 2012-12-18 23:20:01 +0000
592+++ event/security/event_security.xml 2013-05-07 09:48:32 +0000
593@@ -10,6 +10,7 @@
594
595 <record id="group_event_user" model="res.groups">
596 <field name="name">User</field>
597+ <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
598 <field name="category_id" ref="module_category_event_management"/>
599 </record>
600
601
602=== modified file 'event/test/process/event_draft2done.yml'
603--- event/test/process/event_draft2done.yml 2012-05-27 09:49:23 +0000
604+++ event/test/process/event_draft2done.yml 2013-05-07 09:48:32 +0000
605@@ -1,4 +1,9 @@
606 -
607+ Give the access rights of Event user to organize an event and also do registration.
608+-
609+ !context
610+ uid: 'res_users_eventuser'
611+-
612 I want to organize an event,
613 into this conference I should create two registration.
614 One confirmed and attended the event and the other cancelled.
615
616=== added file 'event/test/ui/event_users.yml'
617--- event/test/ui/event_users.yml 1970-01-01 00:00:00 +0000
618+++ event/test/ui/event_users.yml 2013-05-07 09:48:32 +0000
619@@ -0,0 +1,30 @@
620+-
621+ Create a user as 'Event manager'
622+-
623+ !record {model: res.users, id: res_users_eventmanager}:
624+ company_id: base.main_company
625+ name: Event manager
626+ login: em
627+ password: em
628+ email: eventmanager@yourcompany.com
629+-
630+ I added groups for Event manager.
631+-
632+ !record {model: res.users, id: res_users_eventmanager}:
633+ groups_id:
634+ - event.group_event_manager
635+-
636+ Create a user as 'Event user'
637+-
638+ !record {model: res.users, id: res_users_eventuser}:
639+ company_id: base.main_company
640+ name: User
641+ login: eu
642+ password: eu
643+ email: eventuser@yourcompany.com
644+-
645+ I added groups for Event user.
646+-
647+ !record {model: res.users, id: res_users_eventuser}:
648+ groups_id:
649+ - event.group_event_user
650
651=== modified file 'hr/__openerp__.py'
652--- hr/__openerp__.py 2012-11-29 22:26:45 +0000
653+++ hr/__openerp__.py 2013-05-07 09:48:32 +0000
654@@ -62,6 +62,7 @@
655 ],
656 'demo': ['hr_demo.xml'],
657 'test': [
658+ 'test/hr_users.yml',
659 'test/open2recruit2close_job.yml',
660 'test/hr_demo.yml',
661 ],
662
663=== modified file 'hr/test/hr_demo.yml'
664--- hr/test/hr_demo.yml 2012-03-19 12:28:22 +0000
665+++ hr/test/hr_demo.yml 2013-05-07 09:48:32 +0000
666@@ -1,4 +1,9 @@
667 -
668+ Give the access rights of Hr Officer to create employee.
669+-
670+ !context
671+ uid: 'res_users_hr_officer'
672+-
673 !record {model: hr.job, id: job_developer, view: False}:
674 no_of_employee: 0.0
675 no_of_recruitment: 5.0
676
677=== added file 'hr/test/hr_users.yml'
678--- hr/test/hr_users.yml 1970-01-01 00:00:00 +0000
679+++ hr/test/hr_users.yml 2013-05-07 09:48:32 +0000
680@@ -0,0 +1,42 @@
681+-
682+ Create a user as 'HR Manager'
683+-
684+ !record {model: res.users, id: res_users_hr_manager}:
685+ company_id: base.main_company
686+ name: HR manager
687+ login: hrm
688+ password: hrm
689+-
690+ I added groups for HR Manager.
691+-
692+ !record {model: res.users, id: res_users_hr_manager}:
693+ groups_id:
694+ - base.group_hr_manager
695+-
696+ Create a user as 'HR Officer'
697+-
698+ !record {model: res.users, id: res_users_hr_officer}:
699+ company_id: base.main_company
700+ name: HR Officer
701+ login: hro
702+ password: hro
703+-
704+ I added groups for HR Officer.
705+-
706+ !record {model: res.users, id: res_users_hr_officer}:
707+ groups_id:
708+ - base.group_hr_user
709+-
710+ Create a user as 'Employee'
711+-
712+ !record {model: res.users, id: res_users_employee}:
713+ company_id: base.main_company
714+ name: Employee
715+ login: emp
716+ password: emp
717+-
718+ I added groups for Employee.
719+-
720+ !record {model: res.users, id: res_users_employee}:
721+ groups_id:
722+ - base.group_user
723
724=== modified file 'hr/test/open2recruit2close_job.yml'
725--- hr/test/open2recruit2close_job.yml 2012-06-11 09:34:23 +0000
726+++ hr/test/open2recruit2close_job.yml 2013-05-07 09:48:32 +0000
727@@ -1,4 +1,9 @@
728 -
729+ Give the access rights of Hr Officer to the user to test the process of Human Resource Management.
730+-
731+ !context
732+ uid: 'res_users_hr_officer'
733+-
734 In order to test the process of Human Resource Management, I open Job Postion for "Developer".
735 -
736 !python {model: hr.job}: |
737
738=== modified file 'hr_attendance/test/attendance_process.yml'
739--- hr_attendance/test/attendance_process.yml 2012-11-29 22:26:45 +0000
740+++ hr_attendance/test/attendance_process.yml 2013-05-07 09:48:32 +0000
741@@ -1,4 +1,23 @@
742 -
743+ Create a user as 'HR Attendance Officer'
744+-
745+ !record {model: res.users, id: res_users_attendance_officer}:
746+ company_id: base.main_company
747+ name: HR Officer
748+ login: ao
749+ password: ao
750+-
751+ I added groups for HR Attendance Officer.
752+-
753+ !record {model: res.users, id: res_users_attendance_officer}:
754+ groups_id:
755+ - base.group_hr_user
756+-
757+ Give the access rights of Hr Officer to test attendance process.
758+-
759+ !context
760+ uid: 'res_users_attendance_officer'
761+-
762 In order to test attendance process in OpenERP, I entry of SignIn of employee.
763 -
764 !python {model: hr.employee}: |
765
766=== modified file 'hr_recruitment/security/hr_recruitment_security.xml'
767--- hr_recruitment/security/hr_recruitment_security.xml 2011-06-08 07:29:35 +0000
768+++ hr_recruitment/security/hr_recruitment_security.xml 2013-05-07 09:48:32 +0000
769@@ -9,6 +9,9 @@
770 <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
771 </record>
772
773+ <record id="base.group_hr_user" model="res.groups">
774+ <field name="implied_ids" eval="[(4, ref('base.group_survey_user'))]"/>
775+ </record>
776
777 </data>
778 </openerp>
779
780=== modified file 'hr_recruitment/test/recruitment_process.yml'
781--- hr_recruitment/test/recruitment_process.yml 2013-04-17 06:40:51 +0000
782+++ hr_recruitment/test/recruitment_process.yml 2013-05-07 09:48:32 +0000
783@@ -1,5 +1,23 @@
784 -
785- In Order to test process of Recruitment,
786+ Create a user as 'HR Recruitment Officer'
787+-
788+ !record {model: res.users, id: res_users_hr_recruitment_officer}:
789+ company_id: base.main_company
790+ name: HR Recruitment Officer
791+ login: hrro
792+ password: hrro
793+ email: hrofcr@yourcompany.com
794+-
795+ I added groups for HR Recruitment Officer.
796+-
797+ !record {model: res.users, id: res_users_hr_recruitment_officer}:
798+ groups_id:
799+ - base.group_hr_user
800+-
801+ In Order to test process of Recruitment so giving HR officer's rights,
802+-
803+ !context
804+ uid: 'res_users_hr_recruitment_officer'
805 -
806 An applicant is interested in the job position. So he sends a resume by email.
807 -
808
809=== modified file 'hr_timesheet/__openerp__.py'
810--- hr_timesheet/__openerp__.py 2012-11-29 22:26:45 +0000
811+++ hr_timesheet/__openerp__.py 2013-05-07 09:48:32 +0000
812@@ -57,6 +57,7 @@
813 ],
814 'demo': ['hr_timesheet_demo.xml'],
815 'test': [
816+ 'test/hr_timesheet_users.yml',
817 'test/test_hr_timesheet.yml',
818 'test/hr_timesheet_report.yml',
819 'test/hr_timesheet_demo.yml',
820
821=== modified file 'hr_timesheet/test/hr_timesheet_demo.yml'
822--- hr_timesheet/test/hr_timesheet_demo.yml 2011-12-21 10:52:14 +0000
823+++ hr_timesheet/test/hr_timesheet_demo.yml 2013-05-07 09:48:32 +0000
824@@ -1,4 +1,9 @@
825 -
826+ Give the access rights of Hr Officer to create employee.
827+-
828+ !context
829+ uid: 'res_hr_timesheet_officer'
830+-
831 !record {model: hr.analytic.timesheet, id: working_hours_coding, view: False}:
832 user_id: base.user_demo
833 date: !eval time.strftime('%Y-%m-%d')
834
835=== added file 'hr_timesheet/test/hr_timesheet_users.yml'
836--- hr_timesheet/test/hr_timesheet_users.yml 1970-01-01 00:00:00 +0000
837+++ hr_timesheet/test/hr_timesheet_users.yml 2013-05-07 09:48:32 +0000
838@@ -0,0 +1,45 @@
839+-
840+ Create a user as 'HR timesheet Manager'
841+-
842+ !record {model: res.users, id: res_hr_timesheet_manager}:
843+ company_id: base.main_company
844+ name: HR timesheet manager
845+ login: hrtm
846+ password: hrtm
847+-
848+ I added groups for HR timesheet Manager.
849+-
850+ !record {model: res.users, id: res_hr_timesheet_manager}:
851+ groups_id:
852+ - base.group_hr_manager
853+-
854+ Create a user as 'HR timesheet Officer'
855+-
856+ !context
857+ default_groups_ref: [base.group_hr_user]
858+-
859+ !record {model: res.users, id: res_hr_timesheet_officer}:
860+ company_id: base.main_company
861+ name: HR timesheet Officer
862+ login: hrto
863+ password: hrto
864+-
865+ I added groups for HR timesheet Officer.
866+-
867+ !record {model: res.users, id: res_hr_timesheet_officer}:
868+ groups_id:
869+ - base.group_hr_user
870+-
871+ Create a user as 'Timesheet Employee'
872+-
873+ !record {model: res.users, id: res_hr_timesheet_employee}:
874+ company_id: base.main_company
875+ name: Timesheet Employee
876+ login: empt
877+ password: empt
878+-
879+ I added groups for Timesheet Employee.
880+-
881+ !record {model: res.users, id: res_hr_timesheet_employee}:
882+ groups_id:
883+ - base.group_user
884
885=== modified file 'hr_timesheet/test/test_hr_timesheet.yml'
886--- hr_timesheet/test/test_hr_timesheet.yml 2012-11-29 22:26:45 +0000
887+++ hr_timesheet/test/test_hr_timesheet.yml 2013-05-07 09:48:32 +0000
888@@ -2,6 +2,11 @@
889 In order to test hr_timesheet Module in OpenERP, I make "Sign In/Sign Out for Project" to encode and
890 track time spent on the different projects.
891 -
892+ Give the access rights of Hr Officer to create employee.
893+-
894+ !context
895+ uid: 'res_hr_timesheet_officer'
896+-
897 I create employee "Quentin Paolino" as "User".
898 -
899 !record {model: hr.employee, id: hr.employee_qdp}:
900@@ -10,6 +15,11 @@
901 parent_id: 'hr.employee_al'
902 user_id: 'base.user_demo'
903 -
904+ Give the access rights of Employee to Sign In/Sign Out in Project.
905+-
906+ !context
907+ uid: 'res_hr_timesheet_employee'
908+-
909 On "Sign In/Sign Out by Project" wizard i click on "Sign In/Sign Out" button of this wizard.
910 -
911 !python {model: hr.sign.in.project}: |
912
913=== modified file 'mrp/__openerp__.py'
914--- mrp/__openerp__.py 2013-01-31 18:41:41 +0000
915+++ mrp/__openerp__.py 2013-05-07 09:48:32 +0000
916@@ -77,9 +77,10 @@
917 #TODO: This yml tests are needed to be completely reviewed again because the product wood panel is removed in product demo as it does not suit for new demo context of computer and consultant company
918 # so the ymls are too complex to change at this stage
919 'test': [
920-# 'test/order_demo.yml',
921-# 'test/order_process.yml',
922-# 'test/cancel_order.yml',
923+ 'test/mrp_users.yml',
924+ 'test/order_demo.yml',
925+ 'test/order_process.yml',
926+ 'test/cancel_order.yml',
927 ],
928 'installable': True,
929 'application': True,
930
931=== modified file 'mrp/security/ir.model.access.csv'
932--- mrp/security/ir.model.access.csv 2012-11-30 17:11:30 +0000
933+++ mrp/security/ir.model.access.csv 2013-05-07 09:48:32 +0000
934@@ -1,4 +1,5 @@
935 id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
936+access_account_analytic_line_user,account.analytic.line,account.model_account_analytic_line,group_mrp_user,1,1,1,0
937 access_mrp_workcenter,mrp.workcenter,model_mrp_workcenter,mrp.group_mrp_user,1,0,0,0
938 access_mrp_routing,mrp.routing,model_mrp_routing,mrp.group_mrp_user,1,0,0,0
939 access_mrp_routing_workcenter,mrp.routing.workcenter,model_mrp_routing_workcenter,mrp.group_mrp_user,1,0,0,0
940
941=== modified file 'mrp/security/mrp_security.xml'
942--- mrp/security/mrp_security.xml 2012-07-13 17:08:38 +0000
943+++ mrp/security/mrp_security.xml 2013-05-07 09:48:32 +0000
944@@ -4,6 +4,7 @@
945
946 <record id="group_mrp_user" model="res.groups">
947 <field name="name">User</field>
948+ <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
949 <field name="category_id" ref="base.module_category_manufacturing"/>
950 </record>
951 <record id="group_mrp_manager" model="res.groups">
952
953=== modified file 'mrp/test/cancel_order.yml'
954--- mrp/test/cancel_order.yml 2012-11-29 22:26:45 +0000
955+++ mrp/test/cancel_order.yml 2013-05-07 09:48:32 +0000
956@@ -1,4 +1,9 @@
957 -
958+ MRP user can cancelled Production Order, so let's check data with giving the access rights of user.
959+-
960+ !context
961+ uid: 'res_users_mrp_user'
962+-
963 I first confirm order for PC Assemble SC349.
964 -
965 !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_test1}
966
967=== added file 'mrp/test/mrp_users.yml'
968--- mrp/test/mrp_users.yml 1970-01-01 00:00:00 +0000
969+++ mrp/test/mrp_users.yml 2013-05-07 09:48:32 +0000
970@@ -0,0 +1,30 @@
971+-
972+ Create a user as 'MRP Manager'
973+-
974+ !record {model: res.users, id: res_users_mrp_manager}:
975+ company_id: base.main_company
976+ name: MRP Manager
977+ login: mam
978+ password: mam
979+ email: mrp_manager@yourcompany.com
980+-
981+ I added groups for MRP Manager.
982+-
983+ !record {model: res.users, id: res_users_mrp_manager}:
984+ groups_id:
985+ - mrp.group_mrp_manager
986+-
987+ Create a user as 'MRP User'
988+-
989+ !record {model: res.users, id: res_users_mrp_user}:
990+ company_id: base.main_company
991+ name: MRP User
992+ login: mau
993+ password: mau
994+ email: mrp_user@yourcompany.com
995+-
996+ I added groups for MRP User.
997+-
998+ !record {model: res.users, id: res_users_mrp_user}:
999+ groups_id:
1000+ - mrp.group_mrp_user
1001\ No newline at end of file
1002
1003=== modified file 'mrp/test/order_demo.yml'
1004--- mrp/test/order_demo.yml 2012-11-29 22:26:45 +0000
1005+++ mrp/test/order_demo.yml 2013-05-07 09:48:32 +0000
1006@@ -1,4 +1,9 @@
1007 -
1008+ MRP user can create Production Order, so let's check data with giving the access rights of user.
1009+-
1010+ !context
1011+ uid: 'res_users_mrp_user'
1012+-
1013 I create Production Order of PC Assemble SC349 to produce 5.0 Unit.
1014 -
1015 !record {model: mrp.production, id: mrp_production_test1}:
1016
1017=== modified file 'mrp/test/order_process.yml'
1018--- mrp/test/order_process.yml 2013-02-22 13:35:11 +0000
1019+++ mrp/test/order_process.yml 2013-05-07 09:48:32 +0000
1020@@ -1,4 +1,9 @@
1021 -
1022+ MRP user can doing all process related to Production Order, so let's check data with giving the access rights of user.
1023+-
1024+ !context
1025+ uid: 'res_users_mrp_user'
1026+-
1027 I compute the production order.
1028 -
1029 !python {model: mrp.production}: |
1030@@ -23,6 +28,7 @@
1031 I confirm the Production Order.
1032 -
1033 !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_test1}
1034+
1035 -
1036 I check details of Produce Move of Production Order to trace Final Product.
1037 -
1038@@ -59,6 +65,16 @@
1039 assert move_line.location_id.id == routing_loc or order.location_src_id.id, "Source location is not correspond in 'To consume line'."
1040 assert move_line.location_dest_id.id == source_location_id, "Destination Location is not correspond in 'To consume line'."
1041 -
1042+ I consume raw materials and put one material in scrap location due to waste it.
1043+-
1044+ !python {model: mrp.production}: |
1045+ scrap_location_ids = self.pool.get('stock.location').search(cr, uid, [('scrap_location','=',True)])
1046+ scrap_location_id = scrap_location_ids[0]
1047+ order = self.browse(cr, uid, ref("mrp_production_test1"))
1048+ for move in order.move_lines:
1049+ if move.product_id.id == ref("product.product_product_6"):
1050+ move.action_scrap(5.0, scrap_location_id)
1051+-
1052 I check details of an Internal Shipment after confirmed production order to bring components in Raw Materials Location.
1053 -
1054 !python {model: mrp.production}: |
1055@@ -150,17 +166,6 @@
1056 order = self.browse(cr, uid, ref("mrp_production_test1"))
1057 assert order.state == 'in_production', 'Production order should be in production State.'
1058 -
1059- I consume raw materials and put one material in scrap location due to waste it.
1060--
1061- !python {model: mrp.production}: |
1062- scrap_location_ids = self.pool.get('stock.location').search(cr, uid, [('scrap_location','=',True)])
1063- scrap_location_id = scrap_location_ids[0]
1064- order = self.browse(cr, uid, ref("mrp_production_test1"))
1065- for move in order.move_lines:
1066- move.action_consume(move.product_qty)
1067- if move.product_id.id == ref("product.product_product_6"):
1068- move.action_scrap(5.0, scrap_location_id)
1069--
1070 I produce product.
1071 -
1072 !python {model: mrp.product.produce}: |
1073
1074=== modified file 'mrp_operations/__openerp__.py'
1075--- mrp_operations/__openerp__.py 2012-11-29 22:26:45 +0000
1076+++ mrp_operations/__openerp__.py 2013-05-07 09:48:32 +0000
1077@@ -70,7 +70,7 @@
1078 'mrp_operations_demo.yml'
1079 ],
1080 'test': [
1081-# 'test/workcenter_operations.yml',
1082+ 'test/workcenter_operations.yml',
1083 ],
1084 'installable': True,
1085 'auto_install': False,
1086
1087=== modified file 'mrp_operations/test/workcenter_operations.yml'
1088--- mrp_operations/test/workcenter_operations.yml 2013-02-13 08:35:19 +0000
1089+++ mrp_operations/test/workcenter_operations.yml 2013-05-07 09:48:32 +0000
1090@@ -1,6 +1,24 @@
1091 -
1092+ Create a user as 'MRP User'
1093+-
1094+ !record {model: res.users, id: res_mrp_operation_user}:
1095+ company_id: base.main_company
1096+ name: MRP User
1097+ login: maou
1098+ password: maou
1099+ email: mrp_operation_user@yourcompany.com
1100+-
1101+ I added groups for MRP User.
1102+-
1103+ !record {model: res.users, id: res_mrp_operation_user}:
1104+ groups_id:
1105+ - mrp.group_mrp_user
1106+-
1107 In order to test mrp_operations with OpenERP, I refer created production order of PC Assemble SC349
1108- with routing - Manual Component's Assembly to test complete production process with respect of workcenter.
1109+ with routing - Manual Component's Assembly to test complete production process with respect of workcenter with giving access rights of MRP User.
1110+-
1111+ !context
1112+ uid: 'res_mrp_operation_user'
1113 -
1114 I compute the production order.
1115 -
1116@@ -92,7 +110,7 @@
1117 I print a Barcode Report of Operation line.
1118 -
1119 !python {model: mrp_operations.operation.code}: |
1120- import netsvc, tools, os
1121+ from openerp import netsvc, tools
1122 (data, format) = netsvc.LocalService('report.mrp.code.barcode').create(cr, uid, [ref('mrp_operations.mrp_op_1'),ref('mrp_operations.mrp_op_2'),ref('mrp_operations.mrp_op_3'),ref('mrp_operations.mrp_op_4'),ref('mrp_operations.mrp_op_5')], {}, {})
1123 if tools.config['test_report_directory']:
1124 file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-barcode_report.'+format), 'wb+').write(data)
1125@@ -101,7 +119,7 @@
1126 I print Workcenter's Barcode Report.
1127 -
1128 !python {model: mrp.workcenter}: |
1129- import netsvc, tools, os
1130+ from openerp import netsvc, tools
1131 (data, format) = netsvc.LocalService('report.mrp.wc.barcode').create(cr, uid, [ref('mrp.mrp_workcenter_0'),ref('mrp.mrp_workcenter_1')], {}, {})
1132 if tools.config['test_report_directory']:
1133 file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-workcenter_barcode_report.'+format), 'wb+').write(data)
1134
1135=== modified file 'mrp_repair/__openerp__.py'
1136--- mrp_repair/__openerp__.py 2012-11-29 22:26:45 +0000
1137+++ mrp_repair/__openerp__.py 2013-05-07 09:48:32 +0000
1138@@ -52,7 +52,8 @@
1139 'mrp_repair_report.xml',
1140 ],
1141 'demo': ['mrp_repair_demo.yml'],
1142- 'test': ['test/test_mrp_repair_noneinv.yml',
1143+ 'test': ['test/mrp_repair_users.yml',
1144+ 'test/test_mrp_repair_noneinv.yml',
1145 'test/test_mrp_repair_b4inv.yml',
1146 'test/test_mrp_repair_afterinv.yml',
1147 'test/test_mrp_repair_cancel.yml',
1148
1149=== added file 'mrp_repair/test/mrp_repair_users.yml'
1150--- mrp_repair/test/mrp_repair_users.yml 1970-01-01 00:00:00 +0000
1151+++ mrp_repair/test/mrp_repair_users.yml 2013-05-07 09:48:32 +0000
1152@@ -0,0 +1,30 @@
1153+-
1154+ Create a user as 'MRP Repair Manager'
1155+-
1156+ !record {model: res.users, id: res_mrp_repair_manager}:
1157+ company_id: base.main_company
1158+ name: MRP Manager
1159+ login: marm
1160+ password: marm
1161+ email: mrp_repair_manager@yourcompany.com
1162+-
1163+ I added groups for MRP Repair Manager.
1164+-
1165+ !record {model: res.users, id: res_mrp_repair_manager}:
1166+ groups_id:
1167+ - mrp.group_mrp_manager
1168+-
1169+ Create a user as 'MRP Repair User'
1170+-
1171+ !record {model: res.users, id: res_mrp_repair_user}:
1172+ company_id: base.main_company
1173+ name: MRP User
1174+ login: maru
1175+ password: maru
1176+ email: mrp_repair_user@yourcompany.com
1177+-
1178+ I added groups for MRP Repair User.
1179+-
1180+ !record {model: res.users, id: res_mrp_repair_user}:
1181+ groups_id:
1182+ - mrp.group_mrp_user
1183\ No newline at end of file
1184
1185=== modified file 'mrp_repair/test/test_mrp_repair_afterinv.yml'
1186--- mrp_repair/test/test_mrp_repair_afterinv.yml 2013-03-21 13:18:24 +0000
1187+++ mrp_repair/test/test_mrp_repair_afterinv.yml 2013-05-07 09:48:32 +0000
1188@@ -1,5 +1,8 @@
1189 -
1190- In order to test Invoice Method 'After Repair'.
1191+ In order to test Invoice Method 'After Repair' with giving the access rights of mrp user.
1192+-
1193+ !context
1194+ uid: 'res_mrp_repair_user'
1195 -
1196 I confirm Repair order taking Invoice Method 'After Repair'.
1197 -
1198
1199=== modified file 'mrp_repair/test/test_mrp_repair_b4inv.yml'
1200--- mrp_repair/test/test_mrp_repair_b4inv.yml 2013-03-21 13:18:24 +0000
1201+++ mrp_repair/test/test_mrp_repair_b4inv.yml 2013-05-07 09:48:32 +0000
1202@@ -1,5 +1,8 @@
1203 -
1204- Now I test for Invoice Method 'Before Repair'.
1205+ Now I test for Invoice Method 'Before Repair' with giving the access rights of mrp user.
1206+-
1207+ !context
1208+ uid: 'res_mrp_repair_user'
1209 -
1210 I confirm Repair order for Invoice Method 'Before Repair'.
1211 -
1212
1213=== modified file 'mrp_repair/test/test_mrp_repair_cancel.yml'
1214--- mrp_repair/test/test_mrp_repair_cancel.yml 2012-11-29 22:26:45 +0000
1215+++ mrp_repair/test/test_mrp_repair_cancel.yml 2013-05-07 09:48:32 +0000
1216@@ -1,6 +1,9 @@
1217 -
1218 In order to test the cancel flow of mrp_repair module,
1219- I start by creating new copy Repair order for "PC Assemble SC234" product.
1220+ I start by creating new copy Repair order for "PC Assemble SC234" product with giving access rights of mrp user.
1221+-
1222+ !context
1223+ uid: 'res_mrp_repair_user'
1224 -
1225 !python {model: mrp.repair}: |
1226 copy_id = self.copy(cr, uid, ref("mrp_repair_rmrp1"))
1227
1228=== modified file 'mrp_repair/test/test_mrp_repair_noneinv.yml'
1229--- mrp_repair/test/test_mrp_repair_noneinv.yml 2013-03-21 13:18:24 +0000
1230+++ mrp_repair/test/test_mrp_repair_noneinv.yml 2013-05-07 09:48:32 +0000
1231@@ -1,5 +1,8 @@
1232 -
1233- In order to test "mrp_repair" module, I start with confirm state, and start repair.
1234+ In order to test "mrp_repair" module, I start with confirm state, and start repair with giving the access rights of mrp user.
1235+-
1236+ !context
1237+ uid: 'res_mrp_repair_user'
1238 -
1239 I confirm Repair order for Invoice Method 'No Invoice'.
1240 -
1241
1242=== modified file 'project/__openerp__.py'
1243--- project/__openerp__.py 2013-01-31 18:41:41 +0000
1244+++ project/__openerp__.py 2013-05-07 09:48:32 +0000
1245@@ -79,6 +79,7 @@
1246 ],
1247 'demo': ['project_demo.xml'],
1248 'test': [
1249+ 'test/project_users.yml',
1250 'test/project_demo.yml',
1251 'test/project_process.yml',
1252 'test/task_process.yml',
1253
1254=== modified file 'project/security/ir.model.access.csv'
1255--- project/security/ir.model.access.csv 2013-02-05 07:00:36 +0000
1256+++ project/security/ir.model.access.csv 2013-05-07 09:48:32 +0000
1257@@ -19,6 +19,7 @@
1258 access_project_task_history_cumulative,project.task.history project,project.model_project_task_history_cumulative,project.group_project_manager,1,0,0,0
1259 access_project_task_history_cumulative,project.task.history project,project.model_project_task_history_cumulative,project.group_project_user,1,0,0,0
1260 access_resource_calendar,project.resource_calendar manager,resource.model_resource_calendar,project.group_project_manager,1,0,0,0
1261+access_resource_calendar_leaves,project.resource_calendar_leaves manager,resource.model_resource_calendar_leaves,project.group_project_manager,1,0,0,0
1262 access_project_category,project.project_category,model_project_category,,1,0,0,0
1263 access_project_category_manager,project.project_category,model_project_category,project.group_project_manager,1,1,1,1
1264 access_mail_alias,mail.alias,mail.model_mail_alias,project.group_project_manager,1,1,1,1
1265
1266=== modified file 'project/security/project_security.xml'
1267--- project/security/project_security.xml 2013-04-12 14:37:19 +0000
1268+++ project/security/project_security.xml 2013-05-07 09:48:32 +0000
1269@@ -4,6 +4,7 @@
1270
1271 <record id="group_project_user" model="res.groups">
1272 <field name="name">User</field>
1273+ <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
1274 <field name="category_id" ref="base.module_category_project_management"/>
1275 </record>
1276
1277
1278=== modified file 'project/test/project_demo.yml'
1279--- project/test/project_demo.yml 2012-11-29 22:26:45 +0000
1280+++ project/test/project_demo.yml 2013-05-07 09:48:32 +0000
1281@@ -1,12 +1,23 @@
1282 -
1283+ I Update project and create the new task with project manager
1284+-
1285+ !context
1286+ uid: 'res_users_project_manager'
1287+-
1288+ Change partner for The Jackson Group's Project
1289+-
1290 !record {model: project.project, id: project_project_1, view: False}:
1291 partner_id: base.res_partner_2
1292 -
1293- !record {model: project.task, id: project_task_1, view: False}:
1294+ I create task for The Jackson Group's Project project user can create task.
1295+-
1296+ !context
1297+ uid: 'res_users_project_user'
1298+-
1299+ !record {model: project.task, id: project_task_for_project1}:
1300+ name: Worked on new specification
1301+ user_id: res_users_project_user
1302 remaining_hours: 10.00
1303--
1304- !record {model: project.task, id: project_task_1, view: False}:
1305 planned_hours: 10.00
1306--
1307- !record {model: project.task, id: project_task_1, view: False}:
1308- project_id: project_project_1
1309\ No newline at end of file
1310+ project_id: project_project_1
1311+ stage_id: project_tt_specification
1312\ No newline at end of file
1313
1314=== modified file 'project/test/project_process.yml'
1315--- project/test/project_process.yml 2012-11-29 22:26:45 +0000
1316+++ project/test/project_process.yml 2013-05-07 09:48:32 +0000
1317@@ -1,4 +1,9 @@
1318 -
1319+ Test the whole project process with project manager.
1320+-
1321+ !context
1322+ uid: 'res_users_project_manager'
1323+-
1324 In order to Test Process of Project Management,
1325 -
1326 I create duplicate template.
1327
1328=== added file 'project/test/project_users.yml'
1329--- project/test/project_users.yml 1970-01-01 00:00:00 +0000
1330+++ project/test/project_users.yml 2013-05-07 09:48:32 +0000
1331@@ -0,0 +1,30 @@
1332+-
1333+ Create a user as 'Project manager'
1334+-
1335+ !record {model: res.users, id: res_users_project_manager}:
1336+ company_id: base.main_company
1337+ name: Project Manager
1338+ login: prm
1339+ password: prm
1340+ email: projectmanager@yourcompany.com
1341+-
1342+ I added groups for Project manager.
1343+-
1344+ !record {model: res.users, id: res_users_project_manager}:
1345+ groups_id:
1346+ - project.group_project_manager
1347+-
1348+ Create a user as 'Project user'
1349+-
1350+ !record {model: res.users, id: res_users_project_user}:
1351+ company_id: base.main_company
1352+ name: Project User
1353+ login: pru
1354+ password: pru
1355+ email: projectuser@yourcompany.com
1356+-
1357+ I added groups for Project user.
1358+-
1359+ !record {model: res.users, id: res_users_project_user}:
1360+ groups_id:
1361+ - project.group_project_user
1362\ No newline at end of file
1363
1364=== modified file 'project/test/task_process.yml'
1365--- project/test/task_process.yml 2012-11-29 22:26:45 +0000
1366+++ project/test/task_process.yml 2013-05-07 09:48:32 +0000
1367@@ -1,46 +1,51 @@
1368 -
1369+ Test the whole task process with project user.
1370+-
1371+ !context
1372+ uid: 'res_users_project_user'
1373+-
1374 I put task in pending due to specification is not clear.
1375 -
1376 !python {model: project.task}: |
1377- self.do_pending(cr, uid, [ref("project_task_1")])
1378- context.update({"active_id": ref("project_task_1")})
1379+ self.do_pending(cr, uid, [ref("project_task_for_project1")])
1380+ context.update({"active_id": ref("project_task_for_project1")})
1381 -
1382 I check state of task after put in pending.
1383 -
1384- !assert {model: project.task, id: project_task_1, severity: error, string: task should be in pending state}:
1385+ !assert {model: project.task, id: project_task_for_project1, severity: error, string: task should be in pending state}:
1386 - state == "pending"
1387 -
1388 !record {model: project.task.delegate, id: delegate_id}:
1389- user_id: base.user_demo
1390+ user_id: res_users_project_user
1391 planned_hours: 12.0
1392 planned_hours_me: 2.0
1393 -
1394 Now I delegate task to team member.
1395 -
1396 !python {model: project.task.delegate}: |
1397- self.delegate(cr, uid, [ref("delegate_id")], {"active_id": ref("project_task_1")})
1398+ self.delegate(cr, uid, [ref("delegate_id")], {"active_id": ref("project_task_for_project1")})
1399 -
1400 I check delegated task details.
1401 -
1402 !python {model: project.task}: |
1403- task = self.browse(cr, uid, ref("project_task_1"), context=context)
1404+ task = self.browse(cr, uid, ref("project_task_for_project1"), context=context)
1405 assert task.planned_hours == 2.0, "Planning hours is not correct after delegated."
1406 assert task.state == "pending", "Task should be in Pending after delegated."
1407 -
1408 I re-open the task.
1409 -
1410 !python {model: project.task}: |
1411- self.do_reopen(cr, uid, [ref("project_task_1")])
1412+ self.do_reopen(cr, uid, [ref("project_task_for_project1")])
1413 -
1414 I check reopened task details.
1415 -
1416- !assert {model: project.task, id: project_task_1, severity: error, string: task should be open.}:
1417+ !assert {model: project.task, id: project_task_for_project1, severity: error, string: task should be open.}:
1418 - state == "open"
1419 -
1420 I change the stage of task to next stage.
1421 -
1422 !python {model: project.task}: |
1423- self.stage_next(cr, uid, [ref("project_task_1")])
1424+ self.stage_next(cr, uid, [ref("project_task_for_project1")])
1425 -
1426 !record {model: project.task.reevaluate, id: reevaluate_id}:
1427 remaining_hours : 120
1428@@ -48,29 +53,29 @@
1429 I reevaluate task with remaining hours.
1430 -
1431 !python {model: project.task.reevaluate}: |
1432- self.compute_hours(cr, uid, [ref("reevaluate_id")], {"active_id": ref("project_task_1")})
1433+ self.compute_hours(cr, uid, [ref("reevaluate_id")], {"active_id": ref("project_task_for_project1")})
1434 -
1435 I check remaining hours after reevaluated task.
1436 -
1437- !assert {model: project.task, id: project_task_1, severity: error, string: task should be reevaluated}:
1438+ !assert {model: project.task, id: project_task_for_project1, severity: error, string: task should be reevaluated}:
1439 - remaining_hours == 120.0
1440 -
1441 I close the task.
1442 -
1443 !python {model: project.task}: |
1444- self.action_close(cr, uid, [ref("project_task_1")])
1445+ self.action_close(cr, uid, [ref("project_task_for_project1")])
1446 -
1447 I check state after closed.
1448 -
1449- !assert {model: project.task, id: project_task_1, severity: error, string: task is in open state}:
1450+ !assert {model: project.task, id: project_task_for_project1, severity: error, string: task is in open state}:
1451 - state == "done"
1452 -
1453 I change the stage of task to previous stage.
1454 -
1455 !python {model: project.task}: |
1456- self.stage_previous(cr, uid, [ref("project_task_1")])
1457+ self.stage_previous(cr, uid, [ref("project_task_for_project1")])
1458 -
1459 I cancel Task.
1460 -
1461 !python {model: project.task}: |
1462- self.do_cancel(cr, uid, [ref("project_task_2")])
1463+ self.do_cancel(cr, uid, [ref("project_task_for_project1")])
1464
1465=== modified file 'project_issue/__openerp__.py'
1466--- project_issue/__openerp__.py 2012-11-29 22:26:45 +0000
1467+++ project_issue/__openerp__.py 2013-05-07 09:48:32 +0000
1468@@ -53,6 +53,7 @@
1469 ],
1470 'demo': ['project_issue_demo.xml'],
1471 'test': [
1472+ 'test/issue_users.yml',
1473 'test/subscribe_issue.yml',
1474 'test/issue_process.yml',
1475 'test/cancel_issue.yml',
1476
1477=== modified file 'project_issue/test/cancel_issue.yml'
1478--- project_issue/test/cancel_issue.yml 2012-12-21 12:17:53 +0000
1479+++ project_issue/test/cancel_issue.yml 2013-05-07 09:48:32 +0000
1480@@ -1,4 +1,9 @@
1481 -
1482+ Project user can cancelled issue, so let's check data with giving the access rights of user.
1483+-
1484+ !context
1485+ uid: 'res_users_project_issue_user'
1486+-
1487 In order to test process of issue tracking in OpenERP, I cancel the unqualified Issue.
1488 -
1489 !python {model: project.issue}: |
1490
1491=== modified file 'project_issue/test/issue_demo.yml'
1492--- project_issue/test/issue_demo.yml 2012-11-29 22:26:45 +0000
1493+++ project_issue/test/issue_demo.yml 2013-05-07 09:48:32 +0000
1494@@ -1,7 +1,8 @@
1495 -
1496- !record {model: project.issue, id: project_task_1, view: False}:
1497- task_id: 'project.project_task_17'
1498- name: 'Error in account module'
1499+ Test the whole create project issue with project user.
1500+-
1501+ !context
1502+ uid: 'res_users_project_issue_user'
1503 -
1504 !record {model: project.issue, id: project01, view: False}:
1505 project_id: 'project.project_project_2'
1506
1507=== modified file 'project_issue/test/issue_process.yml'
1508--- project_issue/test/issue_process.yml 2012-11-29 22:26:45 +0000
1509+++ project_issue/test/issue_process.yml 2013-05-07 09:48:32 +0000
1510@@ -1,4 +1,9 @@
1511 -
1512+ Project user can subscribe issue, so let's check data with giving the access rights of user.
1513+-
1514+ !context
1515+ uid: 'res_users_project_issue_user'
1516+-
1517 In order to test process of issue tracking in OpenERP, I Open the Issue.
1518 -
1519 !python {model: project.issue}: |
1520@@ -41,11 +46,21 @@
1521 !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in open state}:
1522 - state == 'open'
1523 -
1524+ Only project manager can create Task for Issue, so let's check data with giving the access rights of manager.
1525+-
1526+ !context
1527+ uid: 'res_users_project_issue_manager'
1528+-
1529 I create Task for Issue.
1530 -
1531 !python {model: project.issue}: |
1532 self.convert_issue_task(cr, uid, [ref("crm_case_buginaccountsmodule0")])
1533 -
1534+ After resolving Issue Project user can close issue, so let's check data with giving the access rights of user.
1535+-
1536+ !context
1537+ uid: 'res_users_project_issue_user'
1538+-
1539 I close Issue after resolving it
1540 -
1541 !python {model: project.issue}: |
1542
1543=== added file 'project_issue/test/issue_users.yml'
1544--- project_issue/test/issue_users.yml 1970-01-01 00:00:00 +0000
1545+++ project_issue/test/issue_users.yml 2013-05-07 09:48:32 +0000
1546@@ -0,0 +1,30 @@
1547+-
1548+ Create a user as 'Project manager'
1549+-
1550+ !record {model: res.users, id: res_users_project_issue_manager}:
1551+ company_id: base.main_company
1552+ name: Project Manager
1553+ login: prim
1554+ password: prim
1555+ email: issuemanager@yourcompany.com
1556+-
1557+ I added groups for Project manager.
1558+-
1559+ !record {model: res.users, id: res_users_project_issue_manager}:
1560+ groups_id:
1561+ - project.group_project_manager
1562+-
1563+ Create a user as 'Project user'
1564+-
1565+ !record {model: res.users, id: res_users_project_issue_user}:
1566+ company_id: base.main_company
1567+ name: Project User
1568+ login: priu
1569+ password: priu
1570+ email: issueuser@yourcompany.com
1571+-
1572+ I added groups for Project user.
1573+-
1574+ !record {model: res.users, id: res_users_project_issue_user}:
1575+ groups_id:
1576+ - project.group_project_user
1577\ No newline at end of file
1578
1579=== modified file 'project_issue/test/subscribe_issue.yml'
1580--- project_issue/test/subscribe_issue.yml 2013-04-17 06:40:51 +0000
1581+++ project_issue/test/subscribe_issue.yml 2013-05-07 09:48:32 +0000
1582@@ -1,5 +1,5 @@
1583 -
1584- In Order to test process of Issue in OpenERP, Custmer send the issue by email.
1585+ In Order to test process of Issue in OpenERP, Customer send the issue by email.
1586 -
1587 !python {model: mail.thread}: |
1588 request_file = open(openerp.modules.module.get_module_resource('project_issue','test', 'issue.eml'),'rb')
1589
1590=== modified file 'purchase/__openerp__.py'
1591--- purchase/__openerp__.py 2012-11-29 22:26:45 +0000
1592+++ purchase/__openerp__.py 2013-05-07 09:48:32 +0000
1593@@ -67,6 +67,7 @@
1594 'res_config_view.xml',
1595 ],
1596 'test': [
1597+ 'test/ui/purchase_users.yml',
1598 'test/process/cancel_order.yml',
1599 'test/process/rfq2order2done.yml',
1600 'test/process/generate_invoice_from_reception.yml',
1601
1602=== modified file 'purchase/purchase_order_demo.yml'
1603--- purchase/purchase_order_demo.yml 2012-11-29 22:26:45 +0000
1604+++ purchase/purchase_order_demo.yml 2013-05-07 09:48:32 +0000
1605@@ -1,4 +1,6 @@
1606 -
1607+ Give access rights of Purchase user to create purchase order
1608+-
1609 !record {model: purchase.order, id: purchase_order_1}:
1610 partner_id: base.res_partner_1
1611 invoice_method: order
1612
1613=== modified file 'purchase/test/process/cancel_order.yml'
1614--- purchase/test/process/cancel_order.yml 2012-12-06 10:06:12 +0000
1615+++ purchase/test/process/cancel_order.yml 2013-05-07 09:48:32 +0000
1616@@ -1,4 +1,9 @@
1617 -
1618+ Purchase user can also cancel order therfore test with that user which have Purchase user rights.
1619+-
1620+ !context
1621+ uid: 'res_users_purchase_user'
1622+-
1623 In order to test the cancel flow, I start it from canceling confirmed purchase order.
1624 -
1625 I confirm the purchase order.
1626
1627=== modified file 'purchase/test/process/generate_invoice_from_reception.yml'
1628--- purchase/test/process/generate_invoice_from_reception.yml 2012-11-29 22:26:45 +0000
1629+++ purchase/test/process/generate_invoice_from_reception.yml 2013-05-07 09:48:32 +0000
1630@@ -1,4 +1,9 @@
1631 -
1632+ Purchase user can create an invoice for order on receptions therfore test with that user which have Purchase user rights.
1633+-
1634+ !context
1635+ uid: 'res_users_purchase_user'
1636+-
1637 I confirm another order where invoice control is 'Bases on incoming shipments'.
1638 -
1639 !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_2}
1640
1641=== modified file 'purchase/test/process/invoice_on_poline.yml'
1642--- purchase/test/process/invoice_on_poline.yml 2012-11-29 22:26:45 +0000
1643+++ purchase/test/process/invoice_on_poline.yml 2013-05-07 09:48:32 +0000
1644@@ -1,4 +1,9 @@
1645 -
1646+ Purchase User confirm the order and create invoice based on purchase order line.
1647+-
1648+ !context
1649+ uid: 'res_users_purchase_user'
1650+-
1651 I confirm purchase order which has invoicing control method "Based on Purchase Order Lines".
1652 -
1653 !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_6}
1654@@ -17,10 +22,4 @@
1655 !python {model: purchase.order}: |
1656 purchase_order = self.browse(cr, uid, ref("purchase_order_6"))
1657 for purchase_line in purchase_order.order_line:
1658- assert len(purchase_order.invoice_ids) == 1, "Invoice should be generated."
1659--
1660- I set the default invoicing control method "Based on Purchase Order Lines".
1661--
1662- !python {model: purchase.config.settings}: |
1663- new_id = self.create(cr, uid, {'default_invoice_method': 'manual'})
1664- self.execute(cr, uid, [new_id])
1665+ assert len(purchase_order.invoice_ids) == 1, "Invoice should be generated."
1666\ No newline at end of file
1667
1668=== modified file 'purchase/test/process/merge_order.yml'
1669--- purchase/test/process/merge_order.yml 2013-02-18 08:01:09 +0000
1670+++ purchase/test/process/merge_order.yml 2013-05-07 09:48:32 +0000
1671@@ -1,4 +1,9 @@
1672 -
1673+ Give access rights of Purchase user to merge two RFQ.
1674+-
1675+ !context
1676+ uid: 'res_users_purchase_user'
1677+-
1678 In order to merge RFQ, I merge two RFQ which has same supplier and check new merged order.
1679 -
1680 !python {model: purchase.order}: |
1681
1682=== modified file 'purchase/test/ui/delete_order.yml'
1683--- purchase/test/ui/delete_order.yml 2012-11-29 22:26:45 +0000
1684+++ purchase/test/ui/delete_order.yml 2013-05-07 09:48:32 +0000
1685@@ -1,4 +1,9 @@
1686 -
1687+ Give access rights of Purchase user to delete purchase order
1688+-
1689+ !context
1690+ uid: 'res_users_purchase_user'
1691+-
1692 In order to test to delete process on purchase order.
1693 -
1694 I try to delete confirmed order and check Error Message.
1695
1696=== added file 'purchase/test/ui/purchase_users.yml'
1697--- purchase/test/ui/purchase_users.yml 1970-01-01 00:00:00 +0000
1698+++ purchase/test/ui/purchase_users.yml 2013-05-07 09:48:32 +0000
1699@@ -0,0 +1,30 @@
1700+-
1701+ Create a user as 'Purchase manager'
1702+-
1703+ !record {model: res.users, id: res_users_purchase_manager}:
1704+ company_id: base.main_company
1705+ name: Purchase Manager
1706+ login: pm
1707+ password: pm
1708+ email: purchasemanager@yourcompany.com
1709+-
1710+ I added groups for Purchase manager.
1711+-
1712+ !record {model: res.users, id: res_users_purchase_manager}:
1713+ groups_id:
1714+ - purchase.group_purchase_manager
1715+-
1716+ Create a user as 'Purchase user'
1717+-
1718+ !record {model: res.users, id: res_users_purchase_user}:
1719+ company_id: base.main_company
1720+ name: Purchase User
1721+ login: pu
1722+ password: pu
1723+ email: purchaseuser@yourcompany.com
1724+-
1725+ I added groups for Purchase user.
1726+-
1727+ !record {model: res.users, id: res_users_purchase_user}:
1728+ groups_id:
1729+ - purchase.group_purchase_user
1730
1731=== modified file 'purchase_requisition/__openerp__.py'
1732--- purchase_requisition/__openerp__.py 2012-11-29 22:26:45 +0000
1733+++ purchase_requisition/__openerp__.py 2013-05-07 09:48:32 +0000
1734@@ -43,6 +43,7 @@
1735 ],
1736 'auto_install': False,
1737 'test': [
1738+ 'test/purchase_requisition_users.yml',
1739 'test/purchase_requisition_demo.yml',
1740 'test/purchase_requisition.yml',
1741 'test/cancel_purchase_requisition.yml',
1742
1743=== modified file 'purchase_requisition/security/purchase_tender.xml'
1744--- purchase_requisition/security/purchase_tender.xml 2012-07-13 17:08:38 +0000
1745+++ purchase_requisition/security/purchase_tender.xml 2013-05-07 09:48:32 +0000
1746@@ -10,6 +10,7 @@
1747
1748 <record id="group_purchase_requisition_user" model="res.groups">
1749 <field name="name">User</field>
1750+ <field name="implied_ids" eval="[(4, ref('purchase.group_purchase_user'))]"/>
1751 <field name="category_id" ref="module_category_purchase_requisition"/>
1752 </record>
1753
1754
1755=== modified file 'purchase_requisition/test/cancel_purchase_requisition.yml'
1756--- purchase_requisition/test/cancel_purchase_requisition.yml 2011-12-02 05:15:06 +0000
1757+++ purchase_requisition/test/cancel_purchase_requisition.yml 2013-05-07 09:48:32 +0000
1758@@ -1,4 +1,9 @@
1759 -
1760+ Give access rights of Purchase Requisition User to cancelled requisition
1761+-
1762+ !context
1763+ uid: 'res_users_purchase_requisition_user'
1764+-
1765 I cancel requisition.
1766 -
1767 !python {model: purchase.requisition}: |
1768
1769=== modified file 'purchase_requisition/test/purchase_requisition.yml'
1770--- purchase_requisition/test/purchase_requisition.yml 2013-03-22 13:49:58 +0000
1771+++ purchase_requisition/test/purchase_requisition.yml 2013-05-07 09:48:32 +0000
1772@@ -31,6 +31,11 @@
1773 assert line.product_uom_id.id == procurement.product_uom.id, "UOM is not correspond."
1774 assert line.product_qty == procurement.product_qty, "Quantity is not correspond."
1775 -
1776+ Give access rights of Purchase Requisition User to open requisition
1777+-
1778+ !context
1779+ uid: 'res_users_purchase_requisition_user'
1780+-
1781 I open another requisition.
1782 -
1783 !python {model: purchase.requisition}: |
1784
1785=== modified file 'purchase_requisition/test/purchase_requisition_demo.yml'
1786--- purchase_requisition/test/purchase_requisition_demo.yml 2012-11-29 22:26:45 +0000
1787+++ purchase_requisition/test/purchase_requisition_demo.yml 2013-05-07 09:48:32 +0000
1788@@ -1,4 +1,9 @@
1789 -
1790+ Give access rights of Purchase Requisition User to create requisition
1791+-
1792+ !context
1793+ uid: 'res_users_purchase_requisition_user'
1794+-
1795 In order to test process of the purchase requisition ,I create requisition
1796 -
1797 !record {model: purchase.requisition, id: requisition1}:
1798
1799=== added file 'purchase_requisition/test/purchase_requisition_users.yml'
1800--- purchase_requisition/test/purchase_requisition_users.yml 1970-01-01 00:00:00 +0000
1801+++ purchase_requisition/test/purchase_requisition_users.yml 2013-05-07 09:48:32 +0000
1802@@ -0,0 +1,30 @@
1803+-
1804+ Create a user as 'Purchase Requisition Manager'
1805+-
1806+ !record {model: res.users, id: res_users_purchase_requisition_manager}:
1807+ company_id: base.main_company
1808+ name: Purchase requisition Manager
1809+ login: prm
1810+ password: prm
1811+ email: requisition_manager@yourcompany.com
1812+-
1813+ I added groups for Purchase Requisition Manager.
1814+-
1815+ !record {model: res.users, id: res_users_purchase_requisition_manager}:
1816+ groups_id:
1817+ - purchase_requisition.group_purchase_requisition_manager
1818+-
1819+ Create a user as 'Purchase Requisition User'
1820+-
1821+ !record {model: res.users, id: res_users_purchase_requisition_user}:
1822+ company_id: base.main_company
1823+ name: Purchase requisition User
1824+ login: pru
1825+ password: pru
1826+ email: requisition_user@yourcompany.com
1827+-
1828+ I added groups for Purchase Requisition User.
1829+-
1830+ !record {model: res.users, id: res_users_purchase_requisition_user}:
1831+ groups_id:
1832+ - purchase_requisition.group_purchase_requisition_user
1833\ No newline at end of file
1834
1835=== modified file 'sale/__openerp__.py'
1836--- sale/__openerp__.py 2012-12-19 09:49:42 +0000
1837+++ sale/__openerp__.py 2013-05-07 09:48:32 +0000
1838@@ -80,6 +80,7 @@
1839 ],
1840 'demo': ['sale_demo.xml'],
1841 'test': [
1842+ 'test/create_sale_users.yml',
1843 'test/sale_order_demo.yml',
1844 'test/manual_order_policy.yml',
1845 'test/cancel_order.yml',
1846
1847=== modified file 'sale/test/cancel_order.yml'
1848--- sale/test/cancel_order.yml 2013-02-13 08:35:19 +0000
1849+++ sale/test/cancel_order.yml 2013-05-07 09:48:32 +0000
1850@@ -1,4 +1,9 @@
1851 -
1852+ Salesman can also cancel order therefore test with that user which have salesman rights,
1853+-
1854+ !context
1855+ uid: 'res_users_salesman'
1856+-
1857 In order to test the cancel sale order.
1858 I confirm order (with at least 2 lines)
1859 -
1860
1861=== added file 'sale/test/create_sale_users.yml'
1862--- sale/test/create_sale_users.yml 1970-01-01 00:00:00 +0000
1863+++ sale/test/create_sale_users.yml 2013-05-07 09:48:32 +0000
1864@@ -0,0 +1,30 @@
1865+-
1866+ Create a user as 'Salesmanager'
1867+-
1868+ !record {model: res.users, id: res_users_salesmanager}:
1869+ company_id: base.main_company
1870+ name: Sales manager
1871+ login: sm
1872+ password: sm
1873+ email: salesmanager@yourcompany.com
1874+-
1875+ I added groups for Salesmanager.
1876+-
1877+ !record {model: res.users, id: res_users_salesmanager}:
1878+ groups_id:
1879+ - base.group_sale_manager
1880+-
1881+ Create a user as 'Salesman'
1882+-
1883+ !record {model: res.users, id: res_users_salesman}:
1884+ company_id: base.main_company
1885+ name: Salesman
1886+ login: su
1887+ password: su
1888+ email: salesman@yourcompany.com
1889+-
1890+ I added groups for Salesman.
1891+-
1892+ !record {model: res.users, id: res_users_salesman}:
1893+ groups_id:
1894+ - base.group_sale_salesman_all_leads
1895
1896=== modified file 'sale/test/delete_order.yml'
1897--- sale/test/delete_order.yml 2012-11-29 22:26:45 +0000
1898+++ sale/test/delete_order.yml 2013-05-07 09:48:32 +0000
1899@@ -1,4 +1,9 @@
1900 -
1901+ Sales manager can only delete order therefore test with that user which have sales manager rights,
1902+-
1903+ !context
1904+ uid: 'res_users_salesmanager'
1905+-
1906 I try to delete In progress order and check Error Message.
1907 -
1908 !python {model: sale.order}: |
1909
1910=== added file 'sale/test/sale_order_demo.yml'
1911--- sale/test/sale_order_demo.yml 1970-01-01 00:00:00 +0000
1912+++ sale/test/sale_order_demo.yml 2013-05-07 09:48:32 +0000
1913@@ -0,0 +1,41 @@
1914+-
1915+ Test the data with salesman,
1916+-
1917+ !context
1918+ uid: 'res_users_salesman'
1919+-
1920+ In order to test process of the Sale Order, I create sale order
1921+-
1922+ !record {model: sale.order, id: sale_order_test1}:
1923+ partner_id: base.res_partner_2
1924+ note: Invoice after delivery
1925+ payment_term: account.account_payment_term
1926+ order_line:
1927+ - product_id: product.product_product_7
1928+ product_uom_qty: 8
1929+-
1930+ I verify that the onchange was correctly triggered
1931+-
1932+ !assert {model: sale.order, id: sale.sale_order_test1, string: The onchange function of product was not correctly triggered}:
1933+ - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor'
1934+ - order_line[0].price_unit == 1350.0
1935+ - order_line[0].product_uom_qty == 8
1936+ - order_line[0].product_uom.id == ref('product.product_uom_unit')
1937+
1938+-
1939+ I create another sale order
1940+-
1941+ !record {model: sale.order, id: sale_order_test2}:
1942+ partner_id: base.res_partner_2
1943+ order_line:
1944+ - product_id: product.product_product_7
1945+ product_uom_qty: 16
1946+ product_uom: product.product_uom_dozen
1947+-
1948+ I verify that the onchange was correctly triggered
1949+-
1950+ !assert {model: sale.order, id: sale.sale_order_test2, string: The onchange function of product was not correctly triggered}:
1951+ - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor'
1952+ - order_line[0].price_unit == 1350.0 * 12
1953+ - order_line[0].product_uom.id == ref('product.product_uom_dozen')
1954+ - order_line[0].product_uom_qty == 16
1955\ No newline at end of file
1956
1957=== removed file 'sale/test/sale_order_demo.yml'
1958--- sale/test/sale_order_demo.yml 2013-01-31 18:43:56 +0000
1959+++ sale/test/sale_order_demo.yml 1970-01-01 00:00:00 +0000
1960@@ -1,36 +0,0 @@
1961--
1962- In order to test process of the Sale Order, I create sale order
1963--
1964- !record {model: sale.order, id: sale_order_test1}:
1965- partner_id: base.res_partner_2
1966- note: Invoice after delivery
1967- payment_term: account.account_payment_term
1968- order_line:
1969- - product_id: product.product_product_7
1970- product_uom_qty: 8
1971--
1972- I verify that the onchange was correctly triggered
1973--
1974- !assert {model: sale.order, id: sale.sale_order_test1, string: The onchange function of product was not correctly triggered}:
1975- - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor'
1976- - order_line[0].price_unit == 1350.0
1977- - order_line[0].product_uom_qty == 8
1978- - order_line[0].product_uom.id == ref('product.product_uom_unit')
1979-
1980--
1981- I create another sale order
1982--
1983- !record {model: sale.order, id: sale_order_test2}:
1984- partner_id: base.res_partner_2
1985- order_line:
1986- - product_id: product.product_product_7
1987- product_uom_qty: 16
1988- product_uom: product.product_uom_dozen
1989--
1990- I verify that the onchange was correctly triggered
1991--
1992- !assert {model: sale.order, id: sale.sale_order_test2, string: The onchange function of product was not correctly triggered}:
1993- - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor'
1994- - order_line[0].price_unit == 1350.0 * 12
1995- - order_line[0].product_uom.id == ref('product.product_uom_dozen')
1996- - order_line[0].product_uom_qty == 16
1997\ No newline at end of file
1998
1999=== modified file 'sale_stock/__openerp__.py'
2000--- sale_stock/__openerp__.py 2012-11-22 09:22:14 +0000
2001+++ sale_stock/__openerp__.py 2013-05-07 09:48:32 +0000
2002@@ -59,7 +59,8 @@
2003 ],
2004 'data': ['sale_stock_data.xml'],
2005 'demo_xml': ['sale_stock_demo.xml'],
2006- 'test': ['test/cancel_order_sale_stock.yml',
2007+ 'test': ['test/sale_stock_users.yml',
2008+ 'test/cancel_order_sale_stock.yml',
2009 'test/picking_order_policy.yml',
2010 'test/prepaid_order_policy.yml',
2011 'test/sale_order_onchange.yml',
2012
2013=== modified file 'sale_stock/test/cancel_order_sale_stock.yml'
2014--- sale_stock/test/cancel_order_sale_stock.yml 2013-02-13 08:35:19 +0000
2015+++ sale_stock/test/cancel_order_sale_stock.yml 2013-05-07 09:48:32 +0000
2016@@ -1,14 +1,17 @@
2017 -
2018- In order to test the cancel sale order.
2019+ In order to test the cancel sale order with that user which have salesman rights.
2020 First I confirm order.
2021 -
2022+ !context
2023+ uid: 'res_sale_stock_salesman'
2024+-
2025 !workflow {model: sale.order, action: order_confirm, ref: sale.sale_order_8}
2026 -
2027 I send delivery in two shipments, so I am doing a partial delivery order.
2028 -
2029 !python {model: stock.picking}: |
2030 delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))])
2031- first_picking = self.browse(cr, uid, delivery_orders[0], context=context)
2032+ first_picking = self.browse(cr, uid, delivery_orders[0])
2033 if first_picking.force_assign(cr, uid, first_picking):
2034 first_move = first_picking.move_lines[0]
2035 values = {'move%s'%(first_move.id): {'product_qty': 2, 'product_uom':ref('product.product_uom_unit')}}
2036@@ -21,12 +24,22 @@
2037 last_delivery_order_id = delivery_orders[0]
2038 self.pool.get('stock.picking').signal_button_cancel(cr, uid, [last_delivery_order_id])
2039 -
2040+ Only Stock User can change data related warehouse therefore test with that user which have stcok user rights,
2041+-
2042+ !context
2043+ uid: 'res_stock_user'
2044+-
2045 I run the scheduler.
2046 -
2047 !python {model: procurement.order}: |
2048
2049 self.run_scheduler(cr, uid)
2050 -
2051+ Salesman can also check order therefore test with that user which have salesman rights,
2052+-
2053+ !context
2054+ uid: 'res_sale_stock_salesman'
2055+-
2056 I check order status in "Ship Exception".
2057 -
2058 !assert {model: sale.order, id: sale.sale_order_8, string: Sale order should be in shipping exception}:
2059
2060=== modified file 'sale_stock/test/picking_order_policy.yml'
2061--- sale_stock/test/picking_order_policy.yml 2013-04-22 15:34:49 +0000
2062+++ sale_stock/test/picking_order_policy.yml 2013-05-07 09:48:32 +0000
2063@@ -1,5 +1,8 @@
2064 -
2065- In order to test process of the Sale Order,
2066+ In order to test process of the Sale Order with access rights of saleman,
2067+-
2068+ !context
2069+ uid: 'res_sale_stock_salesman'
2070 -
2071 First I check the total amount of the Quotation before Approved.
2072 -
2073@@ -41,11 +44,21 @@
2074 assert procurement.product_uom.id == order_line.product_uom.id, "UOM is not correspond."
2075 assert procurement.procure_method == order_line.type, "Procurement method is not correspond."
2076 -
2077+ Only stock user can change data related warehouse therefore test with that user which have stock user rights,
2078+-
2079+ !context
2080+ uid: 'res_stock_user'
2081+-
2082 I run the scheduler.
2083 -
2084 !python {model: procurement.order}: |
2085 self.run_scheduler(cr, uid)
2086 -
2087+ Salesman can also check order therefore test with that user which have salesman rights,
2088+-
2089+ !context
2090+ uid: 'res_sale_stock_salesman'
2091+-
2092 I check the details of delivery order after confirmed quotation.
2093 -
2094 !python {model: sale.order}: |
2095@@ -137,6 +150,11 @@
2096 assert inv_line.quantity == (so_line.product_uos and so_line.product_uos_qty) or so_line.product_uom_qty , "Product qty is not correspond."
2097 assert inv_line.price_subtotal == so_line.price_subtotal, "Price sub total is not correspond."
2098 -
2099+ Only Stock manager can open the Invoice therefore test with that user which have stock manager rights,
2100+-
2101+ !context
2102+ uid: 'res_stock_manager'
2103+-
2104 I open the Invoice.
2105 -
2106 !python {model: sale.order}: |
2107@@ -158,6 +176,11 @@
2108 ref('account.period_8'), journal_ids[0],
2109 name='test')
2110 -
2111+ To test process of the Sale Order with access rights of saleman,
2112+-
2113+ !context
2114+ uid: 'res_sale_stock_salesman'
2115+-
2116 I check the order after paid invoice.
2117 -
2118 !python {model: sale.order}: |
2119
2120=== modified file 'sale_stock/test/prepaid_order_policy.yml'
2121--- sale_stock/test/prepaid_order_policy.yml 2012-11-29 22:26:45 +0000
2122+++ sale_stock/test/prepaid_order_policy.yml 2013-05-07 09:48:32 +0000
2123@@ -1,5 +1,8 @@
2124 -
2125- Now I confirm the Quotation with "Pay before delivery" policy.
2126+ Now I confirm the Quotation with "Pay before delivery" policy with access rights of salesman.
2127+-
2128+ !context
2129+ uid: 'res_sale_stock_salesman'
2130 -
2131 !workflow {model: sale.order, action: order_confirm, ref: sale.sale_order_4}
2132 -
2133
2134=== modified file 'sale_stock/test/sale_order_onchange.yml'
2135--- sale_stock/test/sale_order_onchange.yml 2012-10-01 16:19:54 +0000
2136+++ sale_stock/test/sale_order_onchange.yml 2013-05-07 09:48:32 +0000
2137@@ -1,4 +1,9 @@
2138 -
2139+ Only sales manager Creates product so let's check with access rights of salemanager.
2140+-
2141+ !context
2142+ uid: 'res_sale_stock_salesmanager'
2143+-
2144 In order to test the onchange of the Sale Order, I create a product
2145 -
2146 !record {model: product.product, id: product_onchange1}:
2147@@ -6,6 +11,11 @@
2148 list_price: 66.6
2149 procure_method: 'make_to_order'
2150 -
2151+ In sale order to test process of onchange of Sale Order with access rights of saleman.
2152+-
2153+ !context
2154+ uid: 'res_sale_stock_salesman'
2155+-
2156 Now i create a sale order that uses my new product
2157 -
2158 !record {model: sale.order, id: sale_order_onchange1}:
2159
2160=== added file 'sale_stock/test/sale_stock_users.yml'
2161--- sale_stock/test/sale_stock_users.yml 1970-01-01 00:00:00 +0000
2162+++ sale_stock/test/sale_stock_users.yml 2013-05-07 09:48:32 +0000
2163@@ -0,0 +1,61 @@
2164+-
2165+ Create a user as 'Stock Salesmanager'
2166+-
2167+ !record {model: res.users, id: res_sale_stock_salesmanager}:
2168+ company_id: base.main_company
2169+ name: Stock Sales manager
2170+ login: ssm
2171+ password: ssm
2172+ email: ss_salesmanager@yourcompany.com
2173+-
2174+ I added groups for Salesmanager.
2175+-
2176+ !record {model: res.users, id: res_sale_stock_salesmanager}:
2177+ groups_id:
2178+ - base.group_sale_manager
2179+-
2180+ Create a user as 'Stock Salesman'
2181+-
2182+ !record {model: res.users, id: res_sale_stock_salesman}:
2183+ company_id: base.main_company
2184+ name: Stock Salesman
2185+ login: ssu
2186+ password: ssu
2187+ email: ss_salesman@yourcompany.com
2188+-
2189+ I added groups for Stock Salesman.
2190+-
2191+ !record {model: res.users, id: res_sale_stock_salesman}:
2192+ groups_id:
2193+ - base.group_sale_salesman_all_leads
2194+-
2195+ Create a user as 'Stock User'
2196+-
2197+ !record {model: res.users, id: res_stock_user}:
2198+ company_id: base.main_company
2199+ name: Stock User
2200+ login: sau
2201+ password: sau
2202+ email: stock_user@yourcompany.com
2203+-
2204+ I added groups for Stock User.
2205+-
2206+ !record {model: res.users, id: res_stock_user}:
2207+ groups_id:
2208+ - stock.group_stock_user
2209+-
2210+ Create a user as 'Stock Manager'
2211+-
2212+ !record {model: res.users, id: res_stock_manager}:
2213+ company_id: base.main_company
2214+ name: Stock Manager
2215+ login: sam
2216+ password: sam
2217+ email: admin@portal.example.com
2218+ email: stock_manager@yourcompany.com
2219+-
2220+ I added groups for Stock Manager.
2221+-
2222+ !record {model: res.users, id: res_stock_manager}:
2223+ groups_id:
2224+ - stock.group_stock_manager
2225
2226=== modified file 'stock/__openerp__.py'
2227--- stock/__openerp__.py 2012-12-09 10:55:27 +0000
2228+++ stock/__openerp__.py 2013-05-07 09:48:32 +0000
2229@@ -59,7 +59,6 @@
2230 'sequence': 16,
2231 'demo': [
2232 'stock_demo.xml',
2233-# 'stock_demo.yml',
2234 ],
2235 'data': [
2236 'security/stock_security.xml',
2237@@ -91,9 +90,11 @@
2238 'res_config_view.xml',
2239 ],
2240 'test': [
2241-# 'test/opening_stock.yml',
2242-# 'test/shipment.yml',
2243-# 'test/stock_report.yml',
2244+ 'test/stock_users.yml',
2245+ 'stock_demo.yml',
2246+ 'test/opening_stock.yml',
2247+ 'test/shipment.yml',
2248+ 'test/stock_report.yml',
2249 ],
2250 'installable': True,
2251 'application': True,
2252
2253=== modified file 'stock/security/stock_security.xml'
2254--- stock/security/stock_security.xml 2013-04-05 11:16:49 +0000
2255+++ stock/security/stock_security.xml 2013-05-07 09:48:32 +0000
2256@@ -10,7 +10,7 @@
2257 <record id="group_stock_manager" model="res.groups">
2258 <field name="name">Manager</field>
2259 <field name="category_id" ref="base.module_category_warehouse_management"/>
2260- <field name="implied_ids" eval="[(4, ref('group_stock_user'))]"/>
2261+ <field name="implied_ids" eval="[(4, ref('group_stock_user')), (4, ref('account.group_account_user'))]"/>
2262 <field name="users" eval="[(4, ref('base.user_root'))]"/>
2263 </record>
2264
2265
2266=== modified file 'stock/stock_demo.yml'
2267--- stock/stock_demo.yml 2012-11-29 22:26:45 +0000
2268+++ stock/stock_demo.yml 2013-05-07 09:48:32 +0000
2269@@ -1,99 +1,107 @@
2270 -
2271- !record {model: stock.location, id: location_refrigerator}:
2272- name: Refrigerator
2273- usage: internal
2274--
2275- !record {model: stock.location, id: location_delivery_counter}:
2276- name: Delivery Counter
2277- usage: internal
2278--
2279- !record {model: stock.location, id: location_refrigerator_small}:
2280- name: Small Refrigerator
2281- usage: internal
2282- location_id: location_refrigerator
2283+ Only stock manager can create location,warehouse and product, so let's check data with giving the access rights of manager
2284+-
2285+ !context
2286+ uid: 'res_users_stock_manager'
2287+-
2288+ !record {model: stock.location, id: location_monitor}:
2289+ name: chicago shop
2290+ usage: internal
2291+-
2292+ !record {model: stock.location, id: stock_location_output}:
2293+ name: Output
2294+ usage: internal
2295+-
2296+ !record {model: stock.location, id: location_monitor_small}:
2297+ name: Small chicago shop
2298+ usage: internal
2299+ location_id: location_monitor
2300 -
2301 !record {model: stock.location, id: location_opening}:
2302 name: opening
2303 usage: inventory
2304 -
2305- !record {model: stock.location, id: location_convenience_shop}:
2306- name: Convenient Store
2307+ !record {model: stock.location, id: stock_location_3}:
2308+ name: IT Suppliers
2309 usage: supplier
2310 -
2311- !record {model: stock.warehouse, id: warehouse_icecream}:
2312- name: Ice Cream Shop
2313- lot_input_id: location_refrigerator
2314- lot_stock_id: location_refrigerator
2315- lot_output_id: location_delivery_counter
2316+ !record {model: stock.warehouse, id: stock_warehouse_shop0}:
2317+ name: Chicago Warehouse
2318+ lot_input_id: location_monitor
2319+ lot_stock_id: location_monitor
2320+ lot_output_id: stock_location_output
2321 -
2322- !record {model: product.product, id: product_icecream}:
2323- default_code: 001
2324- name: Ice Cream
2325- type: product
2326- categ_id: product.product_category_1
2327- list_price: 100.0
2328- standard_price: 70.0
2329- uom_id: product.product_uom_kgm
2330- uom_po_id: product.product_uom_kgm
2331- procure_method: make_to_stock
2332+ !record {model: product.product, id: product_product_6}:
2333+ default_code: LCD15
2334+ name: 15” LCD Monitor
2335+ type: consu
2336+ categ_id: product.product_category_8
2337+ list_price: 1200.0
2338+ standard_price: 800.0
2339+ uom_id: product.product_uom_unit
2340+ uom_po_id: product.product_uom_unit
2341 property_stock_inventory: location_opening
2342 valuation: real_time
2343 cost_method: average
2344- property_stock_account_input: account.o_expense
2345- property_stock_account_output: account.o_income
2346- description: Ice cream can be mass-produced and thus is widely available in developed parts of the world. Ice cream can be purchased in large cartons (vats and squrounds) from supermarkets and grocery stores, in smaller quantities from ice cream shops, convenience stores, and milk bars, and in individual servings from small carts or vans at public events.
2347-
2348--
2349- !record {model: stock.production.lot, id: lot_icecream_0}:
2350- name: Lot0 for Ice cream
2351- product_id: product_icecream
2352--
2353- !record {model: stock.production.lot, id: lot_icecream_1}:
2354- name: Lot1 for Ice cream
2355- product_id: product_icecream
2356--
2357- !record {model: stock.inventory, id: stock_inventory_icecream}:
2358- name: Inventory for icecream
2359--
2360- !record {model: stock.inventory.line, id: stock_inventory_line_icecream_lot0}:
2361- product_id: product_icecream
2362- product_uom: product.product_uom_kgm
2363- inventory_id: stock_inventory_icecream
2364+ property_stock_account_input: account.conf_o_income
2365+ property_stock_account_output: account.a_expense
2366+-
2367+ Stock user can handled production lot,inventory and picking, so let's check data with giving the access rights of user
2368+-
2369+ !context
2370+ uid: 'res_users_stock_user'
2371+-
2372+ !record {model: stock.production.lot, id: lot_monitor_0}:
2373+ name: Lot0 for LCD Monitor
2374+ product_id: product_product_6
2375+-
2376+ !record {model: stock.production.lot, id: lot_monitor_1}:
2377+ name: Lot1 for LCD Monitor
2378+ product_id: product_product_6
2379+-
2380+ !record {model: stock.inventory, id: stock_inventory_0}:
2381+ name: Starting Inventory
2382+ state: draft
2383+-
2384+ !record {model: stock.inventory.line, id: stock_inventory_line_3}:
2385+ product_id: product_product_6
2386+ product_uom: product.product_uom_unit
2387+ inventory_id: stock_inventory_0
2388 product_qty: 50.0
2389- prod_lot_id: lot_icecream_0
2390- location_id: location_refrigerator
2391+ prod_lot_id: lot_monitor_0
2392+ location_id: location_monitor
2393 -
2394- !record {model: stock.inventory.line, id: stock_inventory_line_icecream_lot1}:
2395- product_id: product_icecream
2396- product_uom: product.product_uom_kgm
2397- inventory_id: stock_inventory_icecream
2398+ !record {model: stock.inventory.line, id: stock_inventory_line_monitor}:
2399+ product_id: product_product_6
2400+ product_uom: product.product_uom_unit
2401+ inventory_id: stock_inventory_0
2402 product_qty: 40.0
2403- prod_lot_id: lot_icecream_1
2404- location_id: location_refrigerator
2405+ prod_lot_id: lot_monitor_1
2406+ location_id: location_monitor
2407
2408 -
2409 !record {model: stock.picking, id: outgoing_shipment}:
2410 type: out
2411- location_dest_id: location_delivery_counter
2412+ location_dest_id: stock_location_output
2413 -
2414- !record {model: stock.move, id: outgoing_shipment_icecream}:
2415+ !record {model: stock.move, id: outgoing_shipment_monitor}:
2416 picking_id: outgoing_shipment
2417- product_id: product_icecream
2418- product_uom: product.product_uom_kgm
2419+ product_id: product_product_6
2420+ product_uom: product.product_uom_unit
2421 product_qty: 130.0
2422- location_id: location_refrigerator
2423- location_dest_id: location_delivery_counter
2424+ location_id: location_monitor
2425+ location_dest_id: stock_location_output
2426 -
2427 !record {model: stock.picking, id: incomming_shipment}:
2428 type: in
2429 invoice_state: 2binvoiced
2430 partner_id: base.res_partner_address_9
2431- location_dest_id: location_refrigerator
2432+ location_dest_id: location_monitor
2433 -
2434- !record {model: stock.move, id: incomming_shipment_icecream}:
2435+ !record {model: stock.move, id: incomming_shipment_monitor}:
2436 picking_id: incomming_shipment
2437- product_id: product_icecream
2438- product_uom: product.product_uom_kgm
2439+ product_id: product_product_6
2440+ product_uom: product.product_uom_unit
2441 product_qty: 50.0
2442- location_id: location_convenience_shop
2443- location_dest_id: location_refrigerator
2444+ location_id: stock_location_3
2445+ location_dest_id: location_monitor
2446
2447=== modified file 'stock/test/opening_stock.yml'
2448--- stock/test/opening_stock.yml 2012-07-27 01:52:02 +0000
2449+++ stock/test/opening_stock.yml 2013-05-07 09:48:32 +0000
2450@@ -1,67 +1,87 @@
2451 -
2452- I update the price of the Ice-cream.
2453+ Only stock manager can change the price and update stock of products, so let's check data with giving the access rights of manager
2454+-
2455+ !context
2456+ uid: 'res_users_stock_manager'
2457+-
2458+ I update the price of the 15” LCD Monitor.
2459 -
2460 !python {model: stock.change.standard.price}: |
2461- context.update({'active_model':'product.product', 'active_id': ref('product_icecream'), 'active_ids':[ref('product_icecream')]})
2462+ context.update({'active_model':'product.product', 'active_id': ref('product_product_6'), 'active_ids':[ref('product_product_6')]})
2463 -
2464 !record {model: stock.change.standard.price, id: change_price}:
2465- new_price: 120
2466+ new_price: 1500
2467 -
2468 !python {model: stock.change.standard.price}: |
2469 self.change_price(cr, uid, [ref('change_price')], context=context)
2470 -
2471- I check price of Ice-cream after update price.
2472+ I check price of 15” LCD Monitor after update price.
2473 -
2474 !python {model: product.product}: |
2475- product = self.browse(cr, uid, ref('product_icecream'), context=context)
2476- assert product.standard_price == 120, "Price is not updated."
2477+ product = self.browse(cr, uid, ref('product_product_6'), context=context)
2478+ assert product.standard_price == 1500, "Price is not updated."
2479 -
2480- I update the current stock of the Ice-cream with 10 kgm in Small Refrigerator in lot0.
2481+ I update the current stock of the 15” LCD Monitor with 10 unit in stock location shop1 in lot0.
2482 -
2483 !record {model: stock.change.product.qty, id: change_qty}:
2484- location_id: location_refrigerator_small
2485+ location_id: location_monitor_small
2486 new_quantity: 10
2487- product_id: product_icecream
2488- prodlot_id: lot_icecream_1
2489+ product_id: product_product_6
2490+ prodlot_id: lot_monitor_1
2491 -
2492 !python {model: stock.change.product.qty}: |
2493 self.change_product_qty(cr, uid, [ref('change_qty')], context=context)
2494 -
2495- I check available stock of Ice-cream after update stock.
2496+ I check available stock of 15” LCD Monitor after update stock.
2497 -
2498 !python {model: product.product}: |
2499- product = self.browse(cr, uid, ref('product_icecream'), context=context)
2500+ product = self.browse(cr, uid, ref('product_product_6'), context=context)
2501 assert product.qty_available == 10, "Stock is not updated."
2502 -
2503+ Stock user can merge inventory, so let's check data with giving the access rights of user.
2504+-
2505+ !context
2506+ uid: 'res_users_stock_user'
2507+-
2508 I merge inventory.
2509 -
2510 !python {model: stock.inventory.merge }: |
2511- context.update({'active_model': 'stock.inventory', 'active_id': ref('stock_inventory_icecream'), 'active_ids': [ref('stock_inventory_icecream')]})
2512+ context.update({'active_model': 'stock.inventory', 'active_id': ref('stock_inventory_0'), 'active_ids': [ref('stock_inventory_0')]})
2513 -
2514 !record {model: stock.inventory.merge, id: merge_inventory}:
2515 -
2516 !python {model: stock.inventory.merge }: |
2517 self.do_merge(cr, uid, [ref('merge_inventory')], context=context)
2518 -
2519+ Only stock manager cancelled inventory, so let's check data with giving the access rights of manager
2520+-
2521+ !context
2522+ uid: 'res_users_stock_manager'
2523+-
2524 I cancel inventory.
2525 -
2526 !python {model: stock.inventory}: |
2527- self.action_cancel_inventory(cr, uid, [ref('stock_inventory_icecream')])
2528+ self.action_cancel_inventory(cr, uid, [ref('stock_inventory_0')])
2529+-
2530+ stock user can reset inventory, so let's check data with giving the access rights of user
2531+-
2532+ !context
2533+ uid: 'res_users_stock_user'
2534 -
2535 I reset to draft inventory.
2536 -
2537 !python {model: stock.inventory}: |
2538- self.action_cancel_draft(cr, uid, [ref('stock_inventory_icecream')])
2539+ self.action_cancel_draft(cr, uid, [ref('stock_inventory_0')])
2540 -
2541- I confirm physical inventory of Ice-cream which are came in different lots.
2542+ I confirm physical inventory of 15” LCD Monitor which are came in different lots.
2543 -
2544 !python {model: stock.inventory}: |
2545- self.action_confirm(cr, uid, [ref('stock_inventory_icecream')], context=context)
2546+ self.action_confirm(cr, uid, [ref('stock_inventory_0')], context=context)
2547 -
2548 I check move details after confirmed physical inventory.
2549 -
2550 !python {model: stock.inventory}: |
2551- inventory = self.browse(cr, uid, ref('stock_inventory_icecream'), context=context)
2552+ inventory = self.browse(cr, uid, ref('stock_inventory_0'), context=context)
2553 assert len(inventory.move_ids) == len(inventory.inventory_line_id), "moves are not correspond."
2554 for move_line in inventory.move_ids:
2555 for line in inventory.inventory_line_id:
2556@@ -77,15 +97,15 @@
2557 I split inventory line.
2558 -
2559 !python {model: stock.inventory.line.split}: |
2560- context.update({'active_model': 'stock.inventory.line', 'active_id': ref('stock_inventory_line_icecream_lot0'), 'active_ids': [ref('stock_inventory_line_icecream_lot0')]})
2561+ context.update({'active_model': 'stock.inventory.line', 'active_id': ref('stock_inventory_line_3'), 'active_ids': [ref('stock_inventory_line_3')]})
2562 -
2563 !record {model: stock.inventory.line.split, id: split_inventory_lot0}:
2564 use_exist: True
2565 line_exist_ids:
2566 - quantity: 6
2567- prodlot_id: lot_icecream_0
2568+ prodlot_id: lot_monitor_0
2569 - quantity: 4
2570- prodlot_id: lot_icecream_0
2571+ prodlot_id: lot_monitor_0
2572 -
2573 !python {model: stock.inventory.line.split }: |
2574 self.split_lot(cr, uid, [ref('split_inventory_lot0')], context=context)
2575@@ -93,39 +113,49 @@
2576 I fill inventory line.
2577 -
2578 !python {model: stock.fill.inventory}: |
2579- context.update({'active_model': 'stock.inventory', 'active_id': ref('stock_inventory_icecream'), 'active_ids': [ref('stock_inventory_icecream')]})
2580+ context.update({'active_model': 'stock.inventory', 'active_id': ref('stock_inventory_0'), 'active_ids': [ref('stock_inventory_0')]})
2581 -
2582 !record {model: stock.fill.inventory, id: fill_inventory}:
2583- location_id: location_refrigerator
2584+ location_id: location_monitor
2585 recursive: True
2586 -
2587 !python {model: stock.fill.inventory }: |
2588 self.fill_inventory(cr, uid, [ref('fill_inventory')], context=context)
2589
2590 -
2591- Now I check vitual stock of Ice-cream after confirmed physical inventory.
2592+ Now I check vitual stock of 15” LCD Monitor after confirmed physical inventory.
2593 -
2594 !python {model: product.product}: |
2595- product = self.browse(cr, uid, ref('product_icecream'), context=context)
2596+ product = self.browse(cr, uid, ref('product_product_6'), context=context)
2597 assert product.virtual_available == 100, "Vitual stock is not updated."
2598 -
2599- I close physical inventory of Ice-cream.
2600--
2601- !python {model: stock.inventory}: |
2602- self.action_done(cr, uid, [ref('stock_inventory_icecream')], context=context)
2603--
2604- I check closed move and real stock of Ice-cream after closed physical inventory.
2605--
2606- !python {model: stock.inventory}: |
2607- inventory = self.browse(cr, uid, ref('stock_inventory_icecream'), context=context)
2608+ Only stock manager can close physical inventory, so let's check data with giving the access rights of manager
2609+-
2610+ !context
2611+ uid: 'res_users_stock_manager'
2612+-
2613+ I close physical inventory of 15” LCD Monitor.
2614+-
2615+ !python {model: stock.inventory}: |
2616+ self.action_done(cr, uid, [ref('stock_inventory_0')], context=context)
2617+-
2618+ Stock user can check closed move and real stock, so let's check data with giving the access rights of user
2619+-
2620+ !context
2621+ uid: 'res_users_stock_user'
2622+-
2623+ I check closed move and real stock of 15” LCD Monitor after closed physical inventory.
2624+-
2625+ !python {model: stock.inventory}: |
2626+ inventory = self.browse(cr, uid, ref('stock_inventory_0'), context=context)
2627 assert inventory.state == 'done', "inventory is not closed."
2628 for move_line in inventory.move_ids:
2629 assert move_line.state == 'done', "Move is not closed."
2630- product = self.pool.get('product.product').browse(cr, uid, ref('product_icecream'), context=context)
2631+ product = self.pool.get('product.product').browse(cr, uid, ref('product_product_6'), context=context)
2632 product.qty_available == 100, "Real stock is not updated."
2633 -
2634 I check stock in lot.
2635 -
2636 !python {model: stock.production.lot}: |
2637- lot = self.browse(cr, uid, ref('lot_icecream_0'), context=context)
2638+ lot = self.browse(cr, uid, ref('lot_monitor_0'), context=context)
2639 assert lot.stock_available == 50, "Stock in lot is not correspond."
2640
2641=== modified file 'stock/test/shipment.yml'
2642--- stock/test/shipment.yml 2012-05-08 21:22:45 +0000
2643+++ stock/test/shipment.yml 2013-05-07 09:48:32 +0000
2644@@ -1,9 +1,14 @@
2645 -
2646- I confirm outgoing shipment of 130 kgm Ice-cream.
2647+ Stock manager can only test whole process related to Shipment, so let's check data with stock manager.
2648+-
2649+ !context
2650+ uid: 'res_users_stock_manager'
2651+-
2652+ I confirm outgoing shipment of 130 Unit 15” LCD Monitor.
2653 -
2654 !workflow {model: stock.picking, action: button_confirm, ref: outgoing_shipment}
2655 -
2656- I check shipment details after confirmed.
2657+ I check shipment details after confirmation.
2658 -
2659 !python {model: stock.picking}: |
2660 shipment = self.browse(cr, uid, ref("outgoing_shipment"))
2661@@ -12,147 +17,151 @@
2662 assert move_line.state == "confirmed", "Move should be confirmed."
2663
2664 -
2665- Now I check vitual stock of Ice-cream after confirmed outgoing shipment.
2666+ Now, I check virtual stock of 15” LCD Monitor after confirming outgoing shipment.
2667 -
2668 !python {model: product.product}: |
2669- product = self.browse(cr, uid, ref('product_icecream'), context=context)
2670- product.virtual_available == -30, "Vitual stock is not updated."
2671+ product = self.browse(cr, uid, ref('product_product_6'), context=context)
2672+ assert product.virtual_available == -30, "Virtual stock is not updated."
2673
2674 -
2675- I confirm incomming shipment of 50 kgm Ice-cream.
2676+ I confirm incoming shipment of 50 Unit 15” LCD Monitor.
2677 -
2678 !workflow {model: stock.picking, action: button_confirm, ref: incomming_shipment}
2679 -
2680- I receive 40kgm Ice-cream so I make backorder of incomming shipment for 40 kgm.
2681+ I split incoming shipment into lots. each lot contain 10 Unit 15” LCD Monitor.
2682+-
2683+ !python {model: stock.picking}: |
2684+ shipment = self.browse(cr, uid, ref("incomming_shipment"))
2685+ move_ids = [x.id for x in shipment.move_lines]
2686+ context.update({'active_model': 'stock.move', 'active_id': move_ids[0], 'active_ids': move_ids})
2687+-
2688+ !record {model: stock.move.split, id: split_lot_incoming}:
2689+ line_ids:
2690+ - name: incoming_lot0
2691+ quantity: 10
2692+ - name: incoming_lot1
2693+ quantity: 10
2694+ - name: incoming_lot2
2695+ quantity: 10
2696+ - name: incoming_lot3
2697+ quantity: 10
2698+-
2699+ !python {model: stock.move.split }: |
2700+ self.split_lot(cr, uid, [ref('split_lot_incoming')], context=context)
2701+-
2702+ I check move lines after splitting.
2703+-
2704+ !python {model: stock.move}: |
2705+ mm = self.browse(cr, uid, ref("incomming_shipment_monitor"))
2706+ lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incoming'), context=context)
2707+ lot_ids = self.pool.get('stock.production.lot').search(cr, uid, [('name','in',[x.name for x in lot.line_ids])])
2708+ assert len(lot_ids) == 4, 'lots of incoming shipment are not correspond.'
2709+ move_ids = self.search(cr, uid, [('location_dest_id','=',ref('location_monitor')),('prodlot_id','in',lot_ids)])
2710+ assert len(move_ids) == 4, 'move lines are not correspond per production lot after splitting.'
2711+ for move in self.browse(cr, uid, move_ids, context=context):
2712+ assert move.prodlot_id.name in ['incoming_lot0', 'incoming_lot1', 'incoming_lot2', 'incoming_lot3'], "lot does not correspond."
2713+ assert move.product_qty == 10, "qty does not correspond per production lot."
2714+-
2715+ I receive 40 units of 15” LCD Monitor.
2716 -
2717 !python {model: stock.partial.picking}: |
2718 context.update({'active_model': 'stock.picking', 'active_id': ref('incomming_shipment'), 'active_ids': [ref('incomming_shipment')]})
2719 -
2720- !record {model: stock.partial.picking, id: partial_incomming}:
2721- move_ids:
2722- - quantity: 40
2723- product_id: product_icecream
2724- product_uom: product.product_uom_kgm
2725- move_id: incomming_shipment_icecream
2726- location_id: location_convenience_shop
2727- location_dest_id: location_refrigerator
2728--
2729- !python {model: stock.partial.picking }: |
2730- self.do_partial(cr, uid, [ref('partial_incomming')], context=context)
2731--
2732- I check backorder shipment after received partial shipment.
2733+ !python {model: stock.partial.picking}: |
2734+ partial = []
2735+ for move in self.pool.get('stock.picking').browse(cr, uid, ref("incomming_shipment")).move_lines:
2736+ if move.prodlot_id:
2737+ partial.append((0, 0, {
2738+ 'quantity': move.product_qty,
2739+ 'product_id': move.product_id.id,
2740+ 'product_uom': move.product_uom.id,
2741+ 'move_id': move.id,
2742+ 'location_id': move.location_id.id,
2743+ 'location_dest_id': move.location_dest_id.id,
2744+ 'prodlot_id': move.prodlot_id.id,
2745+ 'cost': move.product_id.standard_price
2746+ }))
2747+ partial_id = self.create(cr, uid, {'move_ids': partial}, context=context)
2748+ self.do_partial(cr, uid, [partial_id], context=context)
2749+-
2750+ I check backorder shipment after receiving partial shipment.
2751 -
2752 !python {model: stock.picking}: |
2753 shipment = self.browse(cr, uid, ref("incomming_shipment"))
2754 backorder = shipment.backorder_id
2755 assert backorder, "Backorder should be created after partial shipment."
2756- assert backorder.state == 'done', "Backorder should be close after received."
2757+ assert backorder.state == 'done', "Backorder should be closed after received."
2758+ qty = 0
2759 for move_line in backorder.move_lines:
2760- assert move_line.product_qty == 40, "Qty in backorder does not correspond."
2761 assert move_line.state == 'done', "Move line of backorder should be closed."
2762--
2763- I receive another 10kgm Ice-cream.
2764--
2765- !record {model: stock.partial.picking, id: partial_incomming}:
2766+ qty += move_line.product_qty
2767+ assert qty == 40, "Qty in backorder does not correspond."
2768+-
2769+ I receive another 10 units of 15” LCD Monitor.
2770+-
2771+ !record {model: stock.partial.picking, id: partial_incoming}:
2772 move_ids:
2773 - quantity: 10
2774- product_id: product_icecream
2775- product_uom: product.product_uom_kgm
2776- move_id: incomming_shipment_icecream
2777- location_id: location_convenience_shop
2778- location_dest_id: location_refrigerator
2779+ product_id: product_product_6
2780+ product_uom: product.product_uom_unit
2781+ move_id: incomming_shipment_monitor
2782+ location_id: stock_location_3
2783+ location_dest_id: location_monitor
2784 -
2785 !python {model: stock.partial.picking }: |
2786- self.do_partial(cr, uid, [ref('partial_incomming')], context=context)
2787-
2788+ self.do_partial(cr, uid, [ref('partial_incoming')], context=context)
2789 -
2790- I check incomming shipment after received.
2791+ I check incoming shipment after receiving it.
2792 -
2793 !python {model: stock.picking}: |
2794 shipment = self.browse(cr, uid, ref("incomming_shipment"))
2795- assert shipment.state == 'done', "shipment should be close after received."
2796+ assert shipment.state == 'done', "shipment should be closed after receiving."
2797 for move_line in shipment.move_lines:
2798 assert move_line.product_qty == 10, "Qty does not correspond."
2799 assert move_line.product_id.virtual_available == 20, "Virtual stock does not correspond."
2800 assert move_line.state == 'done', "Move line should be closed."
2801-
2802--
2803- I return last incomming shipment for 10 kgm Ice-cream.
2804--
2805- !record {model: stock.return.picking, id: return_incomming}:
2806+-
2807+ I return last incoming shipment for 10 Unit 15” LCD Monitor.
2808+-
2809+ !record {model: stock.return.picking, id: return_incoming}:
2810 invoice_state: none
2811 -
2812 !python {model: stock.return.picking }: |
2813 # this work without giving the id of the picking to return, magically, thanks to the context
2814- self.create_returns(cr, uid, [ref('return_incomming')], context=context)
2815+ self.create_returns(cr, uid, [ref('return_incoming')], context=context)
2816 -
2817- I cancel incomming shipment after return it.
2818+ I cancel incoming shipment after returning it.
2819 -
2820 !python {model: stock.picking}: |
2821- # the cancel is not on the return, but on the incomming shipment (which now has a quantity of 10, thanks to the
2822+ # the cancel is not on the return, but on the incoming shipment (which now has a quantity of 10, thanks to the
2823 # backorder). This situation is a little weird as we returned a move that we finally cancelled... As result, only
2824- # 30Kg from the original 50Kg will be counted in the stock (50 - 10 (cancelled quantity) - 10 (returned quantity))
2825+ # 30Unit from the original 50Unit will be counted in the stock (50 - 10 (cancelled quantity) - 10 (returned quantity))
2826 self.action_cancel(cr, uid, [ref("incomming_shipment")], context=context)
2827 -
2828- I make invoice of backorder of incomming shipment.
2829+ I make invoice of backorder of incoming shipment.
2830 -
2831 !python {model: stock.invoice.onshipping}: |
2832 shipment = self.pool.get('stock.picking').browse(cr, uid, ref("incomming_shipment"))
2833 context.update({'active_model': 'stock.picking', 'active_id': shipment.backorder_id.id, 'active_ids': [shipment.backorder_id.id]})
2834 -
2835- !record {model: stock.invoice.onshipping, id: invoice_incomming}:
2836+ !record {model: stock.invoice.onshipping, id: invoice_incoming}:
2837 group: False
2838 -
2839 !python {model: stock.invoice.onshipping }: |
2840- self.create_invoice(cr, uid, [ref('invoice_incomming')], context=context)
2841+ self.create_invoice(cr, uid, [ref('invoice_incoming')], context=context)
2842 -
2843- I check invoice state of backorder of incomming shipment.
2844+ I check invoice status of backorder of incoming shipment.
2845 -
2846 !python {model: stock.picking}: |
2847 shipment = self.browse(cr, uid, ref("incomming_shipment"))
2848- assert shipment.backorder_id.invoice_state == 'invoiced', 'Invoice state is not upadted.'
2849+ assert shipment.backorder_id.invoice_state == 'invoiced', 'Invoice state is not updated.'
2850 -
2851- I check available stock after received incomming shipping.
2852+ I check available stock after receiving incoming shipping.
2853 -
2854 !python {model: product.product}: |
2855- product = self.browse(cr, uid, ref('product_icecream'), context=context)
2856+ product = self.browse(cr, uid, ref('product_product_6'), context=context)
2857 assert product.qty_available == 140, "Stock does not correspond."
2858- assert product.virtual_available == 0, "Vitual stock does not correspond."
2859--
2860- I split incomming shipment into lots. each lot contain 10 kgm Ice-cream.
2861--
2862- !python {model: stock.picking}: |
2863- shipment = self.browse(cr, uid, ref("incomming_shipment"))
2864- move_ids = [x.id for x in shipment.backorder_id.move_lines]
2865- context.update({'active_model': 'stock.move', 'active_id': move_ids[0], 'active_ids': move_ids})
2866--
2867- !record {model: stock.move.split, id: split_lot_incomming}:
2868- line_ids:
2869- - name: incoming_lot0
2870- quantity: 10
2871- - name: incoming_lot1
2872- quantity: 10
2873- - name: incoming_lot2
2874- quantity: 10
2875- - name: incoming_lot3
2876- quantity: 10
2877-
2878--
2879- !python {model: stock.move.split }: |
2880- self.split_lot(cr, uid, [ref('split_lot_incomming')], context=context)
2881--
2882- I check move lines after spliting
2883--
2884- !python {model: stock.move}: |
2885- lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incomming'), context=context)
2886- lot_ids = self.pool.get('stock.production.lot').search(cr, uid, [('name','in',[x.name for x in lot.line_ids])])
2887- assert len(lot_ids) == 4, 'lots of incomming shipment are not correspond.'
2888- move_ids = self.search(cr, uid, [('location_dest_id','=',ref('location_refrigerator')),('prodlot_id','in',lot_ids)])
2889- assert len(move_ids) == 4, 'move lines are not correspond per prodcution lot after splited.'
2890- for move in self.browse(cr, uid, move_ids, context=context):
2891- assert move.prodlot_id.name in ['incoming_lot0', 'incoming_lot1', 'incoming_lot2', 'incoming_lot3'], "lot does not correspond."
2892- assert move.product_qty == 10, "qty does not correspond per production lot."
2893- context.update({'active_model':'stock.move', 'active_id':move_ids[0],'active_ids': move_ids})
2894+ assert product.virtual_available == 0, "Virtual stock does not correspond."
2895 -
2896 I check the stock valuation account entries.
2897 -
2898@@ -161,91 +170,90 @@
2899 account_move_ids = self.search(cr, uid, [('ref','=',incomming_shipment.name)])
2900 assert len(account_move_ids), "account move should be created."
2901 account_move = self.browse(cr, uid, account_move_ids[0], context=context)
2902- assert len(account_move.line_id) == len(incomming_shipment.move_lines) + 1, 'accuont entries are not correspond.'
2903+ assert len(account_move.line_id) == len(incomming_shipment.move_lines) + 1, 'Accounting entries does not correspond.'
2904 for account_move_line in account_move.line_id:
2905 for stock_move in incomming_shipment.move_lines:
2906 if account_move_line.account_id.id == stock_move.product_id.property_stock_account_input.id:
2907- assert account_move_line.credit == 800.0, "Credit amount does not correspond."
2908+ assert account_move_line.credit == 14000.0, "Credit amount does not correspond."
2909 assert account_move_line.debit == 0.0, "Debit amount does not correspond."
2910 else:
2911 assert account_move_line.credit == 0.0, "Credit amount does not correspond."
2912- assert account_move_line.debit == 800.0, "Debit amount does not correspond."
2913--
2914- I consume 1 kgm ice-cream from each incoming lots into internal production.
2915--
2916- !record {model: stock.move.consume, id: consume_lot_incomming}:
2917- product_qty: 1
2918- location_id: location_refrigerator
2919--
2920- !python {model: stock.move.consume}: |
2921- self.do_move_consume(cr, uid, [ref('consume_lot_incomming')], context=context)
2922--
2923- I scrap 10 gm ice-cream from each incoming lots into scrap location.
2924--
2925- !record {model: stock.move.scrap, id: scrap_lot_incomming}:
2926- product_qty: 0.010
2927--
2928- !python {model: stock.move.scrap}: |
2929- self.move_scrap(cr, uid, [ref('scrap_lot_incomming')], context=context)
2930--
2931- I check stock in scrap location and refrigerator location.
2932--
2933- !python {model: stock.location}: |
2934- ctx = {'product_id': ref('product_icecream')}
2935- refrigerator_location = self.pool.get('stock.location').browse(cr, uid, ref('location_refrigerator'), context=ctx)
2936- assert refrigerator_location.stock_real == 135.96, 'stock does not correspond in refrigerator location.'
2937- scrapped_location = self.browse(cr, uid, ref('stock_location_scrapped'), context=ctx)
2938- assert scrapped_location.stock_real == 0.010*4, 'scraped stock does not correspond in scrap location.'
2939-
2940--
2941- I check availabile stock after consumed and scraped.
2942--
2943- !python {model: product.product}: |
2944- product = self.browse(cr, uid, ref('product_icecream'), context=context)
2945- assert product.qty_available == 135.96, "Stock does not correspond."
2946- assert round(product.virtual_available, 2) == -4.04, "Vitual stock does not correspond."
2947+ assert account_move_line.debit == 14000.0, "Debit amount does not correspond."
2948 -
2949 I trace all incoming lots.
2950 -
2951 !python {model: stock.production.lot }: |
2952- lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incomming'), context=context)
2953+ lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incoming'), context=context)
2954 lot_ids = self.search(cr, uid, [('name', 'in', [x.name for x in lot.line_ids])])
2955 self.action_traceability(cr, uid, lot_ids, context=context)
2956 -
2957- I check outgoing shipment after stock availablity in refrigerator.
2958+ I check outgoing shipment after stock availability in Chicago shop.
2959 -
2960 !python {model: stock.picking}: |
2961 shipment = self.browse(cr, uid, ref("outgoing_shipment"), context=context)
2962- self.pool.get('stock.move').action_assign(cr, uid, [x.id for x in shipment.move_lines]) #TOFIX: assignment of move lines should be call before testing assigment otherwise picking never gone in assign state
2963- #TOFIX: shipment should be assigned if stock available
2964- #assert shipment.state == "assigned", "Shipment should be assigned."
2965- #for move_line in shipment.move_lines:
2966- # assert move_line.state == "assigned", "Move should be assigned."
2967+ self.pool.get('stock.move').action_assign(cr, uid, [x.id for x in shipment.move_lines])
2968+ assert shipment.state == "assigned", "Shipment should be assigned."
2969+ for move_line in shipment.move_lines:
2970+ assert move_line.state == "assigned", "Move should be assigned."
2971 self.force_assign(cr, uid, [shipment.id])
2972--
2973- I deliver 5kgm Ice-cream to customer so I make partial deliver
2974+ context.update({'active_model':'stock.move', 'active_id':shipment.move_lines[0].id,'active_ids': [shipment.move_lines[0].id]})
2975+-
2976+ I scrap 4 units of 15” LCD Monitor into scrap location.
2977+-
2978+ !record {model: stock.move.scrap, id: scrap_monitor1}:
2979+ product_qty: 4
2980+-
2981+ !python {model: stock.move.scrap}: |
2982+ self.move_scrap(cr, uid, [ref('scrap_monitor1')], context=context)
2983+-
2984+ I consume 4 units of 15” LCD Monitor.
2985+-
2986+ !record {model: stock.move.consume, id: consume_monitor1}:
2987+ product_qty: 4
2988+ location_id: location_monitor
2989+-
2990+ !python {model: stock.move.consume}: |
2991+ self.do_move_consume(cr, uid, [ref('consume_monitor1')], context=context)
2992+-
2993+ I check stock in scrap location and stock location.
2994+-
2995+ !python {model: stock.location}: |
2996+ ctx = {'product_id': ref('product_product_6')}
2997+ monitor_location = self.pool.get('stock.location').browse(cr, uid, ref('location_monitor'), context=ctx)
2998+ assert monitor_location.stock_real == 132.0, 'stock does not correspond in stock location shop0.'
2999+ scrapped_location = self.browse(cr, uid, ref('stock_location_scrapped'), context=ctx)
3000+ assert scrapped_location.stock_real == 4, 'scraped stock does not correspond in scrap location.'
3001+-
3002+ I check available stock after consumed and scraped move.
3003+-
3004+ !python {model: product.product}: |
3005+ product = self.browse(cr, uid, ref('product_product_6'), context=context)
3006+ assert product.qty_available == 132.0, "Stock does not correspond."
3007+ assert round(product.virtual_available, 2) == -4.00, "Virtual stock does not correspond."
3008+-
3009+ I deliver 5 Unit 15” LCD Monitor to customer partially.
3010 -
3011 !python {model: stock.partial.move}: |
3012- context.update({'active_model': 'stock.move', 'active_id': ref('outgoing_shipment_icecream'), 'active_ids': [ref('outgoing_shipment_icecream')]})
3013+ context.update({'active_model': 'stock.move', 'active_id': ref('outgoing_shipment_monitor'), 'active_ids': [ref('outgoing_shipment_monitor')]})
3014 -
3015- !record {model: stock.partial.move, id: partial_outgoing_icecream}:
3016+ !record {model: stock.partial.move, id: partial_outgoing_monitor}:
3017 move_ids:
3018 - quantity: 5
3019- product_id: product_icecream
3020- product_uom: product.product_uom_kgm
3021- move_id: outgoing_shipment_icecream
3022- location_id: location_refrigerator
3023- location_dest_id: location_delivery_counter
3024+ product_id: product_product_6
3025+ product_uom: product.product_uom_unit
3026+ move_id: outgoing_shipment_monitor
3027+ location_id: location_monitor
3028+ location_dest_id: stock_location_output
3029 -
3030 !python {model: stock.partial.move }: |
3031- self.do_partial(cr, uid, [ref('partial_outgoing_icecream')], context=context)
3032+ self.do_partial(cr, uid, [ref('partial_outgoing_monitor')], context=context)
3033
3034 -
3035- I packing outgoing shipment into box per 10kgm with unique tracking lot.
3036+ I pack outgoing shipment into box of 10 Unit with unique tracking lot.
3037 -
3038 !python {model: stock.move}: |
3039 stock_split = self.pool.get('stock.split.into')
3040- move = self.browse(cr, uid, ref('outgoing_shipment_icecream'), context=context)
3041+ move = self.browse(cr, uid, ref('outgoing_shipment_monitor'), context=context)
3042 context.update({'active_model': 'stock.move', 'active_id': move.id, 'active_ids': [move.id]})
3043 total_qty = move.product_qty
3044 split_qty = 10
3045@@ -254,7 +262,7 @@
3046 stock_split.split(cr, uid, [split_id], context=context)
3047 total_qty -= split_qty
3048 -
3049- I deliver outgoing shipment.
3050+ I deliver the outgoing shipment.
3051 -
3052 !python {model: stock.partial.picking}: |
3053 context.update({'active_model': 'stock.picking', 'active_id': ref('outgoing_shipment'), 'active_ids': [ref('outgoing_shipment')]})
3054@@ -266,7 +274,7 @@
3055 self.do_partial(cr, uid, [ref('partial_outgoing')], context=context)
3056
3057 -
3058- I check outgoing shipment after deliver.
3059+ I check outgoing shipment after delivery.
3060 -
3061 !python {model: stock.picking}: |
3062 shipment = self.browse(cr, uid, ref("outgoing_shipment"), context=context)
3063@@ -274,9 +282,9 @@
3064 for move_line in shipment.move_lines:
3065 assert move_line.state == "done", "Move should be closed."
3066 -
3067- I check availaible stock after deliver.
3068+ I check available stock after delivery.
3069 -
3070 !python {model: product.product}: |
3071- product = self.browse(cr, uid, ref('product_icecream'), context=context)
3072- assert round(product.qty_available, 2) == 5.96, "Stock does not correspond."
3073- assert round(product.virtual_available, 2) == -4.04, "Vitual stock does not correspond."
3074+ product = self.browse(cr, uid, ref('product_product_6'), context=context)
3075+ assert round(product.qty_available, 2) == 6, "Stock does not correspond."
3076+ assert round(product.virtual_available, 2) == -4.00, "Virtual stock does not correspond."
3077
3078=== modified file 'stock/test/stock_report.yml'
3079--- stock/test/stock_report.yml 2013-02-22 13:35:11 +0000
3080+++ stock/test/stock_report.yml 2013-05-07 09:48:32 +0000
3081@@ -1,11 +1,16 @@
3082 -
3083+ Stock user can print all reports related to stock, so let's check data with giving the access rights of user.
3084+-
3085+ !context
3086+ uid: 'res_users_stock_user'
3087+-
3088 I print a stock overview report of location.
3089 -
3090 !python {model: stock.location}: |
3091 import os
3092 import openerp.report
3093 from openerp import tools
3094- data, format = openerp.report.render_report(cr, uid, [ref('location_refrigerator')], 'lot.stock.overview', {}, {})
3095+ data, format = openerp.report.render_report(cr, uid, [ref('location_monitor')], 'lot.stock.overview', {}, {})
3096 if tools.config['test_report_directory']:
3097 file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data)
3098 -
3099@@ -15,7 +20,7 @@
3100 import os
3101 import openerp.report
3102 from openerp import tools
3103- data, format = openerp.report.render_report(cr, uid, [ref('location_refrigerator')], 'lot.stock.overview_all', {}, {})
3104+ data, format = openerp.report.render_report(cr, uid, [ref('location_monitor')], 'lot.stock.overview_all', {}, {})
3105 if tools.config['test_report_directory']:
3106 file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data)
3107 -
3108@@ -25,7 +30,7 @@
3109 import os
3110 import openerp.report
3111 from openerp import tools
3112- data, format = openerp.report.render_report(cr, uid, [ref('stock_inventory_icecream')], 'stock.inventory.move', {}, {})
3113+ data, format = openerp.report.render_report(cr, uid, [ref('stock_inventory_0')], 'stock.inventory.move', {}, {})
3114 if tools.config['test_report_directory']:
3115 file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data)
3116 -
3117@@ -45,7 +50,7 @@
3118 import os
3119 import openerp.report
3120 from openerp import tools
3121- data, format = openerp.report.render_report(cr, uid, [ref('product_icecream')], 'stock.product.history', {}, {})
3122+ data, format = openerp.report.render_report(cr, uid, [ref('product_product_6')], 'stock.product.history', {}, {})
3123 if tools.config['test_report_directory']:
3124 file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data)
3125
3126
3127=== added file 'stock/test/stock_users.yml'
3128--- stock/test/stock_users.yml 1970-01-01 00:00:00 +0000
3129+++ stock/test/stock_users.yml 2013-05-07 09:48:32 +0000
3130@@ -0,0 +1,30 @@
3131+-
3132+ Create a user as 'Stock Manager'
3133+-
3134+ !record {model: res.users, id: res_users_stock_manager}:
3135+ company_id: base.main_company
3136+ name: Stock Manager
3137+ login: sam
3138+ password: sam
3139+ email: stockmanager@yourcompany.com
3140+-
3141+ I added groups for Stock Manager.
3142+-
3143+ !record {model: res.users, id: res_users_stock_manager}:
3144+ groups_id:
3145+ - stock.group_stock_manager
3146+-
3147+ Create a user as 'Stock User'
3148+-
3149+ !record {model: res.users, id: res_users_stock_user}:
3150+ company_id: base.main_company
3151+ name: Stock User
3152+ login: sau
3153+ password: sau
3154+ email: stockuser@yourcompany.com
3155+-
3156+ I added groups for Stock User.
3157+-
3158+ !record {model: res.users, id: res_users_stock_user}:
3159+ groups_id:
3160+ - stock.group_stock_user

Subscribers

People subscribed via source and target branches

to all changes: