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

Proposed by Sanjay Gohel (Open ERP)
Status: Merged
Merged at revision: 8893
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-yaml-access-rights-sgo
Merge into: lp:openobject-addons
Diff against target: 3233 lines (+1478/-388)
99 files modified
account/__openerp__.py (+1/-0)
account/test/account_customer_invoice.yml (+9/-1)
account/test/account_invoice_state.yml (+5/-0)
account/test/account_supplier_invoice.yml (+5/-0)
account/test/account_test_users.yml (+32/-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/test/crm_access_group_users.yml (+31/-0)
crm/test/crm_lead_cancel.yml (+7/-4)
crm/test/crm_lead_merge.yml (+5/-3)
crm/test/crm_lead_message.yml (+5/-0)
crm/test/crm_lead_onchange.yml (+7/-4)
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_holidays/security/ir_rule.xml (+7/-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 (+42/-0)
hr_timesheet/test/test_hr_timesheet.yml (+10/-0)
mrp/__openerp__.py (+1/-0)
mrp/mrp.py (+6/-3)
mrp/security/mrp_security.xml (+1/-0)
mrp/test/cancel_order.yml (+5/-0)
mrp/test/mrp_users.yml (+31/-0)
mrp/test/order_demo.yml (+5/-0)
mrp/test/order_process.yml (+23/-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/security/project_security.xml (+1/-0)
project/test/project_demo.yml.THIS (+23/-0)
project/test/project_process.yml.THIS (+75/-0)
project/test/task_process.yml.THIS (+81/-0)
project_issue/__openerp__.py (+1/-0)
project_issue/test/cancel_issue.yml.THIS (+65/-0)
project_issue/test/issue_demo.yml (+6/-0)
project_issue/test/issue_process.yml (+5/-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)
resource/__openerp__.py (+1/-0)
resource/security/ir.model.access.csv (+1/-0)
resource/security/resource_security.xml (+16/-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 (+16/-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) Approve
OpenERP Core Team Pending
Review via email: mp+162743@code.launchpad.net

This proposal supersedes a proposal from 2013-04-29.

Description of the change

Hello,

    Set access rights of user in groups_id in all module where we have changed yml for access rights

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 : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal

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

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

Finally merged into trunk, thanks for your work

revno: 8893 [merge]
revision-id: <email address hidden>

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/__openerp__.py'
--- account/__openerp__.py 2013-05-07 16:51:13 +0000
+++ account/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -146,6 +146,7 @@
146 'account_unit_test.xml',146 'account_unit_test.xml',
147 ],147 ],
148 'test': [148 'test': [
149 'test/account_test_users.yml',
149 'test/account_customer_invoice.yml',150 'test/account_customer_invoice.yml',
150 'test/account_supplier_invoice.yml',151 'test/account_supplier_invoice.yml',
151 'test/account_change_currency.yml',152 'test/account_change_currency.yml',
152153
=== modified file 'account/test/account_customer_invoice.yml'
--- account/test/account_customer_invoice.yml 2012-11-29 22:26:45 +0000
+++ account/test/account_customer_invoice.yml 2013-09-12 07:07:28 +0000
@@ -1,7 +1,10 @@
1-1-
2 In order to test account invoice I create a new customer invoice2 In order to test account invoice I create a new customer invoice
3-3-
4 I will create bank detail4 I will create bank detail with using manager access rights because account manager can only create bank details.
5-
6 !context
7 uid: 'res_users_account_manager'
5-8-
6 !record {model: res.partner.bank, id: res_partner_bank_0}:9 !record {model: res.partner.bank, id: res_partner_bank_0}:
7 state: bank10 state: bank
@@ -12,6 +15,11 @@
12 bank: base.res_bank_115 bank: base.res_bank_1
13 bank_name: Reserve16 bank_name: Reserve
14-17-
18 Test with that user which have rights to make Invoicing and payment and who is accountant.
19-
20 !context
21 uid: 'res_users_account_user'
22-
15 I create a customer invoice23 I create a customer invoice
16-24-
17 !record {model: account.invoice, id: account_invoice_customer0, view: invoice_form}:25 !record {model: account.invoice, id: account_invoice_customer0, view: invoice_form}:
1826
=== modified file 'account/test/account_invoice_state.yml'
--- account/test/account_invoice_state.yml 2012-11-29 22:26:45 +0000
+++ account/test/account_invoice_state.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Test with that user which have rights to make Invoicing.
3-
4 !context
5 uid: 'res_users_account_user'
6-
2 In order to test Confirm Draft Invoice wizard I create an invoice and confirm it with this wizard7 In order to test Confirm Draft Invoice wizard I create an invoice and confirm it with this wizard
3-8-
4 !record {model: account.invoice, id: account_invoice_state}:9 !record {model: account.invoice, id: account_invoice_state}:
510
=== modified file 'account/test/account_supplier_invoice.yml'
--- account/test/account_supplier_invoice.yml 2013-08-09 07:06:05 +0000
+++ account/test/account_supplier_invoice.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Test with that Finance manager who can only create supplier invoice.
3-
4 !context
5 uid: 'res_users_account_manager'
6-
2 In order to test account invoice I create a new supplier invoice7 In order to test account invoice I create a new supplier invoice
3-8-
4 I create a Tax Codes9 I create a Tax Codes
510
=== added file 'account/test/account_test_users.yml'
--- account/test/account_test_users.yml 1970-01-01 00:00:00 +0000
+++ account/test/account_test_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,32 @@
1-
2 Create a user as 'Accountant'
3-
4 !record {model: res.users, id: res_users_account_user}:
5 company_id: base.main_company
6 name: Accountant
7 login: acc
8 password: acc
9 email: accountuser@yourcompany.com
10-
11 I added groups for Accountant.
12-
13 !record {model: res.users, id: res_users_account_user}:
14 groups_id:
15 - account.group_account_user
16 - base.group_partner_manager
17-
18 Create a user as 'Financial Manager'
19-
20 !record {model: res.users, id: res_users_account_manager}:
21 company_id: base.main_company
22 name: Financial Manager
23 login: fm
24 password: fm
25 email: accountmanager@yourcompany.com
26-
27 I added groups for Financial Manager.
28-
29 !record {model: res.users, id: res_users_account_manager}:
30 groups_id:
31 - account.group_account_manager
32 - base.group_partner_manager
0\ No newline at end of file33\ No newline at end of file
134
=== modified file 'account/test/account_validate_account_move.yml'
--- account/test/account_validate_account_move.yml 2012-11-29 22:26:45 +0000
+++ account/test/account_validate_account_move.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Test validate account move with user who is accountant which have its rights.'
3-
4 !context
5 uid: 'res_users_account_user'
6-
2 In order to test the account move lines in OpenERP, I create account move 7 In order to test the account move lines in OpenERP, I create account move
3-8-
4 I create a Account tax code9 I create a Account tax code
510
=== modified file 'account_voucher/__openerp__.py'
--- account_voucher/__openerp__.py 2013-05-06 10:07:08 +0000
+++ account_voucher/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -61,6 +61,7 @@
61 'account_voucher_data.xml',61 'account_voucher_data.xml',
62 ],62 ],
63 'test' : [63 'test' : [
64 'test/account_voucher_users.yml',
64 'test/case5_suppl_usd_usd.yml',65 'test/case5_suppl_usd_usd.yml',
65 'test/account_voucher.yml',66 'test/account_voucher.yml',
66 'test/sales_receipt.yml',67 'test/sales_receipt.yml',
6768
=== modified file 'account_voucher/test/account_voucher.yml'
--- account_voucher/test/account_voucher.yml 2013-05-02 22:59:37 +0000
+++ account_voucher/test/account_voucher.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,10 @@
1-1-
2 I check the voucher module with user who is accountant.
3-
4 !context
5 uid: 'res_users_account_voucher_user'
6
7-
2 In order to check account voucher module in OpenERP I create a customer voucher8 In order to check account voucher module in OpenERP I create a customer voucher
3-9-
4 !record {model: account.voucher, id: account_voucher_voucherforaxelor0, view: view_sale_receipt_form}:10 !record {model: account.voucher, id: account_voucher_voucherforaxelor0, view: view_sale_receipt_form}:
511
=== added file 'account_voucher/test/account_voucher_users.yml'
--- account_voucher/test/account_voucher_users.yml 1970-01-01 00:00:00 +0000
+++ account_voucher/test/account_voucher_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,32 @@
1-
2 Create a user as 'Accountant for account voucher'
3-
4 !record {model: res.users, id: res_users_account_voucher_user}:
5 company_id: base.main_company
6 name: Voucher Accountant
7 login: vacc
8 password: acc
9 email: accountant@yourcompany.com
10-
11 I added groups to Accountant for account voucher.
12-
13 !record {model: res.users, id: res_users_account_voucher_user}:
14 groups_id:
15 - base.group_partner_manager
16 - account.group_account_user
17-
18 Create a user as 'Financial Manager for account voucher'
19-
20 !record {model: res.users, id: res_users_account_voucher_manager}:
21 company_id: base.main_company
22 name: Financial Manager for voucher
23 login: fmv
24 password: fmv
25 email: finmanager@yourcompany.com
26-
27 I added groups to Financial Manager for account voucher.
28-
29 !record {model: res.users, id: res_users_account_voucher_manager}:
30 groups_id:
31 - base.group_partner_manager
32 - account.group_account_manager
033
=== modified file 'account_voucher/test/case_eur_usd.yml'
--- account_voucher/test/case_eur_usd.yml 2013-05-02 22:59:37 +0000
+++ account_voucher/test/case_eur_usd.yml 2013-09-12 07:07:28 +0000
@@ -1,5 +1,10 @@
1##YAML test on the account_voucher as depicted in this bug report: https://bugs.launchpad.net/openobject-addons/+bug/9541551##YAML test on the account_voucher as depicted in this bug report: https://bugs.launchpad.net/openobject-addons/+bug/954155
2-2-
3 Only manager can create and take decision about bank and currency there I checkd this test with user who is finance manager.
4-
5 !context
6 uid: 'res_users_account_voucher_manager'
7-
3 In order to check the payment with multi-currency in OpenERP, 8 In order to check the payment with multi-currency in OpenERP,
4 I create an invoice in EUR and make payment in USD based on the currency rating.9 I create an invoice in EUR and make payment in USD based on the currency rating.
5-10-
611
=== modified file 'account_voucher/test/sales_payment.yml'
--- account_voucher/test/sales_payment.yml 2013-02-22 16:10:29 +0000
+++ account_voucher/test/sales_payment.yml 2013-09-12 07:07:28 +0000
@@ -1,3 +1,8 @@
1-
2 I test sales payment with user who is accountant.
3-
4 !context
5 uid: 'res_users_account_voucher_user'
1-6-
2 Create an invoice for the partner Seagate with amount 450.07 Create an invoice for the partner Seagate with amount 450.0
3-8-
49
=== modified file 'account_voucher/test/sales_receipt.yml'
--- account_voucher/test/sales_receipt.yml 2013-02-22 16:10:29 +0000
+++ account_voucher/test/sales_receipt.yml 2013-09-12 07:07:28 +0000
@@ -1,3 +1,8 @@
1-
2 Accountant can also be created receipt and validate it there for I checked it with that user who is accountant.
3-
4 !context
5 uid: 'res_users_account_voucher_user'
1- 6-
2 Creating a Voucher Receipt for partner Seagate with amount 30000.07 Creating a Voucher Receipt for partner Seagate with amount 30000.0
3- 8-
49
=== modified file 'crm/__openerp__.py'
--- crm/__openerp__.py 2013-08-13 09:55:46 +0000
+++ crm/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -105,6 +105,7 @@
105 'crm_action_rule_demo.xml',105 'crm_action_rule_demo.xml',
106 ],106 ],
107 'test': [107 'test': [
108 'test/crm_access_group_users.yml',
108 'test/crm_lead_message.yml',109 'test/crm_lead_message.yml',
109 'test/lead2opportunity2win.yml',110 'test/lead2opportunity2win.yml',
110 'test/lead2opportunity_assign_salesmen.yml',111 'test/lead2opportunity_assign_salesmen.yml',
111112
=== modified file 'crm/security/crm_security.xml'
--- crm/security/crm_security.xml 2013-03-28 16:07:04 +0000
+++ crm/security/crm_security.xml 2013-09-12 07:07:28 +0000
@@ -5,6 +5,7 @@
5 <record id="base.group_sale_salesman" model="res.groups">5 <record id="base.group_sale_salesman" model="res.groups">
6 <field name="name">User: Own Leads Only</field>6 <field name="name">User: Own Leads Only</field>
7 <field name="category_id" ref="base.module_category_sales_management"/>7 <field name="category_id" ref="base.module_category_sales_management"/>
8 <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
8 <field name="comment">the user will have access to his own data in the sales application.</field>9 <field name="comment">the user will have access to his own data in the sales application.</field>
9 </record>10 </record>
1011
1112
=== added file 'crm/test/crm_access_group_users.yml'
--- crm/test/crm_access_group_users.yml 1970-01-01 00:00:00 +0000
+++ crm/test/crm_access_group_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,31 @@
1-
2 Create a user as 'Crm Salesmanager'
3-
4 !record {model: res.users, id: crm_res_users_salesmanager}:
5 company_id: base.main_company
6 name: Crm Sales manager
7 login: csm
8 password: csm
9 email: crmmanager@yourcompany.com
10-
11 I added groups for Crm Salesmanager.
12-
13 !record {model: res.users, id: crm_res_users_salesmanager}:
14 groups_id:
15 - base.group_sale_manager
16-
17 Create a user as 'Crm Salesman'
18-
19 !record {model: res.users, id: crm_res_users_salesman}:
20 company_id: base.main_company
21 name: Crm Salesman
22 login: csu
23 password: csu
24 email: crmuser@yourcompany.com
25-
26 I added groups for Crm Salesman.
27-
28 !record {model: res.users, id: crm_res_users_salesman}:
29 groups_id:
30 - base.group_sale_salesman_all_leads
31 - base.group_partner_manager
032
=== modified file 'crm/test/crm_lead_cancel.yml'
--- crm/test/crm_lead_cancel.yml 2013-07-16 15:15:13 +0000
+++ crm/test/crm_lead_cancel.yml 2013-09-12 07:07:28 +0000
@@ -1,21 +1,24 @@
1-1-
2 I set a new sale team (with Marketing at parent) .2 I set a new sale team (with Marketing at parent) giving access rights of salesman.
3-
4 !context
5 uid: 'crm_res_users_salesmanager'
3-6-
4 !python {model: crm.lead}: |7 !python {model: crm.lead}: |
5 section_id = self.pool.get('crm.case.section').create(cr, uid, {'name': "Phone Marketing", 'parent_id': ref("crm.crm_case_section_2")})8 section_id = self.pool.get('crm.case.section').create(cr, uid, {'name': "Phone Marketing", 'parent_id': ref("crm.crm_case_section_2")})
6 self.write(cr, uid, [ref("crm_case_1")], {'section_id': section_id})9 self.write(cr, uid, [ref("crm_case_1")], {'section_id': section_id})
7-10-
8 I check unqualified lead .11 Salesman check unqualified lead .
9-12-
10 !assert {model: crm.lead, id: crm.crm_case_1, string: Lead is in new stage}:13 !assert {model: crm.lead, id: crm.crm_case_1, string: Lead is in new stage}:
11 - stage_id.sequence == 114 - stage_id.sequence == 1
12-15-
13 I escalate the lead to parent team.16 Salesman escalate the lead to parent team.
14-17-
15 !python {model: crm.lead}: |18 !python {model: crm.lead}: |
16 self.case_escalate(cr, uid, [ref("crm_case_1")])19 self.case_escalate(cr, uid, [ref("crm_case_1")])
17-20-
18 I check the lead is correctly escalated to the parent team.21 Salesman check the lead is correctly escalated to the parent team.
19-22-
20 !assert {model: crm.lead, id: crm.crm_case_1, string: Escalate lead to parent team}:23 !assert {model: crm.lead, id: crm.crm_case_1, string: Escalate lead to parent team}:
21 - section_id.name == "Marketing"24 - section_id.name == "Marketing"
2225
=== modified file 'crm/test/crm_lead_merge.yml'
--- crm/test/crm_lead_merge.yml 2013-07-16 15:15:13 +0000
+++ crm/test/crm_lead_merge.yml 2013-09-12 07:07:28 +0000
@@ -1,6 +1,8 @@
11-
2-2 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.
3 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.3-
4 !context
5 uid: 'crm_res_users_salesmanager'
4-6-
5 !record {model: crm.lead, id: test_crm_opp_1}:7 !record {model: crm.lead, id: test_crm_opp_1}:
6 type: 'opportunity'8 type: 'opportunity'
79
=== modified file 'crm/test/crm_lead_message.yml'
--- crm/test/crm_lead_message.yml 2013-04-16 15:18:44 +0000
+++ crm/test/crm_lead_message.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Give the access rights of Salesman to communicate with customer.
3-
4 !context
5 uid: 'crm_res_users_salesman'
6-
2 Customer interested in our product, so he sends request by email to get more details.7 Customer interested in our product, so he sends request by email to get more details.
3-8-
4 Mail script will fetch his request from mail server. Then I process that mail after read EML file.9 Mail script will fetch his request from mail server. Then I process that mail after read EML file.
510
=== modified file 'crm/test/crm_lead_onchange.yml'
--- crm/test/crm_lead_onchange.yml 2013-07-16 15:15:13 +0000
+++ crm/test/crm_lead_onchange.yml 2013-09-12 07:07:28 +0000
@@ -1,5 +1,8 @@
1-1-
2 I create a lead record to call a partner onchange, stage onchange and mailing opt-in onchange method.2 Sales manager create a lead record to call a partner onchange, stage onchange and mailing opt-in onchange method.
3-
4 !context
5 uid: 'crm_res_users_salesmanager'
3-6-
4 !record {model: crm.lead, id: crm_case_25}:7 !record {model: crm.lead, id: crm_case_25}:
5 name: 'Need more info about your pc2'8 name: 'Need more info about your pc2'
@@ -7,7 +10,7 @@
7 type: opportunity10 type: opportunity
8 stage_id: crm.stage_lead111 stage_id: crm.stage_lead1
9-12-
10 I create a lead record to call a mailing opt-out onchange method.13 Sales manager create a lead record to call a mailing opt-out onchange method.
11-14-
12 !record {model: crm.lead, id: crm_case_18}:15 !record {model: crm.lead, id: crm_case_18}:
13 name: 'Need 20 Days of Consultancy'16 name: 'Need 20 Days of Consultancy'
@@ -15,8 +18,8 @@
15 stage_id: crm.stage_lead118 stage_id: crm.stage_lead1
16 opt_out: True19 opt_out: True
17-20-
18 I create a phonecall record to call a partner onchange method.21 Sales manager create a phonecall record to call a partner onchange method.
19-22-
20 !record {model: crm.phonecall, id: crm_phonecall_5}:23 !record {model: crm.phonecall, id: crm_phonecall_5}:
21 name: 'Bad time'24 name: 'Bad time'
22 partner_id: base.res_partner_5
23\ No newline at end of file25\ No newline at end of file
26 partner_id: base.res_partner_5
2427
=== modified file 'crm/test/crm_lead_unlink.yml'
--- crm/test/crm_lead_unlink.yml 2013-03-21 11:26:47 +0000
+++ crm/test/crm_lead_unlink.yml 2013-09-12 07:07:28 +0000
@@ -1,5 +1,8 @@
1-1-
2 I Unlink the Lead.2 Only Sales manager Unlink the Lead so test with Manager's access rights'.
3-
4 !context
5 uid: 'crm_res_users_salesmanager'
3-6-
4 !python {model: crm.lead}: |7 !python {model: crm.lead}: |
5 self.unlink(cr, uid, [ref("crm_case_4")])8 self.unlink(cr, uid, [ref("crm_case_4")])
69
=== modified file 'crm/test/lead2opportunity2win.yml'
--- crm/test/lead2opportunity2win.yml 2013-08-13 09:47:47 +0000
+++ crm/test/lead2opportunity2win.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Giving access rights of salesman to convert the lead into opportunity.
3-
4 !context
5 uid: 'crm_res_users_salesman'
6-
2 In order to test the conversion of a lead into a opportunity,7 In order to test the conversion of a lead into a opportunity,
3-8-
4 I set lead to open stage.9 I set lead to open stage.
510
=== modified file 'crm/test/lead2opportunity_assign_salesmen.yml'
--- crm/test/lead2opportunity_assign_salesmen.yml 2013-07-16 15:15:13 +0000
+++ crm/test/lead2opportunity_assign_salesmen.yml 2013-09-12 07:07:28 +0000
@@ -1,41 +1,5 @@
1-1-
2 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).2 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).
3-
4 !record {model: crm.lead, id: test_crm_lead_01}:
5 type: 'lead'
6 name: 'Test lead 1'
7 email_from: 'Raoul Grosbedon <raoul@grosbedon.fr>'
8 stage_id: stage_lead1
9-
10 !record {model: crm.lead, id: test_crm_lead_02}:
11 type: 'lead'
12 name: 'Test lead 2'
13 email_from: 'Raoul Grosbedon <raoul@grosbedon.fr>'
14 stage_id: stage_lead1
15-
16 !record {model: crm.lead, id: test_crm_lead_03}:
17 type: 'lead'
18 name: 'Test lead 3'
19 email_from: 'Raoul Grosbedon <raoul@grosbedon.fr>'
20 stage_id: stage_lead1
21-
22 !record {model: crm.lead, id: test_crm_lead_04}:
23 type: 'lead'
24 name: 'Test lead 4'
25 contact_name: 'Fabrice Lepoilu'
26 stage_id: stage_lead1
27-
28 !record {model: crm.lead, id: test_crm_lead_05}:
29 type: 'lead'
30 name: 'Test lead 5'
31 contact_name: 'Fabrice Lepoilu'
32 stage_id: stage_lead1
33-
34 !record {model: crm.lead, id: test_crm_lead_06}:
35 type: 'lead'
36 name: 'Test lead 6'
37 partner_name: 'Agrolait SuperSeed SA'
38 stage_id: stage_lead1
39-3-
40 !record {model: res.users, id: test_res_user_01}:4 !record {model: res.users, id: test_res_user_01}:
41 name: 'Test user A'5 name: 'Test user A'
@@ -57,7 +21,48 @@
57 login: 'tud'21 login: 'tud'
58 new_password: 'tud'22 new_password: 'tud'
59-23-
60 I create a mass convert wizard and convert all the leads.24 Salesman also creates lead so giving access rights of salesman.
25-
26 !context
27 uid: 'crm_res_users_salesman'
28-
29 !record {model: crm.lead, id: test_crm_lead_01}:
30 type: 'lead'
31 name: 'Test lead 1'
32 email_from: 'Raoul Grosbedon <raoul@grosbedon.fr>'
33 stage_id: stage_lead1
34-
35 !record {model: crm.lead, id: test_crm_lead_02}:
36 type: 'lead'
37 name: 'Test lead 2'
38 email_from: 'Raoul Grosbedon <raoul@grosbedon.fr>'
39 stage_id: stage_lead1
40-
41 !record {model: crm.lead, id: test_crm_lead_03}:
42 type: 'lead'
43 name: 'Test lead 3'
44 email_from: 'Raoul Grosbedon <raoul@grosbedon.fr>'
45 stage_id: stage_lead1
46-
47 !record {model: crm.lead, id: test_crm_lead_04}:
48 type: 'lead'
49 name: 'Test lead 4'
50 contact_name: 'Fabrice Lepoilu'
51 stage_id: stage_lead1
52-
53 !record {model: crm.lead, id: test_crm_lead_05}:
54 type: 'lead'
55 name: 'Test lead 5'
56 contact_name: 'Fabrice Lepoilu'
57 stage_id: stage_lead1
58-
59 !record {model: crm.lead, id: test_crm_lead_06}:
60 type: 'lead'
61 name: 'Test lead 6'
62 partner_name: 'Agrolait SuperSeed SA'
63 stage_id: stage_lead1
64-
65 Salesman create a mass convert wizard and convert all the leads.
61-66-
62 !python {model: crm.lead2opportunity.partner.mass}: |67 !python {model: crm.lead2opportunity.partner.mass}: |
63 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")})68 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")})
6469
=== modified file 'crm/test/phonecalls.yml'
--- crm/test/phonecalls.yml 2013-08-13 09:20:42 +0000
+++ crm/test/phonecalls.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Salesman check the phone calls data so test with the access rights of salesman.
3-
4 !context
5 uid: 'crm_res_users_salesman'
6-
2 I schedule a phone call with a customer.7 I schedule a phone call with a customer.
3-8-
4 !python {model: crm.phonecall2phonecall}: |9 !python {model: crm.phonecall2phonecall}: |
510
=== modified file 'event/__openerp__.py'
--- event/__openerp__.py 2013-06-14 12:10:20 +0000
+++ event/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -52,7 +52,7 @@
52 'email_template.xml',52 'email_template.xml',
53 ],53 ],
54 'demo': ['event_demo.xml'],54 'demo': ['event_demo.xml'],
55 'test': ['test/process/event_draft2done.yml'],55 'test': ['test/ui/event_users.yml','test/process/event_draft2done.yml'],
56 'css': ['static/src/css/event.css'],56 'css': ['static/src/css/event.css'],
57 'installable': True,57 'installable': True,
58 'application': True,58 'application': True,
5959
=== modified file 'event/security/event_security.xml'
--- event/security/event_security.xml 2013-04-10 12:51:17 +0000
+++ event/security/event_security.xml 2013-09-12 07:07:28 +0000
@@ -10,6 +10,7 @@
1010
11 <record id="group_event_user" model="res.groups">11 <record id="group_event_user" model="res.groups">
12 <field name="name">User</field>12 <field name="name">User</field>
13 <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
13 <field name="category_id" ref="module_category_event_management"/>14 <field name="category_id" ref="module_category_event_management"/>
14 </record>15 </record>
1516
1617
=== modified file 'event/test/process/event_draft2done.yml'
--- event/test/process/event_draft2done.yml 2012-05-27 09:49:23 +0000
+++ event/test/process/event_draft2done.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Give the access rights of Event user to organize an event and also do registration.
3-
4 !context
5 uid: 'res_users_eventuser'
6-
2 I want to organize an event, 7 I want to organize an event,
3 into this conference I should create two registration.8 into this conference I should create two registration.
4 One confirmed and attended the event and the other cancelled.9 One confirmed and attended the event and the other cancelled.
510
=== added file 'event/test/ui/event_users.yml'
--- event/test/ui/event_users.yml 1970-01-01 00:00:00 +0000
+++ event/test/ui/event_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,30 @@
1-
2 Create a user as 'Event manager'
3-
4 !record {model: res.users, id: res_users_eventmanager}:
5 company_id: base.main_company
6 name: Event manager
7 login: em
8 password: em
9 email: eventmanager@yourcompany.com
10-
11 I added groups for Event manager.
12-
13 !record {model: res.users, id: res_users_eventmanager}:
14 groups_id:
15 - event.group_event_manager
16-
17 Create a user as 'Event user'
18-
19 !record {model: res.users, id: res_users_eventuser}:
20 company_id: base.main_company
21 name: User
22 login: eu
23 password: eu
24 email: eventuser@yourcompany.com
25-
26 I added groups for Event user.
27-
28 !record {model: res.users, id: res_users_eventuser}:
29 groups_id:
30 - event.group_event_user
031
=== modified file 'hr/__openerp__.py'
--- hr/__openerp__.py 2013-05-10 14:48:29 +0000
+++ hr/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -64,6 +64,7 @@
64 ],64 ],
65 'demo': ['hr_demo.xml'],65 'demo': ['hr_demo.xml'],
66 'test': [66 'test': [
67 'test/hr_users.yml',
67 'test/open2recruit2close_job.yml',68 'test/open2recruit2close_job.yml',
68 'test/hr_demo.yml',69 'test/hr_demo.yml',
69 ],70 ],
7071
=== modified file 'hr/test/hr_demo.yml'
--- hr/test/hr_demo.yml 2012-03-19 12:28:22 +0000
+++ hr/test/hr_demo.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Give the access rights of Hr Officer to create employee.
3-
4 !context
5 uid: 'res_users_hr_officer'
6-
2 !record {model: hr.job, id: job_developer, view: False}:7 !record {model: hr.job, id: job_developer, view: False}:
3 no_of_employee: 0.08 no_of_employee: 0.0
4 no_of_recruitment: 5.09 no_of_recruitment: 5.0
510
=== added file 'hr/test/hr_users.yml'
--- hr/test/hr_users.yml 1970-01-01 00:00:00 +0000
+++ hr/test/hr_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,42 @@
1-
2 Create a user as 'HR Manager'
3-
4 !record {model: res.users, id: res_users_hr_manager}:
5 company_id: base.main_company
6 name: HR manager
7 login: hrm
8 password: hrm
9-
10 I added groups for HR Manager.
11-
12 !record {model: res.users, id: res_users_hr_manager}:
13 groups_id:
14 - base.group_hr_manager
15-
16 Create a user as 'HR Officer'
17-
18 !record {model: res.users, id: res_users_hr_officer}:
19 company_id: base.main_company
20 name: HR Officer
21 login: hro
22 password: hro
23-
24 I added groups for HR Officer.
25-
26 !record {model: res.users, id: res_users_hr_officer}:
27 groups_id:
28 - base.group_hr_user
29-
30 Create a user as 'Employee'
31-
32 !record {model: res.users, id: res_users_employee}:
33 company_id: base.main_company
34 name: Employee
35 login: emp
36 password: emp
37-
38 I added groups for Employee.
39-
40 !record {model: res.users, id: res_users_employee}:
41 groups_id:
42 - base.group_user
043
=== modified file 'hr/test/open2recruit2close_job.yml'
--- hr/test/open2recruit2close_job.yml 2012-06-11 09:34:23 +0000
+++ hr/test/open2recruit2close_job.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Give the access rights of Hr Officer to the user to test the process of Human Resource Management.
3-
4 !context
5 uid: 'res_users_hr_officer'
6-
2 In order to test the process of Human Resource Management, I open Job Postion for "Developer".7 In order to test the process of Human Resource Management, I open Job Postion for "Developer".
3- 8-
4 !python {model: hr.job}: |9 !python {model: hr.job}: |
510
=== modified file 'hr_attendance/test/attendance_process.yml'
--- hr_attendance/test/attendance_process.yml 2012-11-29 22:26:45 +0000
+++ hr_attendance/test/attendance_process.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,23 @@
1-1-
2 Create a user as 'HR Attendance Officer'
3-
4 !record {model: res.users, id: res_users_attendance_officer}:
5 company_id: base.main_company
6 name: HR Officer
7 login: ao
8 password: ao
9-
10 I added groups for HR Attendance Officer.
11-
12 !record {model: res.users, id: res_users_attendance_officer}:
13 groups_id:
14 - base.group_hr_user
15-
16 Give the access rights of Hr Officer to test attendance process.
17-
18 !context
19 uid: 'res_users_attendance_officer'
20-
2 In order to test attendance process in OpenERP, I entry of SignIn of employee.21 In order to test attendance process in OpenERP, I entry of SignIn of employee.
3-22-
4 !python {model: hr.employee}: |23 !python {model: hr.employee}: |
524
=== modified file 'hr_holidays/security/ir_rule.xml'
--- hr_holidays/security/ir_rule.xml 2013-04-29 12:43:33 +0000
+++ hr_holidays/security/ir_rule.xml 2013-09-12 07:07:28 +0000
@@ -15,5 +15,12 @@
15 <field name="groups" eval="[(4,ref('base.group_hr_user'))]"/>15 <field name="groups" eval="[(4,ref('base.group_hr_user'))]"/>
16 </record>16 </record>
17 17
18 <record id="resource_leaves_officer" model="ir.rule">
19 <field name="name">Leaves Officer</field>
20 <field name="model_id" ref="model_resource_calendar_leaves"/>
21 <field name="domain_force">[(1,'=',1)]</field>
22 <field name="groups" eval="[(4,ref('base.group_hr_user'))]"/>
23 </record>
24
18 </data>25 </data>
19</openerp>26</openerp>
2027
=== modified file 'hr_recruitment/security/hr_recruitment_security.xml'
--- hr_recruitment/security/hr_recruitment_security.xml 2013-04-29 12:43:33 +0000
+++ hr_recruitment/security/hr_recruitment_security.xml 2013-09-12 07:07:28 +0000
@@ -9,6 +9,9 @@
9 <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>9 <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
10 </record>10 </record>
1111
12 <record id="base.group_hr_user" model="res.groups">
13 <field name="implied_ids" eval="[(4, ref('base.group_survey_user'))]"/>
14 </record>
1215
13 </data>16 </data>
14</openerp>17</openerp>
1518
=== modified file 'hr_recruitment/test/recruitment_process.yml'
--- hr_recruitment/test/recruitment_process.yml 2013-07-16 15:15:13 +0000
+++ hr_recruitment/test/recruitment_process.yml 2013-09-12 07:07:28 +0000
@@ -1,5 +1,23 @@
1-1-
2 In Order to test process of Recruitment,2 Create a user as 'HR Recruitment Officer'
3-
4 !record {model: res.users, id: res_users_hr_recruitment_officer}:
5 company_id: base.main_company
6 name: HR Recruitment Officer
7 login: hrro
8 password: hrro
9 email: hrofcr@yourcompany.com
10-
11 I added groups for HR Recruitment Officer.
12-
13 !record {model: res.users, id: res_users_hr_recruitment_officer}:
14 groups_id:
15 - base.group_hr_user
16-
17 In Order to test process of Recruitment so giving HR officer's rights,
18-
19 !context
20 uid: 'res_users_hr_recruitment_officer'
3-21-
4 An applicant is interested in the job position. So he sends a resume by email.22 An applicant is interested in the job position. So he sends a resume by email.
5-23-
624
=== modified file 'hr_timesheet/__openerp__.py'
--- hr_timesheet/__openerp__.py 2012-12-06 10:31:42 +0000
+++ hr_timesheet/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -57,6 +57,7 @@
57 ],57 ],
58 'demo': ['hr_timesheet_demo.xml'],58 'demo': ['hr_timesheet_demo.xml'],
59 'test': [59 'test': [
60 'test/hr_timesheet_users.yml',
60 'test/test_hr_timesheet.yml',61 'test/test_hr_timesheet.yml',
61 'test/hr_timesheet_report.yml',62 'test/hr_timesheet_report.yml',
62 'test/hr_timesheet_demo.yml',63 'test/hr_timesheet_demo.yml',
6364
=== modified file 'hr_timesheet/test/hr_timesheet_demo.yml'
--- hr_timesheet/test/hr_timesheet_demo.yml 2011-12-21 10:52:14 +0000
+++ hr_timesheet/test/hr_timesheet_demo.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Give the access rights of Hr Officer to create employee.
3-
4 !context
5 uid: 'res_hr_timesheet_officer'
6-
2 !record {model: hr.analytic.timesheet, id: working_hours_coding, view: False}:7 !record {model: hr.analytic.timesheet, id: working_hours_coding, view: False}:
3 user_id: base.user_demo8 user_id: base.user_demo
4 date: !eval time.strftime('%Y-%m-%d')9 date: !eval time.strftime('%Y-%m-%d')
510
=== added file 'hr_timesheet/test/hr_timesheet_users.yml'
--- hr_timesheet/test/hr_timesheet_users.yml 1970-01-01 00:00:00 +0000
+++ hr_timesheet/test/hr_timesheet_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,42 @@
1-
2 Create a user as 'HR timesheet Manager'
3-
4 !record {model: res.users, id: res_hr_timesheet_manager}:
5 company_id: base.main_company
6 name: HR timesheet manager
7 login: hrtm
8 password: hrtm
9-
10 I added groups for HR timesheet Manager.
11-
12 !record {model: res.users, id: res_hr_timesheet_manager}:
13 groups_id:
14 - base.group_hr_manager
15-
16 Create a user as 'HR timesheet Officer'
17-
18 !record {model: res.users, id: res_hr_timesheet_officer}:
19 company_id: base.main_company
20 name: HR timesheet Officer
21 login: hrto
22 password: hrto
23-
24 I added groups for HR timesheet Officer.
25-
26 !record {model: res.users, id: res_hr_timesheet_officer}:
27 groups_id:
28 - base.group_hr_user
29-
30 Create a user as 'Timesheet Employee'
31-
32 !record {model: res.users, id: res_hr_timesheet_employee}:
33 company_id: base.main_company
34 name: Timesheet Employee
35 login: empt
36 password: empt
37-
38 I added groups for Timesheet Employee.
39-
40 !record {model: res.users, id: res_hr_timesheet_employee}:
41 groups_id:
42 - base.group_user
043
=== modified file 'hr_timesheet/test/test_hr_timesheet.yml'
--- hr_timesheet/test/test_hr_timesheet.yml 2013-09-04 14:11:10 +0000
+++ hr_timesheet/test/test_hr_timesheet.yml 2013-09-12 07:07:28 +0000
@@ -2,6 +2,11 @@
2 In order to test hr_timesheet Module in OpenERP, I make "Sign In/Sign Out for Project" to encode and2 In order to test hr_timesheet Module in OpenERP, I make "Sign In/Sign Out for Project" to encode and
3 track time spent on the different projects.3 track time spent on the different projects.
4-4-
5 Give the access rights of Hr Officer to create employee.
6-
7 !context
8 uid: 'res_hr_timesheet_officer'
9-
5 I create employee "Gilles Gravie" as "User".10 I create employee "Gilles Gravie" as "User".
6-11-
7 !record {model: hr.employee, id: hr.employee_qdp}:12 !record {model: hr.employee, id: hr.employee_qdp}:
@@ -10,6 +15,11 @@
10 parent_id: 'hr.employee_al'15 parent_id: 'hr.employee_al'
11 user_id: 'base.user_demo'16 user_id: 'base.user_demo'
12-17-
18 Give the access rights of Employee to Sign In/Sign Out in Project.
19-
20 !context
21 uid: 'res_hr_timesheet_employee'
22-
13 On "Sign In/Sign Out by Project" wizard i click on "Sign In/Sign Out" button of this wizard.23 On "Sign In/Sign Out by Project" wizard i click on "Sign In/Sign Out" button of this wizard.
14-24-
15 !python {model: hr.sign.in.project}: |25 !python {model: hr.sign.in.project}: |
1626
=== modified file 'mrp/__openerp__.py'
--- mrp/__openerp__.py 2013-08-23 14:31:14 +0000
+++ mrp/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -77,6 +77,7 @@
77 #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 company77 #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
78 # so the ymls are too complex to change at this stage78 # so the ymls are too complex to change at this stage
79 'test': [79 'test': [
80 'test/mrp_users.yml',
80 'test/order_demo.yml',81 'test/order_demo.yml',
81 'test/order_process.yml',82 'test/order_process.yml',
82 'test/cancel_order.yml',83 'test/cancel_order.yml',
8384
=== modified file 'mrp/mrp.py'
--- mrp/mrp.py 2013-08-30 13:36:04 +0000
+++ mrp/mrp.py 2013-09-12 07:07:28 +0000
@@ -27,7 +27,7 @@
27from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP27from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP
28from openerp.tools import float_compare28from openerp.tools import float_compare
29from openerp.tools.translate import _29from openerp.tools.translate import _
30from openerp import tools30from openerp import tools, SUPERUSER_ID
31from openerp import SUPERUSER_ID31from openerp import SUPERUSER_ID
3232
33#----------------------------------------------------------33#----------------------------------------------------------
@@ -817,7 +817,10 @@
817 account = wc.costs_hour_account_id.id817 account = wc.costs_hour_account_id.id
818 if value and account:818 if value and account:
819 amount += value819 amount += value
820 analytic_line_obj.create(cr, uid, {820 # we user SUPERUSER_ID as we do not garantee an mrp user
821 # has access to account analytic lines but still should be
822 # able to produce orders
823 analytic_line_obj.create(cr, SUPERUSER_ID, {
821 'name': wc_line.name + ' (H)',824 'name': wc_line.name + ' (H)',
822 'amount': value,825 'amount': value,
823 'account_id': account,826 'account_id': account,
@@ -833,7 +836,7 @@
833 account = wc.costs_cycle_account_id.id836 account = wc.costs_cycle_account_id.id
834 if value and account:837 if value and account:
835 amount += value838 amount += value
836 analytic_line_obj.create(cr, uid, {839 analytic_line_obj.create(cr, SUPERUSER_ID, {
837 'name': wc_line.name+' (C)',840 'name': wc_line.name+' (C)',
838 'amount': value,841 'amount': value,
839 'account_id': account,842 'account_id': account,
840843
=== modified file 'mrp/security/mrp_security.xml'
--- mrp/security/mrp_security.xml 2012-07-13 17:08:38 +0000
+++ mrp/security/mrp_security.xml 2013-09-12 07:07:28 +0000
@@ -4,6 +4,7 @@
44
5 <record id="group_mrp_user" model="res.groups">5 <record id="group_mrp_user" model="res.groups">
6 <field name="name">User</field>6 <field name="name">User</field>
7 <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
7 <field name="category_id" ref="base.module_category_manufacturing"/>8 <field name="category_id" ref="base.module_category_manufacturing"/>
8 </record>9 </record>
9 <record id="group_mrp_manager" model="res.groups">10 <record id="group_mrp_manager" model="res.groups">
1011
=== modified file 'mrp/test/cancel_order.yml'
--- mrp/test/cancel_order.yml 2012-11-29 22:26:45 +0000
+++ mrp/test/cancel_order.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 MRP user can cancelled Production Order, so let's check data with giving the access rights of user.
3-
4 !context
5 uid: 'res_users_mrp_user'
6-
2 I first confirm order for PC Assemble SC349.7 I first confirm order for PC Assemble SC349.
3-8-
4 !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_test1}9 !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_test1}
510
=== added file 'mrp/test/mrp_users.yml'
--- mrp/test/mrp_users.yml 1970-01-01 00:00:00 +0000
+++ mrp/test/mrp_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,31 @@
1-
2 Create a user as 'MRP Manager'
3-
4 !record {model: res.users, id: res_users_mrp_manager}:
5 company_id: base.main_company
6 name: MRP Manager
7 login: mam
8 password: mam
9 email: mrp_manager@yourcompany.com
10-
11 I added groups for MRP Manager.
12-
13 !record {model: res.users, id: res_users_mrp_manager}:
14 groups_id:
15 - mrp.group_mrp_manager
16 - account.group_account_user
17-
18 Create a user as 'MRP User'
19-
20 !record {model: res.users, id: res_users_mrp_user}:
21 company_id: base.main_company
22 name: MRP User
23 login: mau
24 password: mau
25 email: mrp_user@yourcompany.com
26-
27 I added groups for MRP User.
28-
29 !record {model: res.users, id: res_users_mrp_user}:
30 groups_id:
31 - mrp.group_mrp_user
0\ No newline at end of file32\ No newline at end of file
133
=== modified file 'mrp/test/order_demo.yml'
--- mrp/test/order_demo.yml 2012-11-29 22:26:45 +0000
+++ mrp/test/order_demo.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 MRP user can create Production Order, so let's check data with giving the access rights of user.
3-
4 !context
5 uid: 'res_users_mrp_user'
6-
2 I create Production Order of PC Assemble SC349 to produce 5.0 Unit.7 I create Production Order of PC Assemble SC349 to produce 5.0 Unit.
3-8-
4 !record {model: mrp.production, id: mrp_production_test1}:9 !record {model: mrp.production, id: mrp_production_test1}:
510
=== modified file 'mrp/test/order_process.yml'
--- mrp/test/order_process.yml 2013-08-01 12:58:20 +0000
+++ mrp/test/order_process.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 MRP user can doing all process related to Production Order, so let's check data with giving the access rights of user.
3-
4 !context
5 uid: 'res_users_mrp_user'
6-
2 I compute the production order.7 I compute the production order.
3-8-
4 !python {model: mrp.production}: |9 !python {model: mrp.production}: |
@@ -23,6 +28,7 @@
23 I confirm the Production Order.28 I confirm the Production Order.
24-29-
25 !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_test1}30 !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_test1}
31
26-32-
27 I check details of Produce Move of Production Order to trace Final Product.33 I check details of Produce Move of Production Order to trace Final Product.
28-34-
@@ -59,6 +65,16 @@
59 assert move_line.location_id.id == routing_loc or order.location_src_id.id, "Source location is not correspond in 'To consume line'."65 assert move_line.location_id.id == routing_loc or order.location_src_id.id, "Source location is not correspond in 'To consume line'."
60 assert move_line.location_dest_id.id == source_location_id, "Destination Location is not correspond in 'To consume line'."66 assert move_line.location_dest_id.id == source_location_id, "Destination Location is not correspond in 'To consume line'."
61-67-
68 I consume raw materials and put one material in scrap location due to waste it.
69-
70 !python {model: mrp.production}: |
71 scrap_location_ids = self.pool.get('stock.location').search(cr, uid, [('scrap_location','=',True)])
72 scrap_location_id = scrap_location_ids[0]
73 order = self.browse(cr, uid, ref("mrp_production_test1"))
74 for move in order.move_lines:
75 if move.product_id.id == ref("product.product_product_6"):
76 move.action_scrap(5.0, scrap_location_id)
77-
62 I check details of an Internal Shipment after confirmed production order to bring components in Raw Materials Location.78 I check details of an Internal Shipment after confirmed production order to bring components in Raw Materials Location.
63-79-
64 !python {model: mrp.production}: |80 !python {model: mrp.production}: |
@@ -155,17 +171,7 @@
155 order = self.browse(cr, uid, ref("mrp_production_test1"))171 order = self.browse(cr, uid, ref("mrp_production_test1"))
156 assert order.state == 'in_production', 'Production order should be in production State.'172 assert order.state == 'in_production', 'Production order should be in production State.'
157-173-
158 I consume raw materials and put one material in scrap location due to waste it.
159-
160 !python {model: mrp.production}: |
161 scrap_location_ids = self.pool.get('stock.location').search(cr, uid, [('scrap_location','=',True)])
162 scrap_location_id = scrap_location_ids[0]
163 order = self.browse(cr, uid, ref("mrp_production_test1"))
164 for move in order.move_lines:
165 if move.product_id.id == ref("product.product_product_6"):
166 move.action_scrap(5.0, scrap_location_id)
167 move.action_consume(move.product_qty)174 move.action_consume(move.product_qty)
168-
169 I produce product.175 I produce product.
170-176-
171 !python {model: mrp.product.produce}: |177 !python {model: mrp.product.produce}: |
@@ -183,7 +189,10 @@
183 order = self.browse(cr, uid, ref("mrp_production_test1"))189 order = self.browse(cr, uid, ref("mrp_production_test1"))
184 assert order.state == 'done', "Production order should be closed."190 assert order.state == 'done', "Production order should be closed."
185-191-
186 I check Total Costs at End of Production.192 I check Total Costs at End of Production as a manager.
193-
194 !context
195 uid: 'res_users_mrp_manager'
187-196-
188 !python {model: mrp.production}: |197 !python {model: mrp.production}: |
189 order = self.browse(cr, uid, ref("mrp_production_test1"))198 order = self.browse(cr, uid, ref("mrp_production_test1"))
@@ -218,6 +227,9 @@
218-227-
219 I print a "BOM Structure".228 I print a "BOM Structure".
220-229-
230 !context
231 uid: 'res_users_mrp_user'
232-
221 !python {model: mrp.production}: |233 !python {model: mrp.production}: |
222 import os234 import os
223 import openerp.report235 import openerp.report
224236
=== modified file 'mrp_operations/__openerp__.py'
--- mrp_operations/__openerp__.py 2012-11-29 22:26:45 +0000
+++ mrp_operations/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -70,7 +70,7 @@
70 'mrp_operations_demo.yml'70 'mrp_operations_demo.yml'
71 ],71 ],
72 'test': [ 72 'test': [
73# 'test/workcenter_operations.yml',73 'test/workcenter_operations.yml',
74 ],74 ],
75 'installable': True,75 'installable': True,
76 'auto_install': False,76 'auto_install': False,
7777
=== modified file 'mrp_operations/test/workcenter_operations.yml'
--- mrp_operations/test/workcenter_operations.yml 2013-02-13 08:35:19 +0000
+++ mrp_operations/test/workcenter_operations.yml 2013-09-12 07:07:28 +0000
@@ -1,6 +1,24 @@
1-1-
2 Create a user as 'MRP User'
3-
4 !record {model: res.users, id: res_mrp_operation_user}:
5 company_id: base.main_company
6 name: MRP User
7 login: maou
8 password: maou
9 email: mrp_operation_user@yourcompany.com
10-
11 I added groups for MRP User.
12-
13 !record {model: res.users, id: res_mrp_operation_user}:
14 groups_id:
15 - mrp.group_mrp_user
16-
2 In order to test mrp_operations with OpenERP, I refer created production order of PC Assemble SC34917 In order to test mrp_operations with OpenERP, I refer created production order of PC Assemble SC349
3 with routing - Manual Component's Assembly to test complete production process with respect of workcenter.18 with routing - Manual Component's Assembly to test complete production process with respect of workcenter with giving access rights of MRP User.
19-
20 !context
21 uid: 'res_mrp_operation_user'
4-22-
5 I compute the production order.23 I compute the production order.
6-24-
@@ -92,7 +110,7 @@
92 I print a Barcode Report of Operation line.110 I print a Barcode Report of Operation line.
93-111-
94 !python {model: mrp_operations.operation.code}: |112 !python {model: mrp_operations.operation.code}: |
95 import netsvc, tools, os113 from openerp import netsvc, tools
96 (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')], {}, {})114 (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')], {}, {})
97 if tools.config['test_report_directory']:115 if tools.config['test_report_directory']:
98 file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-barcode_report.'+format), 'wb+').write(data)116 file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-barcode_report.'+format), 'wb+').write(data)
@@ -101,7 +119,7 @@
101 I print Workcenter's Barcode Report.119 I print Workcenter's Barcode Report.
102-120-
103 !python {model: mrp.workcenter}: |121 !python {model: mrp.workcenter}: |
104 import netsvc, tools, os122 from openerp import netsvc, tools
105 (data, format) = netsvc.LocalService('report.mrp.wc.barcode').create(cr, uid, [ref('mrp.mrp_workcenter_0'),ref('mrp.mrp_workcenter_1')], {}, {})123 (data, format) = netsvc.LocalService('report.mrp.wc.barcode').create(cr, uid, [ref('mrp.mrp_workcenter_0'),ref('mrp.mrp_workcenter_1')], {}, {})
106 if tools.config['test_report_directory']:124 if tools.config['test_report_directory']:
107 file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-workcenter_barcode_report.'+format), 'wb+').write(data)125 file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-workcenter_barcode_report.'+format), 'wb+').write(data)
108126
=== modified file 'mrp_repair/__openerp__.py'
--- mrp_repair/__openerp__.py 2012-11-29 22:26:45 +0000
+++ mrp_repair/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -52,7 +52,8 @@
52 'mrp_repair_report.xml',52 'mrp_repair_report.xml',
53 ],53 ],
54 'demo': ['mrp_repair_demo.yml'],54 'demo': ['mrp_repair_demo.yml'],
55 'test': ['test/test_mrp_repair_noneinv.yml',55 'test': ['test/mrp_repair_users.yml',
56 'test/test_mrp_repair_noneinv.yml',
56 'test/test_mrp_repair_b4inv.yml',57 'test/test_mrp_repair_b4inv.yml',
57 'test/test_mrp_repair_afterinv.yml',58 'test/test_mrp_repair_afterinv.yml',
58 'test/test_mrp_repair_cancel.yml',59 'test/test_mrp_repair_cancel.yml',
5960
=== added file 'mrp_repair/test/mrp_repair_users.yml'
--- mrp_repair/test/mrp_repair_users.yml 1970-01-01 00:00:00 +0000
+++ mrp_repair/test/mrp_repair_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,30 @@
1-
2 Create a user as 'MRP Repair Manager'
3-
4 !record {model: res.users, id: res_mrp_repair_manager}:
5 company_id: base.main_company
6 name: MRP Manager
7 login: marm
8 password: marm
9 email: mrp_repair_manager@yourcompany.com
10-
11 I added groups for MRP Repair Manager.
12-
13 !record {model: res.users, id: res_mrp_repair_manager}:
14 groups_id:
15 - mrp.group_mrp_manager
16-
17 Create a user as 'MRP Repair User'
18-
19 !record {model: res.users, id: res_mrp_repair_user}:
20 company_id: base.main_company
21 name: MRP User
22 login: maru
23 password: maru
24 email: mrp_repair_user@yourcompany.com
25-
26 I added groups for MRP Repair User.
27-
28 !record {model: res.users, id: res_mrp_repair_user}:
29 groups_id:
30 - mrp.group_mrp_user
0\ No newline at end of file31\ No newline at end of file
132
=== modified file 'mrp_repair/test/test_mrp_repair_afterinv.yml'
--- mrp_repair/test/test_mrp_repair_afterinv.yml 2013-03-21 13:18:24 +0000
+++ mrp_repair/test/test_mrp_repair_afterinv.yml 2013-09-12 07:07:28 +0000
@@ -1,5 +1,8 @@
1-1-
2 In order to test Invoice Method 'After Repair'.2 In order to test Invoice Method 'After Repair' with giving the access rights of mrp user.
3-
4 !context
5 uid: 'res_mrp_repair_user'
3-6-
4 I confirm Repair order taking Invoice Method 'After Repair'.7 I confirm Repair order taking Invoice Method 'After Repair'.
5-8-
69
=== modified file 'mrp_repair/test/test_mrp_repair_b4inv.yml'
--- mrp_repair/test/test_mrp_repair_b4inv.yml 2013-03-21 13:18:24 +0000
+++ mrp_repair/test/test_mrp_repair_b4inv.yml 2013-09-12 07:07:28 +0000
@@ -1,5 +1,8 @@
1-1-
2 Now I test for Invoice Method 'Before Repair'.2 Now I test for Invoice Method 'Before Repair' with giving the access rights of mrp user.
3-
4 !context
5 uid: 'res_mrp_repair_user'
3-6-
4 I confirm Repair order for Invoice Method 'Before Repair'.7 I confirm Repair order for Invoice Method 'Before Repair'.
5-8-
69
=== modified file 'mrp_repair/test/test_mrp_repair_cancel.yml'
--- mrp_repair/test/test_mrp_repair_cancel.yml 2012-11-29 22:26:45 +0000
+++ mrp_repair/test/test_mrp_repair_cancel.yml 2013-09-12 07:07:28 +0000
@@ -1,6 +1,9 @@
1-1-
2 In order to test the cancel flow of mrp_repair module,2 In order to test the cancel flow of mrp_repair module,
3 I start by creating new copy Repair order for "PC Assemble SC234" product.3 I start by creating new copy Repair order for "PC Assemble SC234" product with giving access rights of mrp user.
4-
5 !context
6 uid: 'res_mrp_repair_user'
4-7-
5 !python {model: mrp.repair}: |8 !python {model: mrp.repair}: |
6 copy_id = self.copy(cr, uid, ref("mrp_repair_rmrp1"))9 copy_id = self.copy(cr, uid, ref("mrp_repair_rmrp1"))
710
=== modified file 'mrp_repair/test/test_mrp_repair_noneinv.yml'
--- mrp_repair/test/test_mrp_repair_noneinv.yml 2013-03-21 13:18:24 +0000
+++ mrp_repair/test/test_mrp_repair_noneinv.yml 2013-09-12 07:07:28 +0000
@@ -1,5 +1,8 @@
1-1-
2 In order to test "mrp_repair" module, I start with confirm state, and start repair.2 In order to test "mrp_repair" module, I start with confirm state, and start repair with giving the access rights of mrp user.
3-
4 !context
5 uid: 'res_mrp_repair_user'
3-6-
4 I confirm Repair order for Invoice Method 'No Invoice'.7 I confirm Repair order for Invoice Method 'No Invoice'.
5-8-
69
=== modified file 'project/security/project_security.xml'
--- project/security/project_security.xml 2013-05-22 11:03:25 +0000
+++ project/security/project_security.xml 2013-09-12 07:07:28 +0000
@@ -4,6 +4,7 @@
44
5 <record id="group_project_user" model="res.groups">5 <record id="group_project_user" model="res.groups">
6 <field name="name">User</field>6 <field name="name">User</field>
7 <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>
7 <field name="category_id" ref="base.module_category_project_management"/>8 <field name="category_id" ref="base.module_category_project_management"/>
8 </record>9 </record>
910
1011
=== added directory 'project/test'
=== added file 'project/test/project_demo.yml.THIS'
--- project/test/project_demo.yml.THIS 1970-01-01 00:00:00 +0000
+++ project/test/project_demo.yml.THIS 2013-09-12 07:07:28 +0000
@@ -0,0 +1,23 @@
1-
2 I Update project and create the new task with project manager
3-
4 !context
5 uid: 'res_users_project_manager'
6-
7 Change partner for The Jackson Group's Project
8-
9 !record {model: project.project, id: project_project_1, view: False}:
10 partner_id: base.res_partner_2
11-
12 I create task for The Jackson Group's Project project user can create task.
13-
14 !context
15 uid: 'res_users_project_user'
16-
17 !record {model: project.task, id: project_task_for_project1}:
18 name: Worked on new specification
19 user_id: res_users_project_user
20 remaining_hours: 10.00
21 planned_hours: 10.00
22 project_id: project_project_1
23 stage_id: project_tt_specification
0\ No newline at end of file24\ No newline at end of file
125
=== added file 'project/test/project_process.yml.THIS'
--- project/test/project_process.yml.THIS 1970-01-01 00:00:00 +0000
+++ project/test/project_process.yml.THIS 2013-09-12 07:07:28 +0000
@@ -0,0 +1,75 @@
1-
2 Test the whole project process with project manager.
3-
4 !context
5 uid: 'res_users_project_manager'
6-
7 In order to Test Process of Project Management,
8-
9 I create duplicate template.
10-
11 !python {model: project.project}: |
12 new_template = self.duplicate_template(cr, uid, [ref("project_project_1")])
13 assert new_template, "duplicate template is not created"
14 template = self.browse(cr, uid, new_template['res_id'], context=context)
15 assert template.state == 'open', "Duplicate template must be in open state."
16-
17 I convert template into real Project.
18-
19 !python {model: project.project}: |
20 self.reset_project(cr, uid, [ref("project_project_1")])
21-
22 I check project details after convert from template.
23-
24 !assert {model: project.project, id: project_project_1, severity: error, string: Project should be active}:
25 - state == "open"
26-
27 I put project in pending.
28-
29 !python {model: project.project}: |
30 self.set_pending(cr, uid, [ref("project_project_1")])
31-
32 I check state after put in pending.
33-
34 !assert {model: project.project, id: project_project_1, severity: error, string: Project should be in pending state}:
35 - state == "pending"
36-
37 I re-open the project.
38-
39 !python {model: project.project}: |
40 self.set_open(cr, uid, [ref("project_project_1")])
41-
42 I check state after reopen.
43-
44 !assert {model: project.project, id: project_project_1, severity: error, string: Project should be open.}:
45 - state == "open"
46-
47 I close the project.
48-
49 !python {model: project.project}: |
50 self.set_done(cr, uid, [ref("project_project_1")])
51-
52 I check state after closed.
53-
54 !assert {model: project.project, id: project_project_1, severity: error, string: Project should be close.}:
55 - state == "close"
56-
57 I set project into template.
58-
59 !python {model: project.project}: |
60 self.set_template(cr, uid, [ref("project_project_1")])
61-
62 I schedule tasks of project.
63-
64 !python {model: project.project}: |
65 self.schedule_tasks(cr, uid, [ref("project_project_1")], context=context)
66-
67 I copy the tasks of project.
68-
69 !python {model: project.project}: |
70 self.copy(cr, uid, ref("project_project_1"))
71-
72 I cancel Project.
73-
74 !python {model: project.project}: |
75 self.set_cancel(cr, uid, [ref("project_project_2")])
076
=== added file 'project/test/task_process.yml.THIS'
--- project/test/task_process.yml.THIS 1970-01-01 00:00:00 +0000
+++ project/test/task_process.yml.THIS 2013-09-12 07:07:28 +0000
@@ -0,0 +1,81 @@
1-
2 Test the whole task process with project user.
3-
4 !context
5 uid: 'res_users_project_user'
6-
7 I put task in pending due to specification is not clear.
8-
9 !python {model: project.task}: |
10 self.do_pending(cr, uid, [ref("project_task_for_project1")])
11 context.update({"active_id": ref("project_task_for_project1")})
12-
13 I check state of task after put in pending.
14-
15 !assert {model: project.task, id: project_task_for_project1, severity: error, string: task should be in pending state}:
16 - state == "pending"
17-
18 !record {model: project.task.delegate, id: delegate_id}:
19 user_id: res_users_project_user
20 planned_hours: 12.0
21 planned_hours_me: 2.0
22-
23 Now I delegate task to team member.
24-
25 !python {model: project.task.delegate}: |
26 self.delegate(cr, uid, [ref("delegate_id")], {"active_id": ref("project_task_for_project1")})
27-
28 I check delegated task details.
29-
30 !python {model: project.task}: |
31 task = self.browse(cr, uid, ref("project_task_for_project1"), context=context)
32 assert task.planned_hours == 2.0, "Planning hours is not correct after delegated."
33 assert task.state == "pending", "Task should be in Pending after delegated."
34-
35 I re-open the task.
36-
37 !python {model: project.task}: |
38 self.do_reopen(cr, uid, [ref("project_task_for_project1")])
39-
40 I check reopened task details.
41-
42 !assert {model: project.task, id: project_task_for_project1, severity: error, string: task should be open.}:
43 - state == "open"
44-
45 I change the stage of task to next stage.
46-
47 !python {model: project.task}: |
48 self.stage_next(cr, uid, [ref("project_task_for_project1")])
49-
50 !record {model: project.task.reevaluate, id: reevaluate_id}:
51 remaining_hours : 120
52-
53 I reevaluate task with remaining hours.
54-
55 !python {model: project.task.reevaluate}: |
56 self.compute_hours(cr, uid, [ref("reevaluate_id")], {"active_id": ref("project_task_for_project1")})
57-
58 I check remaining hours after reevaluated task.
59-
60 !assert {model: project.task, id: project_task_for_project1, severity: error, string: task should be reevaluated}:
61 - remaining_hours == 120.0
62-
63 I close the task.
64-
65 !python {model: project.task}: |
66 self.action_close(cr, uid, [ref("project_task_for_project1")])
67-
68 I check state after closed.
69-
70 !assert {model: project.task, id: project_task_for_project1, severity: error, string: task is in open state}:
71 - state == "done"
72-
73 I change the stage of task to previous stage.
74-
75 !python {model: project.task}: |
76 self.stage_previous(cr, uid, [ref("project_task_for_project1")])
77-
78 I cancel Task.
79-
80 !python {model: project.task}: |
81 self.do_cancel(cr, uid, [ref("project_task_for_project1")])
082
=== modified file 'project_issue/__openerp__.py'
--- project_issue/__openerp__.py 2013-08-13 09:55:46 +0000
+++ project_issue/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -52,6 +52,7 @@
52 ],52 ],
53 'demo': ['project_issue_demo.xml'],53 'demo': ['project_issue_demo.xml'],
54 'test': [54 'test': [
55 'test/issue_users.yml',
55 'test/subscribe_issue.yml',56 'test/subscribe_issue.yml',
56 'test/issue_process.yml',57 'test/issue_process.yml',
57 'test/issue_demo.yml'58 'test/issue_demo.yml'
5859
=== added file 'project_issue/test/cancel_issue.yml.THIS'
--- project_issue/test/cancel_issue.yml.THIS 1970-01-01 00:00:00 +0000
+++ project_issue/test/cancel_issue.yml.THIS 2013-09-12 07:07:28 +0000
@@ -0,0 +1,65 @@
1-
2 Project user can cancelled issue, so let's check data with giving the access rights of user.
3-
4 !context
5 uid: 'res_users_project_issue_user'
6-
7 In order to test process of issue tracking in OpenERP, I cancel the unqualified Issue.
8-
9 !python {model: project.issue}: |
10 self.case_cancel(cr, uid, [ref("crm_case_buginaccountsmodule0")])
11-
12 I check the issue is in cancel state.
13-
14 !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in cancel state}:
15 - state == 'cancelled'
16-
17 I re-open the Issue.
18-
19 !python {model: project.issue}: |
20 self.case_open(cr, uid, [ref("crm_case_buginaccountsmodule0")])
21-
22 I check the state of issue after open it.
23-
24 !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in open state}:
25 - state == 'open'
26-
27 I put the issue in pending state.
28-
29 !python {model: project.issue}: |
30 self.case_pending(cr, uid, [ref("crm_case_buginaccountsmodule0")])
31-
32 I check the state of issue after put it in pending state.
33-
34 !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in pending state}:
35 - state == 'pending'
36-
37 I cancel the issue is in pending state.
38-
39 !python {model: project.issue}: |
40 self.case_cancel(cr, uid, [ref("crm_case_buginaccountsmodule0")])
41-
42 I check the issue is in cancel state.
43-
44 !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in cancel state}:
45 - state == 'cancelled'
46-
47 I close Issue.
48-
49 !python {model: project.issue}: |
50 self.case_close(cr, uid, [ref("crm_case_buginaccountsmodule0")])
51-
52 I check state of Issue after close.
53-
54 !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in done state}:
55 - state == 'done'
56-
57 I cancel the issue is in done state.
58-
59 !python {model: project.issue}: |
60 self.case_cancel(cr, uid, [ref("crm_case_buginaccountsmodule0")])
61-
62 I check the issue is in cancel state.
63-
64 !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in cancel state}:
65 - state == 'cancelled'
066
=== modified file 'project_issue/test/issue_demo.yml'
--- project_issue/test/issue_demo.yml 2012-11-29 22:26:45 +0000
+++ project_issue/test/issue_demo.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Test the whole create project issue with project manager.
3-
4 !context
5 uid: 'res_users_project_issue_manager'
6-
2 !record {model: project.issue, id: project_task_1, view: False}:7 !record {model: project.issue, id: project_task_1, view: False}:
3 task_id: 'project.project_task_17'8 task_id: 'project.project_task_17'
4 name: 'Error in account module'9 name: 'Error in account module'
@@ -6,3 +11,4 @@
6 !record {model: project.issue, id: project01, view: False}:11 !record {model: project.issue, id: project01, view: False}:
7 project_id: 'project.project_project_2'12 project_id: 'project.project_project_2'
8 name: 'OpenERP Integration'13 name: 'OpenERP Integration'
14
915
=== modified file 'project_issue/test/issue_process.yml'
--- project_issue/test/issue_process.yml 2013-06-27 11:07:33 +0000
+++ project_issue/test/issue_process.yml 2013-09-12 07:07:28 +0000
@@ -11,6 +11,11 @@
11 except Exception, e:11 except Exception, e:
12 pass12 pass
13-13-
14 Only project manager can create Task for Issue, so let's check data with giving the access rights of manager.
15-
16 !context
17 uid: 'res_users_project_issue_manager'
18-
14 I create Task for Issue.19 I create Task for Issue.
15-20-
16 !python {model: project.issue}: |21 !python {model: project.issue}: |
1722
=== added file 'project_issue/test/issue_users.yml'
--- project_issue/test/issue_users.yml 1970-01-01 00:00:00 +0000
+++ project_issue/test/issue_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,30 @@
1-
2 Create a user as 'Project manager'
3-
4 !record {model: res.users, id: res_users_project_issue_manager}:
5 company_id: base.main_company
6 name: Project Manager
7 login: prim
8 password: prim
9 email: issuemanager@yourcompany.com
10-
11 I added groups for Project manager.
12-
13 !record {model: res.users, id: res_users_project_issue_manager}:
14 groups_id:
15 - project.group_project_manager
16-
17 Create a user as 'Project user'
18-
19 !record {model: res.users, id: res_users_project_issue_user}:
20 company_id: base.main_company
21 name: Project User
22 login: priu
23 password: priu
24 email: issueuser@yourcompany.com
25-
26 I added groups for Project user.
27-
28 !record {model: res.users, id: res_users_project_issue_user}:
29 groups_id:
30 - project.group_project_user
0\ No newline at end of file31\ No newline at end of file
132
=== modified file 'project_issue/test/subscribe_issue.yml'
--- project_issue/test/subscribe_issue.yml 2013-04-17 06:40:51 +0000
+++ project_issue/test/subscribe_issue.yml 2013-09-12 07:07:28 +0000
@@ -1,5 +1,5 @@
1-1-
2 In Order to test process of Issue in OpenERP, Custmer send the issue by email.2 In Order to test process of Issue in OpenERP, Customer send the issue by email.
3-3-
4 !python {model: mail.thread}: |4 !python {model: mail.thread}: |
5 request_file = open(openerp.modules.module.get_module_resource('project_issue','test', 'issue.eml'),'rb')5 request_file = open(openerp.modules.module.get_module_resource('project_issue','test', 'issue.eml'),'rb')
66
=== modified file 'purchase/__openerp__.py'
--- purchase/__openerp__.py 2012-11-29 22:26:45 +0000
+++ purchase/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -67,6 +67,7 @@
67 'res_config_view.xml',67 'res_config_view.xml',
68 ],68 ],
69 'test': [69 'test': [
70 'test/ui/purchase_users.yml',
70 'test/process/cancel_order.yml',71 'test/process/cancel_order.yml',
71 'test/process/rfq2order2done.yml',72 'test/process/rfq2order2done.yml',
72 'test/process/generate_invoice_from_reception.yml',73 'test/process/generate_invoice_from_reception.yml',
7374
=== modified file 'purchase/purchase_order_demo.yml'
--- purchase/purchase_order_demo.yml 2012-11-29 22:26:45 +0000
+++ purchase/purchase_order_demo.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,6 @@
1-1-
2 Give access rights of Purchase user to create purchase order
3-
2 !record {model: purchase.order, id: purchase_order_1}:4 !record {model: purchase.order, id: purchase_order_1}:
3 partner_id: base.res_partner_15 partner_id: base.res_partner_1
4 invoice_method: order6 invoice_method: order
57
=== modified file 'purchase/test/process/cancel_order.yml'
--- purchase/test/process/cancel_order.yml 2012-12-06 10:06:12 +0000
+++ purchase/test/process/cancel_order.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Purchase user can also cancel order therfore test with that user which have Purchase user rights.
3-
4 !context
5 uid: 'res_users_purchase_user'
6-
2 In order to test the cancel flow, I start it from canceling confirmed purchase order.7 In order to test the cancel flow, I start it from canceling confirmed purchase order.
3-8-
4 I confirm the purchase order.9 I confirm the purchase order.
510
=== modified file 'purchase/test/process/generate_invoice_from_reception.yml'
--- purchase/test/process/generate_invoice_from_reception.yml 2012-11-29 22:26:45 +0000
+++ purchase/test/process/generate_invoice_from_reception.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Purchase user can create an invoice for order on receptions therfore test with that user which have Purchase user rights.
3-
4 !context
5 uid: 'res_users_purchase_user'
6-
2 I confirm another order where invoice control is 'Bases on incoming shipments'.7 I confirm another order where invoice control is 'Bases on incoming shipments'.
3-8-
4 !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_2}9 !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_2}
510
=== modified file 'purchase/test/process/invoice_on_poline.yml'
--- purchase/test/process/invoice_on_poline.yml 2012-11-29 22:26:45 +0000
+++ purchase/test/process/invoice_on_poline.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Purchase User confirm the order and create invoice based on purchase order line.
3-
4 !context
5 uid: 'res_users_purchase_user'
6-
2 I confirm purchase order which has invoicing control method "Based on Purchase Order Lines".7 I confirm purchase order which has invoicing control method "Based on Purchase Order Lines".
3-8-
4 !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_6}9 !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_6}
@@ -17,10 +22,4 @@
17 !python {model: purchase.order}: |22 !python {model: purchase.order}: |
18 purchase_order = self.browse(cr, uid, ref("purchase_order_6"))23 purchase_order = self.browse(cr, uid, ref("purchase_order_6"))
19 for purchase_line in purchase_order.order_line:24 for purchase_line in purchase_order.order_line:
20 assert len(purchase_order.invoice_ids) == 1, "Invoice should be generated."25 assert len(purchase_order.invoice_ids) == 1, "Invoice should be generated."
21-
22 I set the default invoicing control method "Based on Purchase Order Lines".
23-
24 !python {model: purchase.config.settings}: |
25 new_id = self.create(cr, uid, {'default_invoice_method': 'manual'})
26 self.execute(cr, uid, [new_id])
27\ No newline at end of file26\ No newline at end of file
2827
=== modified file 'purchase/test/process/merge_order.yml'
--- purchase/test/process/merge_order.yml 2013-02-18 08:01:09 +0000
+++ purchase/test/process/merge_order.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Give access rights of Purchase user to merge two RFQ.
3-
4 !context
5 uid: 'res_users_purchase_user'
6-
2 In order to merge RFQ, I merge two RFQ which has same supplier and check new merged order.7 In order to merge RFQ, I merge two RFQ which has same supplier and check new merged order.
3-8-
4 !python {model: purchase.order}: |9 !python {model: purchase.order}: |
510
=== modified file 'purchase/test/ui/delete_order.yml'
--- purchase/test/ui/delete_order.yml 2012-11-29 22:26:45 +0000
+++ purchase/test/ui/delete_order.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Give access rights of Purchase user to delete purchase order
3-
4 !context
5 uid: 'res_users_purchase_user'
6-
2 In order to test to delete process on purchase order.7 In order to test to delete process on purchase order.
3-8-
4 I try to delete confirmed order and check Error Message.9 I try to delete confirmed order and check Error Message.
510
=== added file 'purchase/test/ui/purchase_users.yml'
--- purchase/test/ui/purchase_users.yml 1970-01-01 00:00:00 +0000
+++ purchase/test/ui/purchase_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,30 @@
1-
2 Create a user as 'Purchase manager'
3-
4 !record {model: res.users, id: res_users_purchase_manager}:
5 company_id: base.main_company
6 name: Purchase Manager
7 login: pm
8 password: pm
9 email: purchasemanager@yourcompany.com
10-
11 I added groups for Purchase manager.
12-
13 !record {model: res.users, id: res_users_purchase_manager}:
14 groups_id:
15 - purchase.group_purchase_manager
16-
17 Create a user as 'Purchase user'
18-
19 !record {model: res.users, id: res_users_purchase_user}:
20 company_id: base.main_company
21 name: Purchase User
22 login: pu
23 password: pu
24 email: purchaseuser@yourcompany.com
25-
26 I added groups for Purchase user.
27-
28 !record {model: res.users, id: res_users_purchase_user}:
29 groups_id:
30 - purchase.group_purchase_user
031
=== modified file 'purchase_requisition/__openerp__.py'
--- purchase_requisition/__openerp__.py 2012-11-29 22:26:45 +0000
+++ purchase_requisition/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -43,6 +43,7 @@
43 ],43 ],
44 'auto_install': False,44 'auto_install': False,
45 'test': [45 'test': [
46 'test/purchase_requisition_users.yml',
46 'test/purchase_requisition_demo.yml',47 'test/purchase_requisition_demo.yml',
47 'test/purchase_requisition.yml',48 'test/purchase_requisition.yml',
48 'test/cancel_purchase_requisition.yml',49 'test/cancel_purchase_requisition.yml',
4950
=== modified file 'purchase_requisition/security/purchase_tender.xml'
--- purchase_requisition/security/purchase_tender.xml 2012-07-13 17:08:38 +0000
+++ purchase_requisition/security/purchase_tender.xml 2013-09-12 07:07:28 +0000
@@ -10,6 +10,7 @@
1010
11 <record id="group_purchase_requisition_user" model="res.groups">11 <record id="group_purchase_requisition_user" model="res.groups">
12 <field name="name">User</field>12 <field name="name">User</field>
13 <field name="implied_ids" eval="[(4, ref('purchase.group_purchase_user'))]"/>
13 <field name="category_id" ref="module_category_purchase_requisition"/>14 <field name="category_id" ref="module_category_purchase_requisition"/>
14 </record>15 </record>
1516
1617
=== modified file 'purchase_requisition/test/cancel_purchase_requisition.yml'
--- purchase_requisition/test/cancel_purchase_requisition.yml 2011-12-02 05:15:06 +0000
+++ purchase_requisition/test/cancel_purchase_requisition.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Give access rights of Purchase Requisition User to cancelled requisition
3-
4 !context
5 uid: 'res_users_purchase_requisition_user'
6-
2 I cancel requisition.7 I cancel requisition.
3-8-
4 !python {model: purchase.requisition}: |9 !python {model: purchase.requisition}: |
510
=== modified file 'purchase_requisition/test/purchase_requisition.yml'
--- purchase_requisition/test/purchase_requisition.yml 2013-03-22 13:49:58 +0000
+++ purchase_requisition/test/purchase_requisition.yml 2013-09-12 07:07:28 +0000
@@ -31,6 +31,11 @@
31 assert line.product_uom_id.id == procurement.product_uom.id, "UOM is not correspond."31 assert line.product_uom_id.id == procurement.product_uom.id, "UOM is not correspond."
32 assert line.product_qty == procurement.product_qty, "Quantity is not correspond."32 assert line.product_qty == procurement.product_qty, "Quantity is not correspond."
33-33-
34 Give access rights of Purchase Requisition User to open requisition
35-
36 !context
37 uid: 'res_users_purchase_requisition_user'
38-
34 I open another requisition.39 I open another requisition.
35-40-
36 !python {model: purchase.requisition}: |41 !python {model: purchase.requisition}: |
3742
=== modified file 'purchase_requisition/test/purchase_requisition_demo.yml'
--- purchase_requisition/test/purchase_requisition_demo.yml 2013-01-03 23:10:05 +0000
+++ purchase_requisition/test/purchase_requisition_demo.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Give access rights of Purchase Requisition User to create requisition
3-
4 !context
5 uid: 'res_users_purchase_requisition_user'
6-
2 In order to test process of the purchase requisition ,I create requisition7 In order to test process of the purchase requisition ,I create requisition
3- 8-
4 !record {model: purchase.requisition, id: requisition1}:9 !record {model: purchase.requisition, id: requisition1}:
510
=== added file 'purchase_requisition/test/purchase_requisition_users.yml'
--- purchase_requisition/test/purchase_requisition_users.yml 1970-01-01 00:00:00 +0000
+++ purchase_requisition/test/purchase_requisition_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,30 @@
1-
2 Create a user as 'Purchase Requisition Manager'
3-
4 !record {model: res.users, id: res_users_purchase_requisition_manager}:
5 company_id: base.main_company
6 name: Purchase requisition Manager
7 login: prm
8 password: prm
9 email: requisition_manager@yourcompany.com
10-
11 I added groups for Purchase Requisition Manager.
12-
13 !record {model: res.users, id: res_users_purchase_requisition_manager}:
14 groups_id:
15 - purchase_requisition.group_purchase_requisition_manager
16-
17 Create a user as 'Purchase Requisition User'
18-
19 !record {model: res.users, id: res_users_purchase_requisition_user}:
20 company_id: base.main_company
21 name: Purchase requisition User
22 login: pru
23 password: pru
24 email: requisition_user@yourcompany.com
25-
26 I added groups for Purchase Requisition User.
27-
28 !record {model: res.users, id: res_users_purchase_requisition_user}:
29 groups_id:
30 - purchase_requisition.group_purchase_requisition_user
0\ No newline at end of file31\ No newline at end of file
132
=== modified file 'resource/__openerp__.py'
--- resource/__openerp__.py 2012-12-21 16:48:08 +0000
+++ resource/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -38,6 +38,7 @@
38 'depends': ['process'],38 'depends': ['process'],
39 'data': [39 'data': [
40 'security/ir.model.access.csv',40 'security/ir.model.access.csv',
41 'security/resource_security.xml',
41 'resource_view.xml',42 'resource_view.xml',
42 ],43 ],
43 'demo': ['resource_demo.xml'],44 'demo': ['resource_demo.xml'],
4445
=== modified file 'resource/security/ir.model.access.csv'
--- resource/security/ir.model.access.csv 2011-12-19 16:54:40 +0000
+++ resource/security/ir.model.access.csv 2013-09-12 07:07:28 +0000
@@ -3,4 +3,5 @@
3access_resource_calendar_attendance,resource.calendar.attendance,model_resource_calendar_attendance,base.group_system,1,1,1,13access_resource_calendar_attendance,resource.calendar.attendance,model_resource_calendar_attendance,base.group_system,1,1,1,1
4access_resource_resource,resource.resource,model_resource_resource,base.group_system,1,0,0,04access_resource_resource,resource.resource,model_resource_resource,base.group_system,1,0,0,0
5access_resource_resource_all,resource.resource all,model_resource_resource,,1,0,0,05access_resource_resource_all,resource.resource all,model_resource_resource,,1,0,0,0
6access_resource_calendar_leaves_user,resource.calendar.leaves,model_resource_calendar_leaves,base.group_user,1,0,0,0
6access_resource_calendar_leaves,resource.calendar.leaves,model_resource_calendar_leaves,base.group_system,1,1,1,17access_resource_calendar_leaves,resource.calendar.leaves,model_resource_calendar_leaves,base.group_system,1,1,1,1
78
=== added file 'resource/security/resource_security.xml'
--- resource/security/resource_security.xml 1970-01-01 00:00:00 +0000
+++ resource/security/resource_security.xml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,16 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3<data noupdate="1">
4
5 <record model="ir.rule" id="resource_own_leaves">
6 <field name="name">Resource: see own leaves</field>
7 <field name="model_id" ref="model_resource_calendar_leaves"/>
8 <field name="groups" eval="[(4, ref('base.group_user'))]"/>
9 <field name="domain_force">['|',
10 ('resource_id', '=', False),
11 ('resource_id.user_id', '=', user.id),
12 ]</field>
13 </record>
14
15</data>
16</openerp>
017
=== modified file 'sale/__openerp__.py'
--- sale/__openerp__.py 2012-12-19 09:49:42 +0000
+++ sale/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -80,6 +80,7 @@
80 ],80 ],
81 'demo': ['sale_demo.xml'],81 'demo': ['sale_demo.xml'],
82 'test': [82 'test': [
83 'test/create_sale_users.yml',
83 'test/sale_order_demo.yml',84 'test/sale_order_demo.yml',
84 'test/manual_order_policy.yml',85 'test/manual_order_policy.yml',
85 'test/cancel_order.yml',86 'test/cancel_order.yml',
8687
=== modified file 'sale/test/cancel_order.yml'
--- sale/test/cancel_order.yml 2013-02-13 08:35:19 +0000
+++ sale/test/cancel_order.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Salesman can also cancel order therefore test with that user which have salesman rights,
3-
4 !context
5 uid: 'res_users_salesman'
6-
2 In order to test the cancel sale order.7 In order to test the cancel sale order.
3 I confirm order (with at least 2 lines)8 I confirm order (with at least 2 lines)
4-9-
510
=== added file 'sale/test/create_sale_users.yml'
--- sale/test/create_sale_users.yml 1970-01-01 00:00:00 +0000
+++ sale/test/create_sale_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,30 @@
1-
2 Create a user as 'Salesmanager'
3-
4 !record {model: res.users, id: res_users_salesmanager}:
5 company_id: base.main_company
6 name: Sales manager
7 login: sm
8 password: sm
9 email: salesmanager@yourcompany.com
10-
11 I added groups for Salesmanager.
12-
13 !record {model: res.users, id: res_users_salesmanager}:
14 groups_id:
15 - base.group_sale_manager
16-
17 Create a user as 'Salesman'
18-
19 !record {model: res.users, id: res_users_salesman}:
20 company_id: base.main_company
21 name: Salesman
22 login: su
23 password: su
24 email: salesman@yourcompany.com
25-
26 I added groups for Salesman.
27-
28 !record {model: res.users, id: res_users_salesman}:
29 groups_id:
30 - base.group_sale_salesman_all_leads
031
=== modified file 'sale/test/delete_order.yml'
--- sale/test/delete_order.yml 2012-11-29 22:26:45 +0000
+++ sale/test/delete_order.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Sales manager can only delete order therefore test with that user which have sales manager rights,
3-
4 !context
5 uid: 'res_users_salesmanager'
6-
2 I try to delete In progress order and check Error Message.7 I try to delete In progress order and check Error Message.
3-8-
4 !python {model: sale.order}: |9 !python {model: sale.order}: |
510
=== added file 'sale/test/sale_order_demo.yml'
--- sale/test/sale_order_demo.yml 1970-01-01 00:00:00 +0000
+++ sale/test/sale_order_demo.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,41 @@
1-
2 Test the data with salesman,
3-
4 !context
5 uid: 'res_users_salesman'
6-
7 In order to test process of the Sale Order, I create sale order
8-
9 !record {model: sale.order, id: sale_order_test1}:
10 partner_id: base.res_partner_2
11 note: Invoice after delivery
12 payment_term: account.account_payment_term
13 order_line:
14 - product_id: product.product_product_7
15 product_uom_qty: 8
16-
17 I verify that the onchange was correctly triggered
18-
19 !assert {model: sale.order, id: sale.sale_order_test1, string: The onchange function of product was not correctly triggered}:
20 - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor'
21 - order_line[0].price_unit == 1350.0
22 - order_line[0].product_uom_qty == 8
23 - order_line[0].product_uom.id == ref('product.product_uom_unit')
24
25-
26 I create another sale order
27-
28 !record {model: sale.order, id: sale_order_test2}:
29 partner_id: base.res_partner_2
30 order_line:
31 - product_id: product.product_product_7
32 product_uom_qty: 16
33 product_uom: product.product_uom_dozen
34-
35 I verify that the onchange was correctly triggered
36-
37 !assert {model: sale.order, id: sale.sale_order_test2, string: The onchange function of product was not correctly triggered}:
38 - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor'
39 - order_line[0].price_unit == 1350.0 * 12
40 - order_line[0].product_uom.id == ref('product.product_uom_dozen')
41 - order_line[0].product_uom_qty == 16
0\ No newline at end of file42\ No newline at end of file
143
=== removed file 'sale/test/sale_order_demo.yml'
--- sale/test/sale_order_demo.yml 2013-01-31 18:43:56 +0000
+++ sale/test/sale_order_demo.yml 1970-01-01 00:00:00 +0000
@@ -1,36 +0,0 @@
1-
2 In order to test process of the Sale Order, I create sale order
3-
4 !record {model: sale.order, id: sale_order_test1}:
5 partner_id: base.res_partner_2
6 note: Invoice after delivery
7 payment_term: account.account_payment_term
8 order_line:
9 - product_id: product.product_product_7
10 product_uom_qty: 8
11-
12 I verify that the onchange was correctly triggered
13-
14 !assert {model: sale.order, id: sale.sale_order_test1, string: The onchange function of product was not correctly triggered}:
15 - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor'
16 - order_line[0].price_unit == 1350.0
17 - order_line[0].product_uom_qty == 8
18 - order_line[0].product_uom.id == ref('product.product_uom_unit')
19
20-
21 I create another sale order
22-
23 !record {model: sale.order, id: sale_order_test2}:
24 partner_id: base.res_partner_2
25 order_line:
26 - product_id: product.product_product_7
27 product_uom_qty: 16
28 product_uom: product.product_uom_dozen
29-
30 I verify that the onchange was correctly triggered
31-
32 !assert {model: sale.order, id: sale.sale_order_test2, string: The onchange function of product was not correctly triggered}:
33 - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor'
34 - order_line[0].price_unit == 1350.0 * 12
35 - order_line[0].product_uom.id == ref('product.product_uom_dozen')
36 - order_line[0].product_uom_qty == 16
37\ No newline at end of file0\ No newline at end of file
381
=== modified file 'sale_stock/__openerp__.py'
--- sale_stock/__openerp__.py 2013-09-09 11:03:30 +0000
+++ sale_stock/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -58,7 +58,8 @@
58 'process/sale_stock_process.xml',58 'process/sale_stock_process.xml',
59 ],59 ],
60 'demo': ['sale_stock_demo.xml'],60 'demo': ['sale_stock_demo.xml'],
61 'test': ['test/cancel_order_sale_stock.yml',61 'test': ['test/sale_stock_users.yml',
62 'test/cancel_order_sale_stock.yml',
62 'test/picking_order_policy.yml',63 'test/picking_order_policy.yml',
63 'test/prepaid_order_policy.yml',64 'test/prepaid_order_policy.yml',
64 'test/sale_order_onchange.yml',65 'test/sale_order_onchange.yml',
6566
=== modified file 'sale_stock/test/cancel_order_sale_stock.yml'
--- sale_stock/test/cancel_order_sale_stock.yml 2013-06-03 12:18:52 +0000
+++ sale_stock/test/cancel_order_sale_stock.yml 2013-09-12 07:07:28 +0000
@@ -1,12 +1,16 @@
1-1-
2 In order to test the cancel sale order.2 In order to test the cancel sale order with that user which have salesman rights.
3 First I confirm order.3 First I confirm order.
4-4-
5 !context
6 uid: 'res_sale_stock_salesman'
7-
5 !workflow {model: sale.order, action: order_confirm, ref: sale.sale_order_8}8 !workflow {model: sale.order, action: order_confirm, ref: sale.sale_order_8}
6-9-
7 I send delivery in two shipments, so I am doing a partial delivery order.10 I send delivery in two shipments, so I am doing a partial delivery order.
8-11-
9 !python {model: stock.picking}: |12 !python {model: stock.picking}: |
13 context={}
10 delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))])14 delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))])
11 first_picking = self.browse(cr, uid, delivery_orders[-1], context=context)15 first_picking = self.browse(cr, uid, delivery_orders[-1], context=context)
12 if first_picking.force_assign(cr, uid, first_picking):16 if first_picking.force_assign(cr, uid, first_picking):
@@ -21,12 +25,22 @@
21 last_delivery_order_id = delivery_orders[-1]25 last_delivery_order_id = delivery_orders[-1]
22 self.pool.get('stock.picking').signal_button_cancel(cr, uid, [last_delivery_order_id])26 self.pool.get('stock.picking').signal_button_cancel(cr, uid, [last_delivery_order_id])
23-27-
28 Only Stock User can change data related warehouse therefore test with that user which have stcok user rights,
29-
30 !context
31 uid: 'res_stock_user'
32-
24 I run the scheduler.33 I run the scheduler.
25-34-
26 !python {model: procurement.order}: |35 !python {model: procurement.order}: |
2736
28 self.run_scheduler(cr, uid)37 self.run_scheduler(cr, uid)
29-38-
39 Salesman can also check order therefore test with that user which have salesman rights,
40-
41 !context
42 uid: 'res_sale_stock_salesman'
43-
30 I check order status in "Ship Exception".44 I check order status in "Ship Exception".
31-45-
32 !assert {model: sale.order, id: sale.sale_order_8, string: Sale order should be in shipping exception}:46 !assert {model: sale.order, id: sale.sale_order_8, string: Sale order should be in shipping exception}:
@@ -65,4 +79,4 @@
65 I check state of order in 'In Progress'.79 I check state of order in 'In Progress'.
66-80-
67 !assert {model: sale.order, id: sale.sale_order_8, string: Sale order should be In progress state}:81 !assert {model: sale.order, id: sale.sale_order_8, string: Sale order should be In progress state}:
68 - state == 'progress'
69\ No newline at end of file82\ No newline at end of file
83 - state == 'progress'
7084
=== modified file 'sale_stock/test/picking_order_policy.yml'
--- sale_stock/test/picking_order_policy.yml 2013-04-23 05:30:31 +0000
+++ sale_stock/test/picking_order_policy.yml 2013-09-12 07:07:28 +0000
@@ -1,5 +1,8 @@
1-1-
2 In order to test process of the Sale Order,2 In order to test process of the Sale Order with access rights of saleman,
3-
4 !context
5 uid: 'res_sale_stock_salesman'
3-6-
4 First I check the total amount of the Quotation before Approved.7 First I check the total amount of the Quotation before Approved.
5-8-
@@ -41,11 +44,21 @@
41 assert procurement.product_uom.id == order_line.product_uom.id, "UOM is not correspond."44 assert procurement.product_uom.id == order_line.product_uom.id, "UOM is not correspond."
42 assert procurement.procure_method == order_line.type, "Procurement method is not correspond."45 assert procurement.procure_method == order_line.type, "Procurement method is not correspond."
43-46-
47 Only stock user can change data related warehouse therefore test with that user which have stock user rights,
48-
49 !context
50 uid: 'res_stock_user'
51-
44 I run the scheduler.52 I run the scheduler.
45-53-
46 !python {model: procurement.order}: |54 !python {model: procurement.order}: |
47 self.run_scheduler(cr, uid)55 self.run_scheduler(cr, uid)
48-56-
57 Salesman can also check order therefore test with that user which have salesman rights,
58-
59 !context
60 uid: 'res_sale_stock_salesman'
61-
49 I check the details of delivery order after confirmed quotation.62 I check the details of delivery order after confirmed quotation.
50-63-
51 !python {model: sale.order}: |64 !python {model: sale.order}: |
@@ -137,6 +150,11 @@
137 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."150 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."
138 assert inv_line.price_subtotal == so_line.price_subtotal, "Price sub total is not correspond."151 assert inv_line.price_subtotal == so_line.price_subtotal, "Price sub total is not correspond."
139-152-
153 Only Stock manager can open the Invoice therefore test with that user which have stock manager rights,
154-
155 !context
156 uid: 'res_stock_manager'
157-
140 I open the Invoice.158 I open the Invoice.
141-159-
142 !python {model: sale.order}: |160 !python {model: sale.order}: |
@@ -158,6 +176,11 @@
158 ref('account.period_8'), journal_ids[0],176 ref('account.period_8'), journal_ids[0],
159 name='test')177 name='test')
160-178-
179 To test process of the Sale Order with access rights of saleman,
180-
181 !context
182 uid: 'res_sale_stock_salesman'
183-
161 I check the order after paid invoice.184 I check the order after paid invoice.
162-185-
163 !python {model: sale.order}: |186 !python {model: sale.order}: |
164187
=== modified file 'sale_stock/test/prepaid_order_policy.yml'
--- sale_stock/test/prepaid_order_policy.yml 2012-11-29 22:26:45 +0000
+++ sale_stock/test/prepaid_order_policy.yml 2013-09-12 07:07:28 +0000
@@ -1,5 +1,8 @@
1-1-
2 Now I confirm the Quotation with "Pay before delivery" policy.2 Now I confirm the Quotation with "Pay before delivery" policy with access rights of salesman.
3-
4 !context
5 uid: 'res_sale_stock_salesman'
3-6-
4 !workflow {model: sale.order, action: order_confirm, ref: sale.sale_order_4}7 !workflow {model: sale.order, action: order_confirm, ref: sale.sale_order_4}
5-8-
69
=== modified file 'sale_stock/test/sale_order_onchange.yml'
--- sale_stock/test/sale_order_onchange.yml 2012-10-01 16:19:54 +0000
+++ sale_stock/test/sale_order_onchange.yml 2013-09-12 07:07:28 +0000
@@ -1,4 +1,9 @@
1-1-
2 Only sales manager Creates product so let's check with access rights of salemanager.
3-
4 !context
5 uid: 'res_sale_stock_salesmanager'
6-
2 In order to test the onchange of the Sale Order, I create a product7 In order to test the onchange of the Sale Order, I create a product
3-8-
4 !record {model: product.product, id: product_onchange1}:9 !record {model: product.product, id: product_onchange1}:
@@ -6,6 +11,11 @@
6 list_price: 66.611 list_price: 66.6
7 procure_method: 'make_to_order'12 procure_method: 'make_to_order'
8-13-
14 In sale order to test process of onchange of Sale Order with access rights of saleman.
15-
16 !context
17 uid: 'res_sale_stock_salesman'
18-
9 Now i create a sale order that uses my new product19 Now i create a sale order that uses my new product
10-20-
11 !record {model: sale.order, id: sale_order_onchange1}:21 !record {model: sale.order, id: sale_order_onchange1}:
1222
=== added file 'sale_stock/test/sale_stock_users.yml'
--- sale_stock/test/sale_stock_users.yml 1970-01-01 00:00:00 +0000
+++ sale_stock/test/sale_stock_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,61 @@
1-
2 Create a user as 'Stock Salesmanager'
3-
4 !record {model: res.users, id: res_sale_stock_salesmanager}:
5 company_id: base.main_company
6 name: Stock Sales manager
7 login: ssm
8 password: ssm
9 email: ss_salesmanager@yourcompany.com
10-
11 I added groups for Salesmanager.
12-
13 !record {model: res.users, id: res_sale_stock_salesmanager}:
14 groups_id:
15 - base.group_sale_manager
16-
17 Create a user as 'Stock Salesman'
18-
19 !record {model: res.users, id: res_sale_stock_salesman}:
20 company_id: base.main_company
21 name: Stock Salesman
22 login: ssu
23 password: ssu
24 email: ss_salesman@yourcompany.com
25-
26 I added groups for Stock Salesman.
27-
28 !record {model: res.users, id: res_sale_stock_salesman}:
29 groups_id:
30 - base.group_sale_salesman_all_leads
31-
32 Create a user as 'Stock User'
33-
34 !record {model: res.users, id: res_stock_user}:
35 company_id: base.main_company
36 name: Stock User
37 login: sau
38 password: sau
39 email: stock_user@yourcompany.com
40-
41 I added groups for Stock User.
42-
43 !record {model: res.users, id: res_stock_user}:
44 groups_id:
45 - stock.group_stock_user
46-
47 Create a user as 'Stock Manager'
48-
49 !record {model: res.users, id: res_stock_manager}:
50 company_id: base.main_company
51 name: Stock Manager
52 login: sam
53 password: sam
54 email: admin@portal.example.com
55 email: stock_manager@yourcompany.com
56-
57 I added groups for Stock Manager.
58-
59 !record {model: res.users, id: res_stock_manager}:
60 groups_id:
61 - stock.group_stock_manager
062
=== modified file 'stock/__openerp__.py'
--- stock/__openerp__.py 2013-08-23 11:58:51 +0000
+++ stock/__openerp__.py 2013-09-12 07:07:28 +0000
@@ -59,7 +59,6 @@
59 'sequence': 16,59 'sequence': 16,
60 'demo': [60 'demo': [
61 'stock_demo.xml',61 'stock_demo.xml',
62# 'stock_demo.yml',
63 ],62 ],
64 'data': [63 'data': [
65 'security/stock_security.xml',64 'security/stock_security.xml',
@@ -91,9 +90,11 @@
91 'res_config_view.xml',90 'res_config_view.xml',
92 ],91 ],
93 'test': [92 'test': [
94# 'test/opening_stock.yml',93 'test/stock_users.yml',
95# 'test/shipment.yml',94 'stock_demo.yml',
96# 'test/stock_report.yml',95 'test/opening_stock.yml',
96 'test/shipment.yml',
97 'test/stock_report.yml',
97 ],98 ],
98 'installable': True,99 'installable': True,
99 'application': True,100 'application': True,
100101
=== modified file 'stock/security/stock_security.xml'
--- stock/security/stock_security.xml 2013-04-05 11:16:49 +0000
+++ stock/security/stock_security.xml 2013-09-12 07:07:28 +0000
@@ -10,7 +10,7 @@
10 <record id="group_stock_manager" model="res.groups">10 <record id="group_stock_manager" model="res.groups">
11 <field name="name">Manager</field>11 <field name="name">Manager</field>
12 <field name="category_id" ref="base.module_category_warehouse_management"/>12 <field name="category_id" ref="base.module_category_warehouse_management"/>
13 <field name="implied_ids" eval="[(4, ref('group_stock_user'))]"/>13 <field name="implied_ids" eval="[(4, ref('group_stock_user')), (4, ref('account.group_account_user'))]"/>
14 <field name="users" eval="[(4, ref('base.user_root'))]"/>14 <field name="users" eval="[(4, ref('base.user_root'))]"/>
15 </record>15 </record>
1616
1717
=== modified file 'stock/stock_demo.yml'
--- stock/stock_demo.yml 2012-11-29 22:26:45 +0000
+++ stock/stock_demo.yml 2013-09-12 07:07:28 +0000
@@ -1,99 +1,107 @@
1-1-
2 !record {model: stock.location, id: location_refrigerator}:2 Only stock manager can create location,warehouse and product, so let's check data with giving the access rights of manager
3 name: Refrigerator3-
4 usage: internal4 !context
5-5 uid: 'res_users_stock_manager'
6 !record {model: stock.location, id: location_delivery_counter}:6-
7 name: Delivery Counter7 !record {model: stock.location, id: location_monitor}:
8 usage: internal8 name: chicago shop
9-9 usage: internal
10 !record {model: stock.location, id: location_refrigerator_small}:10-
11 name: Small Refrigerator11 !record {model: stock.location, id: stock_location_output}:
12 usage: internal12 name: Output
13 location_id: location_refrigerator13 usage: internal
14-
15 !record {model: stock.location, id: location_monitor_small}:
16 name: Small chicago shop
17 usage: internal
18 location_id: location_monitor
14-19-
15 !record {model: stock.location, id: location_opening}:20 !record {model: stock.location, id: location_opening}:
16 name: opening21 name: opening
17 usage: inventory22 usage: inventory
18-23-
19 !record {model: stock.location, id: location_convenience_shop}:24 !record {model: stock.location, id: stock_location_3}:
20 name: Convenient Store25 name: IT Suppliers
21 usage: supplier26 usage: supplier
22-27-
23 !record {model: stock.warehouse, id: warehouse_icecream}:28 !record {model: stock.warehouse, id: stock_warehouse_shop0}:
24 name: Ice Cream Shop29 name: Chicago Warehouse
25 lot_input_id: location_refrigerator30 lot_input_id: location_monitor
26 lot_stock_id: location_refrigerator31 lot_stock_id: location_monitor
27 lot_output_id: location_delivery_counter32 lot_output_id: stock_location_output
28-33-
29 !record {model: product.product, id: product_icecream}:34 !record {model: product.product, id: product_product_6}:
30 default_code: 00135 default_code: LCD15
31 name: Ice Cream36 name: 15” LCD Monitor
32 type: product37 type: consu
33 categ_id: product.product_category_138 categ_id: product.product_category_8
34 list_price: 100.039 list_price: 1200.0
35 standard_price: 70.040 standard_price: 800.0
36 uom_id: product.product_uom_kgm41 uom_id: product.product_uom_unit
37 uom_po_id: product.product_uom_kgm42 uom_po_id: product.product_uom_unit
38 procure_method: make_to_stock
39 property_stock_inventory: location_opening43 property_stock_inventory: location_opening
40 valuation: real_time44 valuation: real_time
41 cost_method: average45 cost_method: average
42 property_stock_account_input: account.o_expense46 property_stock_account_input: account.conf_o_income
43 property_stock_account_output: account.o_income47 property_stock_account_output: account.a_expense
44 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.48-
4549 Stock user can handled production lot,inventory and picking, so let's check data with giving the access rights of user
46-50-
47 !record {model: stock.production.lot, id: lot_icecream_0}:51 !context
48 name: Lot0 for Ice cream52 uid: 'res_users_stock_user'
49 product_id: product_icecream53-
50-54 !record {model: stock.production.lot, id: lot_monitor_0}:
51 !record {model: stock.production.lot, id: lot_icecream_1}:55 name: Lot0 for LCD Monitor
52 name: Lot1 for Ice cream56 product_id: product_product_6
53 product_id: product_icecream57-
54-58 !record {model: stock.production.lot, id: lot_monitor_1}:
55 !record {model: stock.inventory, id: stock_inventory_icecream}:59 name: Lot1 for LCD Monitor
56 name: Inventory for icecream60 product_id: product_product_6
57-61-
58 !record {model: stock.inventory.line, id: stock_inventory_line_icecream_lot0}:62 !record {model: stock.inventory, id: stock_inventory_0}:
59 product_id: product_icecream63 name: Starting Inventory
60 product_uom: product.product_uom_kgm64 state: draft
61 inventory_id: stock_inventory_icecream65-
66 !record {model: stock.inventory.line, id: stock_inventory_line_3}:
67 product_id: product_product_6
68 product_uom: product.product_uom_unit
69 inventory_id: stock_inventory_0
62 product_qty: 50.070 product_qty: 50.0
63 prod_lot_id: lot_icecream_071 prod_lot_id: lot_monitor_0
64 location_id: location_refrigerator72 location_id: location_monitor
65-73-
66 !record {model: stock.inventory.line, id: stock_inventory_line_icecream_lot1}:74 !record {model: stock.inventory.line, id: stock_inventory_line_monitor}:
67 product_id: product_icecream75 product_id: product_product_6
68 product_uom: product.product_uom_kgm76 product_uom: product.product_uom_unit
69 inventory_id: stock_inventory_icecream77 inventory_id: stock_inventory_0
70 product_qty: 40.078 product_qty: 40.0
71 prod_lot_id: lot_icecream_179 prod_lot_id: lot_monitor_1
72 location_id: location_refrigerator80 location_id: location_monitor
7381
74-82-
75 !record {model: stock.picking, id: outgoing_shipment}:83 !record {model: stock.picking, id: outgoing_shipment}:
76 type: out84 type: out
77 location_dest_id: location_delivery_counter85 location_dest_id: stock_location_output
78-86-
79 !record {model: stock.move, id: outgoing_shipment_icecream}:87 !record {model: stock.move, id: outgoing_shipment_monitor}:
80 picking_id: outgoing_shipment88 picking_id: outgoing_shipment
81 product_id: product_icecream89 product_id: product_product_6
82 product_uom: product.product_uom_kgm90 product_uom: product.product_uom_unit
83 product_qty: 130.091 product_qty: 130.0
84 location_id: location_refrigerator92 location_id: location_monitor
85 location_dest_id: location_delivery_counter93 location_dest_id: stock_location_output
86-94-
87 !record {model: stock.picking, id: incomming_shipment}:95 !record {model: stock.picking, id: incomming_shipment}:
88 type: in96 type: in
89 invoice_state: 2binvoiced97 invoice_state: 2binvoiced
90 partner_id: base.res_partner_address_998 partner_id: base.res_partner_address_9
91 location_dest_id: location_refrigerator99 location_dest_id: location_monitor
92-100-
93 !record {model: stock.move, id: incomming_shipment_icecream}:101 !record {model: stock.move, id: incomming_shipment_monitor}:
94 picking_id: incomming_shipment102 picking_id: incomming_shipment
95 product_id: product_icecream103 product_id: product_product_6
96 product_uom: product.product_uom_kgm104 product_uom: product.product_uom_unit
97 product_qty: 50.0105 product_qty: 50.0
98 location_id: location_convenience_shop106 location_id: stock_location_3
99 location_dest_id: location_refrigerator107 location_dest_id: location_monitor
100108
=== modified file 'stock/test/opening_stock.yml'
--- stock/test/opening_stock.yml 2012-07-27 01:52:02 +0000
+++ stock/test/opening_stock.yml 2013-09-12 07:07:28 +0000
@@ -1,67 +1,87 @@
1-1-
2 I update the price of the Ice-cream.2 Only stock manager can change the price and update stock of products, so let's check data with giving the access rights of manager
3-
4 !context
5 uid: 'res_users_stock_manager'
6-
7 I update the price of the 15” LCD Monitor.
3-8-
4 !python {model: stock.change.standard.price}: |9 !python {model: stock.change.standard.price}: |
5 context.update({'active_model':'product.product', 'active_id': ref('product_icecream'), 'active_ids':[ref('product_icecream')]})10 context.update({'active_model':'product.product', 'active_id': ref('product_product_6'), 'active_ids':[ref('product_product_6')]})
6-11-
7 !record {model: stock.change.standard.price, id: change_price}:12 !record {model: stock.change.standard.price, id: change_price}:
8 new_price: 12013 new_price: 1500
9-14-
10 !python {model: stock.change.standard.price}: |15 !python {model: stock.change.standard.price}: |
11 self.change_price(cr, uid, [ref('change_price')], context=context)16 self.change_price(cr, uid, [ref('change_price')], context=context)
12-17-
13 I check price of Ice-cream after update price.18 I check price of 15” LCD Monitor after update price.
14-19-
15 !python {model: product.product}: |20 !python {model: product.product}: |
16 product = self.browse(cr, uid, ref('product_icecream'), context=context)21 product = self.browse(cr, uid, ref('product_product_6'), context=context)
17 assert product.standard_price == 120, "Price is not updated."22 assert product.standard_price == 1500, "Price is not updated."
18-23-
19 I update the current stock of the Ice-cream with 10 kgm in Small Refrigerator in lot0.24 I update the current stock of the 15” LCD Monitor with 10 unit in stock location shop1 in lot0.
20-25-
21 !record {model: stock.change.product.qty, id: change_qty}:26 !record {model: stock.change.product.qty, id: change_qty}:
22 location_id: location_refrigerator_small27 location_id: location_monitor_small
23 new_quantity: 1028 new_quantity: 10
24 product_id: product_icecream29 product_id: product_product_6
25 prodlot_id: lot_icecream_130 prodlot_id: lot_monitor_1
26-31-
27 !python {model: stock.change.product.qty}: |32 !python {model: stock.change.product.qty}: |
28 self.change_product_qty(cr, uid, [ref('change_qty')], context=context)33 self.change_product_qty(cr, uid, [ref('change_qty')], context=context)
29-34-
30 I check available stock of Ice-cream after update stock.35 I check available stock of 15” LCD Monitor after update stock.
31-36-
32 !python {model: product.product}: |37 !python {model: product.product}: |
33 product = self.browse(cr, uid, ref('product_icecream'), context=context)38 product = self.browse(cr, uid, ref('product_product_6'), context=context)
34 assert product.qty_available == 10, "Stock is not updated."39 assert product.qty_available == 10, "Stock is not updated."
35-40-
41 Stock user can merge inventory, so let's check data with giving the access rights of user.
42-
43 !context
44 uid: 'res_users_stock_user'
45-
36 I merge inventory.46 I merge inventory.
37-47-
38 !python {model: stock.inventory.merge }: |48 !python {model: stock.inventory.merge }: |
39 context.update({'active_model': 'stock.inventory', 'active_id': ref('stock_inventory_icecream'), 'active_ids': [ref('stock_inventory_icecream')]})49 context.update({'active_model': 'stock.inventory', 'active_id': ref('stock_inventory_0'), 'active_ids': [ref('stock_inventory_0')]})
40-50-
41 !record {model: stock.inventory.merge, id: merge_inventory}:51 !record {model: stock.inventory.merge, id: merge_inventory}:
42-52-
43 !python {model: stock.inventory.merge }: |53 !python {model: stock.inventory.merge }: |
44 self.do_merge(cr, uid, [ref('merge_inventory')], context=context)54 self.do_merge(cr, uid, [ref('merge_inventory')], context=context)
45-55-
56 Only stock manager cancelled inventory, so let's check data with giving the access rights of manager
57-
58 !context
59 uid: 'res_users_stock_manager'
60-
46 I cancel inventory.61 I cancel inventory.
47-62-
48 !python {model: stock.inventory}: |63 !python {model: stock.inventory}: |
49 self.action_cancel_inventory(cr, uid, [ref('stock_inventory_icecream')])64 self.action_cancel_inventory(cr, uid, [ref('stock_inventory_0')])
65-
66 stock user can reset inventory, so let's check data with giving the access rights of user
67-
68 !context
69 uid: 'res_users_stock_user'
50-70-
51 I reset to draft inventory.71 I reset to draft inventory.
52-72-
53 !python {model: stock.inventory}: |73 !python {model: stock.inventory}: |
54 self.action_cancel_draft(cr, uid, [ref('stock_inventory_icecream')])74 self.action_cancel_draft(cr, uid, [ref('stock_inventory_0')])
55-75-
56 I confirm physical inventory of Ice-cream which are came in different lots.76 I confirm physical inventory of 15” LCD Monitor which are came in different lots.
57-77-
58 !python {model: stock.inventory}: |78 !python {model: stock.inventory}: |
59 self.action_confirm(cr, uid, [ref('stock_inventory_icecream')], context=context)79 self.action_confirm(cr, uid, [ref('stock_inventory_0')], context=context)
60-80-
61 I check move details after confirmed physical inventory.81 I check move details after confirmed physical inventory.
62-82-
63 !python {model: stock.inventory}: |83 !python {model: stock.inventory}: |
64 inventory = self.browse(cr, uid, ref('stock_inventory_icecream'), context=context)84 inventory = self.browse(cr, uid, ref('stock_inventory_0'), context=context)
65 assert len(inventory.move_ids) == len(inventory.inventory_line_id), "moves are not correspond."85 assert len(inventory.move_ids) == len(inventory.inventory_line_id), "moves are not correspond."
66 for move_line in inventory.move_ids:86 for move_line in inventory.move_ids:
67 for line in inventory.inventory_line_id:87 for line in inventory.inventory_line_id:
@@ -77,15 +97,15 @@
77 I split inventory line.97 I split inventory line.
78-98-
79 !python {model: stock.inventory.line.split}: |99 !python {model: stock.inventory.line.split}: |
80 context.update({'active_model': 'stock.inventory.line', 'active_id': ref('stock_inventory_line_icecream_lot0'), 'active_ids': [ref('stock_inventory_line_icecream_lot0')]})100 context.update({'active_model': 'stock.inventory.line', 'active_id': ref('stock_inventory_line_3'), 'active_ids': [ref('stock_inventory_line_3')]})
81-101-
82 !record {model: stock.inventory.line.split, id: split_inventory_lot0}:102 !record {model: stock.inventory.line.split, id: split_inventory_lot0}:
83 use_exist: True103 use_exist: True
84 line_exist_ids:104 line_exist_ids:
85 - quantity: 6105 - quantity: 6
86 prodlot_id: lot_icecream_0106 prodlot_id: lot_monitor_0
87 - quantity: 4107 - quantity: 4
88 prodlot_id: lot_icecream_0108 prodlot_id: lot_monitor_0
89-109-
90 !python {model: stock.inventory.line.split }: |110 !python {model: stock.inventory.line.split }: |
91 self.split_lot(cr, uid, [ref('split_inventory_lot0')], context=context)111 self.split_lot(cr, uid, [ref('split_inventory_lot0')], context=context)
@@ -93,39 +113,49 @@
93 I fill inventory line.113 I fill inventory line.
94-114-
95 !python {model: stock.fill.inventory}: |115 !python {model: stock.fill.inventory}: |
96 context.update({'active_model': 'stock.inventory', 'active_id': ref('stock_inventory_icecream'), 'active_ids': [ref('stock_inventory_icecream')]})116 context.update({'active_model': 'stock.inventory', 'active_id': ref('stock_inventory_0'), 'active_ids': [ref('stock_inventory_0')]})
97-117-
98 !record {model: stock.fill.inventory, id: fill_inventory}:118 !record {model: stock.fill.inventory, id: fill_inventory}:
99 location_id: location_refrigerator119 location_id: location_monitor
100 recursive: True120 recursive: True
101-121-
102 !python {model: stock.fill.inventory }: |122 !python {model: stock.fill.inventory }: |
103 self.fill_inventory(cr, uid, [ref('fill_inventory')], context=context)123 self.fill_inventory(cr, uid, [ref('fill_inventory')], context=context)
104124
105-125-
106 Now I check vitual stock of Ice-cream after confirmed physical inventory.126 Now I check vitual stock of 15” LCD Monitor after confirmed physical inventory.
107-127-
108 !python {model: product.product}: |128 !python {model: product.product}: |
109 product = self.browse(cr, uid, ref('product_icecream'), context=context)129 product = self.browse(cr, uid, ref('product_product_6'), context=context)
110 assert product.virtual_available == 100, "Vitual stock is not updated."130 assert product.virtual_available == 100, "Vitual stock is not updated."
111-131-
112 I close physical inventory of Ice-cream.132 Only stock manager can close physical inventory, so let's check data with giving the access rights of manager
113-133-
114 !python {model: stock.inventory}: |134 !context
115 self.action_done(cr, uid, [ref('stock_inventory_icecream')], context=context)135 uid: 'res_users_stock_manager'
116-136-
117 I check closed move and real stock of Ice-cream after closed physical inventory.137 I close physical inventory of 15” LCD Monitor.
118-138-
119 !python {model: stock.inventory}: |139 !python {model: stock.inventory}: |
120 inventory = self.browse(cr, uid, ref('stock_inventory_icecream'), context=context)140 self.action_done(cr, uid, [ref('stock_inventory_0')], context=context)
141-
142 Stock user can check closed move and real stock, so let's check data with giving the access rights of user
143-
144 !context
145 uid: 'res_users_stock_user'
146-
147 I check closed move and real stock of 15” LCD Monitor after closed physical inventory.
148-
149 !python {model: stock.inventory}: |
150 inventory = self.browse(cr, uid, ref('stock_inventory_0'), context=context)
121 assert inventory.state == 'done', "inventory is not closed."151 assert inventory.state == 'done', "inventory is not closed."
122 for move_line in inventory.move_ids:152 for move_line in inventory.move_ids:
123 assert move_line.state == 'done', "Move is not closed."153 assert move_line.state == 'done', "Move is not closed."
124 product = self.pool.get('product.product').browse(cr, uid, ref('product_icecream'), context=context)154 product = self.pool.get('product.product').browse(cr, uid, ref('product_product_6'), context=context)
125 product.qty_available == 100, "Real stock is not updated."155 product.qty_available == 100, "Real stock is not updated."
126-156-
127 I check stock in lot.157 I check stock in lot.
128-158-
129 !python {model: stock.production.lot}: |159 !python {model: stock.production.lot}: |
130 lot = self.browse(cr, uid, ref('lot_icecream_0'), context=context)160 lot = self.browse(cr, uid, ref('lot_monitor_0'), context=context)
131 assert lot.stock_available == 50, "Stock in lot is not correspond."161 assert lot.stock_available == 50, "Stock in lot is not correspond."
132162
=== modified file 'stock/test/shipment.yml'
--- stock/test/shipment.yml 2012-05-08 21:22:45 +0000
+++ stock/test/shipment.yml 2013-09-12 07:07:28 +0000
@@ -1,9 +1,14 @@
1-1-
2 I confirm outgoing shipment of 130 kgm Ice-cream.2 Stock manager can only test whole process related to Shipment, so let's check data with stock manager.
3-
4 !context
5 uid: 'res_users_stock_manager'
6-
7 I confirm outgoing shipment of 130 Unit 15” LCD Monitor.
3-8-
4 !workflow {model: stock.picking, action: button_confirm, ref: outgoing_shipment}9 !workflow {model: stock.picking, action: button_confirm, ref: outgoing_shipment}
5-10-
6 I check shipment details after confirmed.11 I check shipment details after confirmation.
7-12-
8 !python {model: stock.picking}: |13 !python {model: stock.picking}: |
9 shipment = self.browse(cr, uid, ref("outgoing_shipment"))14 shipment = self.browse(cr, uid, ref("outgoing_shipment"))
@@ -12,147 +17,151 @@
12 assert move_line.state == "confirmed", "Move should be confirmed."17 assert move_line.state == "confirmed", "Move should be confirmed."
1318
14-19-
15 Now I check vitual stock of Ice-cream after confirmed outgoing shipment.20 Now, I check virtual stock of 15” LCD Monitor after confirming outgoing shipment.
16-21-
17 !python {model: product.product}: |22 !python {model: product.product}: |
18 product = self.browse(cr, uid, ref('product_icecream'), context=context)23 product = self.browse(cr, uid, ref('product_product_6'), context=context)
19 product.virtual_available == -30, "Vitual stock is not updated."24 assert product.virtual_available == -30, "Virtual stock is not updated."
2025
21-26-
22 I confirm incomming shipment of 50 kgm Ice-cream.27 I confirm incoming shipment of 50 Unit 15” LCD Monitor.
23-28-
24 !workflow {model: stock.picking, action: button_confirm, ref: incomming_shipment}29 !workflow {model: stock.picking, action: button_confirm, ref: incomming_shipment}
25-30-
26 I receive 40kgm Ice-cream so I make backorder of incomming shipment for 40 kgm.31 I split incoming shipment into lots. each lot contain 10 Unit 15” LCD Monitor.
32-
33 !python {model: stock.picking}: |
34 shipment = self.browse(cr, uid, ref("incomming_shipment"))
35 move_ids = [x.id for x in shipment.move_lines]
36 context.update({'active_model': 'stock.move', 'active_id': move_ids[0], 'active_ids': move_ids})
37-
38 !record {model: stock.move.split, id: split_lot_incoming}:
39 line_ids:
40 - name: incoming_lot0
41 quantity: 10
42 - name: incoming_lot1
43 quantity: 10
44 - name: incoming_lot2
45 quantity: 10
46 - name: incoming_lot3
47 quantity: 10
48-
49 !python {model: stock.move.split }: |
50 self.split_lot(cr, uid, [ref('split_lot_incoming')], context=context)
51-
52 I check move lines after splitting.
53-
54 !python {model: stock.move}: |
55 mm = self.browse(cr, uid, ref("incomming_shipment_monitor"))
56 lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incoming'), context=context)
57 lot_ids = self.pool.get('stock.production.lot').search(cr, uid, [('name','in',[x.name for x in lot.line_ids])])
58 assert len(lot_ids) == 4, 'lots of incoming shipment are not correspond.'
59 move_ids = self.search(cr, uid, [('location_dest_id','=',ref('location_monitor')),('prodlot_id','in',lot_ids)])
60 assert len(move_ids) == 4, 'move lines are not correspond per production lot after splitting.'
61 for move in self.browse(cr, uid, move_ids, context=context):
62 assert move.prodlot_id.name in ['incoming_lot0', 'incoming_lot1', 'incoming_lot2', 'incoming_lot3'], "lot does not correspond."
63 assert move.product_qty == 10, "qty does not correspond per production lot."
64-
65 I receive 40 units of 15” LCD Monitor.
27-66-
28 !python {model: stock.partial.picking}: |67 !python {model: stock.partial.picking}: |
29 context.update({'active_model': 'stock.picking', 'active_id': ref('incomming_shipment'), 'active_ids': [ref('incomming_shipment')]})68 context.update({'active_model': 'stock.picking', 'active_id': ref('incomming_shipment'), 'active_ids': [ref('incomming_shipment')]})
30-69-
31 !record {model: stock.partial.picking, id: partial_incomming}:70 !python {model: stock.partial.picking}: |
32 move_ids:71 partial = []
33 - quantity: 4072 for move in self.pool.get('stock.picking').browse(cr, uid, ref("incomming_shipment")).move_lines:
34 product_id: product_icecream73 if move.prodlot_id:
35 product_uom: product.product_uom_kgm74 partial.append((0, 0, {
36 move_id: incomming_shipment_icecream75 'quantity': move.product_qty,
37 location_id: location_convenience_shop76 'product_id': move.product_id.id,
38 location_dest_id: location_refrigerator77 'product_uom': move.product_uom.id,
39-78 'move_id': move.id,
40 !python {model: stock.partial.picking }: |79 'location_id': move.location_id.id,
41 self.do_partial(cr, uid, [ref('partial_incomming')], context=context)80 'location_dest_id': move.location_dest_id.id,
42-81 'prodlot_id': move.prodlot_id.id,
43 I check backorder shipment after received partial shipment.82 'cost': move.product_id.standard_price
83 }))
84 partial_id = self.create(cr, uid, {'move_ids': partial}, context=context)
85 self.do_partial(cr, uid, [partial_id], context=context)
86-
87 I check backorder shipment after receiving partial shipment.
44-88-
45 !python {model: stock.picking}: |89 !python {model: stock.picking}: |
46 shipment = self.browse(cr, uid, ref("incomming_shipment"))90 shipment = self.browse(cr, uid, ref("incomming_shipment"))
47 backorder = shipment.backorder_id91 backorder = shipment.backorder_id
48 assert backorder, "Backorder should be created after partial shipment."92 assert backorder, "Backorder should be created after partial shipment."
49 assert backorder.state == 'done', "Backorder should be close after received."93 assert backorder.state == 'done', "Backorder should be closed after received."
94 qty = 0
50 for move_line in backorder.move_lines:95 for move_line in backorder.move_lines:
51 assert move_line.product_qty == 40, "Qty in backorder does not correspond."
52 assert move_line.state == 'done', "Move line of backorder should be closed."96 assert move_line.state == 'done', "Move line of backorder should be closed."
53-97 qty += move_line.product_qty
54 I receive another 10kgm Ice-cream.98 assert qty == 40, "Qty in backorder does not correspond."
55-99-
56 !record {model: stock.partial.picking, id: partial_incomming}:100 I receive another 10 units of 15” LCD Monitor.
101-
102 !record {model: stock.partial.picking, id: partial_incoming}:
57 move_ids:103 move_ids:
58 - quantity: 10104 - quantity: 10
59 product_id: product_icecream105 product_id: product_product_6
60 product_uom: product.product_uom_kgm106 product_uom: product.product_uom_unit
61 move_id: incomming_shipment_icecream107 move_id: incomming_shipment_monitor
62 location_id: location_convenience_shop108 location_id: stock_location_3
63 location_dest_id: location_refrigerator109 location_dest_id: location_monitor
64-110-
65 !python {model: stock.partial.picking }: |111 !python {model: stock.partial.picking }: |
66 self.do_partial(cr, uid, [ref('partial_incomming')], context=context)112 self.do_partial(cr, uid, [ref('partial_incoming')], context=context)
67
68-113-
69 I check incomming shipment after received.114 I check incoming shipment after receiving it.
70-115-
71 !python {model: stock.picking}: |116 !python {model: stock.picking}: |
72 shipment = self.browse(cr, uid, ref("incomming_shipment"))117 shipment = self.browse(cr, uid, ref("incomming_shipment"))
73 assert shipment.state == 'done', "shipment should be close after received."118 assert shipment.state == 'done', "shipment should be closed after receiving."
74 for move_line in shipment.move_lines:119 for move_line in shipment.move_lines:
75 assert move_line.product_qty == 10, "Qty does not correspond."120 assert move_line.product_qty == 10, "Qty does not correspond."
76 assert move_line.product_id.virtual_available == 20, "Virtual stock does not correspond."121 assert move_line.product_id.virtual_available == 20, "Virtual stock does not correspond."
77 assert move_line.state == 'done', "Move line should be closed."122 assert move_line.state == 'done', "Move line should be closed."
78123-
79-124 I return last incoming shipment for 10 Unit 15” LCD Monitor.
80 I return last incomming shipment for 10 kgm Ice-cream.125-
81-126 !record {model: stock.return.picking, id: return_incoming}:
82 !record {model: stock.return.picking, id: return_incomming}:
83 invoice_state: none127 invoice_state: none
84-128-
85 !python {model: stock.return.picking }: |129 !python {model: stock.return.picking }: |
86 # this work without giving the id of the picking to return, magically, thanks to the context130 # this work without giving the id of the picking to return, magically, thanks to the context
87 self.create_returns(cr, uid, [ref('return_incomming')], context=context)131 self.create_returns(cr, uid, [ref('return_incoming')], context=context)
88-132-
89 I cancel incomming shipment after return it.133 I cancel incoming shipment after returning it.
90-134-
91 !python {model: stock.picking}: |135 !python {model: stock.picking}: |
92 # the cancel is not on the return, but on the incomming shipment (which now has a quantity of 10, thanks to the 136 # the cancel is not on the return, but on the incoming shipment (which now has a quantity of 10, thanks to the
93 # backorder). This situation is a little weird as we returned a move that we finally cancelled... As result, only137 # backorder). This situation is a little weird as we returned a move that we finally cancelled... As result, only
94 # 30Kg from the original 50Kg will be counted in the stock (50 - 10 (cancelled quantity) - 10 (returned quantity))138 # 30Unit from the original 50Unit will be counted in the stock (50 - 10 (cancelled quantity) - 10 (returned quantity))
95 self.action_cancel(cr, uid, [ref("incomming_shipment")], context=context)139 self.action_cancel(cr, uid, [ref("incomming_shipment")], context=context)
96-140-
97 I make invoice of backorder of incomming shipment.141 I make invoice of backorder of incoming shipment.
98-142-
99 !python {model: stock.invoice.onshipping}: |143 !python {model: stock.invoice.onshipping}: |
100 shipment = self.pool.get('stock.picking').browse(cr, uid, ref("incomming_shipment"))144 shipment = self.pool.get('stock.picking').browse(cr, uid, ref("incomming_shipment"))
101 context.update({'active_model': 'stock.picking', 'active_id': shipment.backorder_id.id, 'active_ids': [shipment.backorder_id.id]})145 context.update({'active_model': 'stock.picking', 'active_id': shipment.backorder_id.id, 'active_ids': [shipment.backorder_id.id]})
102-146-
103 !record {model: stock.invoice.onshipping, id: invoice_incomming}:147 !record {model: stock.invoice.onshipping, id: invoice_incoming}:
104 group: False148 group: False
105-149-
106 !python {model: stock.invoice.onshipping }: |150 !python {model: stock.invoice.onshipping }: |
107 self.create_invoice(cr, uid, [ref('invoice_incomming')], context=context)151 self.create_invoice(cr, uid, [ref('invoice_incoming')], context=context)
108-152-
109 I check invoice state of backorder of incomming shipment.153 I check invoice status of backorder of incoming shipment.
110-154-
111 !python {model: stock.picking}: |155 !python {model: stock.picking}: |
112 shipment = self.browse(cr, uid, ref("incomming_shipment"))156 shipment = self.browse(cr, uid, ref("incomming_shipment"))
113 assert shipment.backorder_id.invoice_state == 'invoiced', 'Invoice state is not upadted.'157 assert shipment.backorder_id.invoice_state == 'invoiced', 'Invoice state is not updated.'
114-158-
115 I check available stock after received incomming shipping.159 I check available stock after receiving incoming shipping.
116-160-
117 !python {model: product.product}: |161 !python {model: product.product}: |
118 product = self.browse(cr, uid, ref('product_icecream'), context=context)162 product = self.browse(cr, uid, ref('product_product_6'), context=context)
119 assert product.qty_available == 140, "Stock does not correspond."163 assert product.qty_available == 140, "Stock does not correspond."
120 assert product.virtual_available == 0, "Vitual stock does not correspond."164 assert product.virtual_available == 0, "Virtual stock does not correspond."
121-
122 I split incomming shipment into lots. each lot contain 10 kgm Ice-cream.
123-
124 !python {model: stock.picking}: |
125 shipment = self.browse(cr, uid, ref("incomming_shipment"))
126 move_ids = [x.id for x in shipment.backorder_id.move_lines]
127 context.update({'active_model': 'stock.move', 'active_id': move_ids[0], 'active_ids': move_ids})
128-
129 !record {model: stock.move.split, id: split_lot_incomming}:
130 line_ids:
131 - name: incoming_lot0
132 quantity: 10
133 - name: incoming_lot1
134 quantity: 10
135 - name: incoming_lot2
136 quantity: 10
137 - name: incoming_lot3
138 quantity: 10
139
140-
141 !python {model: stock.move.split }: |
142 self.split_lot(cr, uid, [ref('split_lot_incomming')], context=context)
143-
144 I check move lines after spliting
145-
146 !python {model: stock.move}: |
147 lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incomming'), context=context)
148 lot_ids = self.pool.get('stock.production.lot').search(cr, uid, [('name','in',[x.name for x in lot.line_ids])])
149 assert len(lot_ids) == 4, 'lots of incomming shipment are not correspond.'
150 move_ids = self.search(cr, uid, [('location_dest_id','=',ref('location_refrigerator')),('prodlot_id','in',lot_ids)])
151 assert len(move_ids) == 4, 'move lines are not correspond per prodcution lot after splited.'
152 for move in self.browse(cr, uid, move_ids, context=context):
153 assert move.prodlot_id.name in ['incoming_lot0', 'incoming_lot1', 'incoming_lot2', 'incoming_lot3'], "lot does not correspond."
154 assert move.product_qty == 10, "qty does not correspond per production lot."
155 context.update({'active_model':'stock.move', 'active_id':move_ids[0],'active_ids': move_ids})
156-165-
157 I check the stock valuation account entries.166 I check the stock valuation account entries.
158-167-
@@ -161,91 +170,90 @@
161 account_move_ids = self.search(cr, uid, [('ref','=',incomming_shipment.name)])170 account_move_ids = self.search(cr, uid, [('ref','=',incomming_shipment.name)])
162 assert len(account_move_ids), "account move should be created."171 assert len(account_move_ids), "account move should be created."
163 account_move = self.browse(cr, uid, account_move_ids[0], context=context)172 account_move = self.browse(cr, uid, account_move_ids[0], context=context)
164 assert len(account_move.line_id) == len(incomming_shipment.move_lines) + 1, 'accuont entries are not correspond.'173 assert len(account_move.line_id) == len(incomming_shipment.move_lines) + 1, 'Accounting entries does not correspond.'
165 for account_move_line in account_move.line_id:174 for account_move_line in account_move.line_id:
166 for stock_move in incomming_shipment.move_lines:175 for stock_move in incomming_shipment.move_lines:
167 if account_move_line.account_id.id == stock_move.product_id.property_stock_account_input.id:176 if account_move_line.account_id.id == stock_move.product_id.property_stock_account_input.id:
168 assert account_move_line.credit == 800.0, "Credit amount does not correspond."177 assert account_move_line.credit == 14000.0, "Credit amount does not correspond."
169 assert account_move_line.debit == 0.0, "Debit amount does not correspond."178 assert account_move_line.debit == 0.0, "Debit amount does not correspond."
170 else:179 else:
171 assert account_move_line.credit == 0.0, "Credit amount does not correspond."180 assert account_move_line.credit == 0.0, "Credit amount does not correspond."
172 assert account_move_line.debit == 800.0, "Debit amount does not correspond."181 assert account_move_line.debit == 14000.0, "Debit amount does not correspond."
173-
174 I consume 1 kgm ice-cream from each incoming lots into internal production.
175-
176 !record {model: stock.move.consume, id: consume_lot_incomming}:
177 product_qty: 1
178 location_id: location_refrigerator
179-
180 !python {model: stock.move.consume}: |
181 self.do_move_consume(cr, uid, [ref('consume_lot_incomming')], context=context)
182-
183 I scrap 10 gm ice-cream from each incoming lots into scrap location.
184-
185 !record {model: stock.move.scrap, id: scrap_lot_incomming}:
186 product_qty: 0.010
187-
188 !python {model: stock.move.scrap}: |
189 self.move_scrap(cr, uid, [ref('scrap_lot_incomming')], context=context)
190-
191 I check stock in scrap location and refrigerator location.
192-
193 !python {model: stock.location}: |
194 ctx = {'product_id': ref('product_icecream')}
195 refrigerator_location = self.pool.get('stock.location').browse(cr, uid, ref('location_refrigerator'), context=ctx)
196 assert refrigerator_location.stock_real == 135.96, 'stock does not correspond in refrigerator location.'
197 scrapped_location = self.browse(cr, uid, ref('stock_location_scrapped'), context=ctx)
198 assert scrapped_location.stock_real == 0.010*4, 'scraped stock does not correspond in scrap location.'
199
200-
201 I check availabile stock after consumed and scraped.
202-
203 !python {model: product.product}: |
204 product = self.browse(cr, uid, ref('product_icecream'), context=context)
205 assert product.qty_available == 135.96, "Stock does not correspond."
206 assert round(product.virtual_available, 2) == -4.04, "Vitual stock does not correspond."
207-182-
208 I trace all incoming lots.183 I trace all incoming lots.
209-184-
210 !python {model: stock.production.lot }: |185 !python {model: stock.production.lot }: |
211 lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incomming'), context=context)186 lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incoming'), context=context)
212 lot_ids = self.search(cr, uid, [('name', 'in', [x.name for x in lot.line_ids])])187 lot_ids = self.search(cr, uid, [('name', 'in', [x.name for x in lot.line_ids])])
213 self.action_traceability(cr, uid, lot_ids, context=context)188 self.action_traceability(cr, uid, lot_ids, context=context)
214-189-
215 I check outgoing shipment after stock availablity in refrigerator.190 I check outgoing shipment after stock availability in Chicago shop.
216-191-
217 !python {model: stock.picking}: |192 !python {model: stock.picking}: |
218 shipment = self.browse(cr, uid, ref("outgoing_shipment"), context=context)193 shipment = self.browse(cr, uid, ref("outgoing_shipment"), context=context)
219 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 state194 self.pool.get('stock.move').action_assign(cr, uid, [x.id for x in shipment.move_lines])
220 #TOFIX: shipment should be assigned if stock available195 assert shipment.state == "assigned", "Shipment should be assigned."
221 #assert shipment.state == "assigned", "Shipment should be assigned."196 for move_line in shipment.move_lines:
222 #for move_line in shipment.move_lines:197 assert move_line.state == "assigned", "Move should be assigned."
223 # assert move_line.state == "assigned", "Move should be assigned."
224 self.force_assign(cr, uid, [shipment.id])198 self.force_assign(cr, uid, [shipment.id])
225-199 context.update({'active_model':'stock.move', 'active_id':shipment.move_lines[0].id,'active_ids': [shipment.move_lines[0].id]})
226 I deliver 5kgm Ice-cream to customer so I make partial deliver200-
201 I scrap 4 units of 15” LCD Monitor into scrap location.
202-
203 !record {model: stock.move.scrap, id: scrap_monitor1}:
204 product_qty: 4
205-
206 !python {model: stock.move.scrap}: |
207 self.move_scrap(cr, uid, [ref('scrap_monitor1')], context=context)
208-
209 I consume 4 units of 15” LCD Monitor.
210-
211 !record {model: stock.move.consume, id: consume_monitor1}:
212 product_qty: 4
213 location_id: location_monitor
214-
215 !python {model: stock.move.consume}: |
216 self.do_move_consume(cr, uid, [ref('consume_monitor1')], context=context)
217-
218 I check stock in scrap location and stock location.
219-
220 !python {model: stock.location}: |
221 ctx = {'product_id': ref('product_product_6')}
222 monitor_location = self.pool.get('stock.location').browse(cr, uid, ref('location_monitor'), context=ctx)
223 assert monitor_location.stock_real == 132.0, 'stock does not correspond in stock location shop0.'
224 scrapped_location = self.browse(cr, uid, ref('stock_location_scrapped'), context=ctx)
225 assert scrapped_location.stock_real == 4, 'scraped stock does not correspond in scrap location.'
226-
227 I check available stock after consumed and scraped move.
228-
229 !python {model: product.product}: |
230 product = self.browse(cr, uid, ref('product_product_6'), context=context)
231 assert product.qty_available == 132.0, "Stock does not correspond."
232 assert round(product.virtual_available, 2) == -4.00, "Virtual stock does not correspond."
233-
234 I deliver 5 Unit 15” LCD Monitor to customer partially.
227-235-
228 !python {model: stock.partial.move}: |236 !python {model: stock.partial.move}: |
229 context.update({'active_model': 'stock.move', 'active_id': ref('outgoing_shipment_icecream'), 'active_ids': [ref('outgoing_shipment_icecream')]})237 context.update({'active_model': 'stock.move', 'active_id': ref('outgoing_shipment_monitor'), 'active_ids': [ref('outgoing_shipment_monitor')]})
230-238-
231 !record {model: stock.partial.move, id: partial_outgoing_icecream}:239 !record {model: stock.partial.move, id: partial_outgoing_monitor}:
232 move_ids:240 move_ids:
233 - quantity: 5241 - quantity: 5
234 product_id: product_icecream242 product_id: product_product_6
235 product_uom: product.product_uom_kgm243 product_uom: product.product_uom_unit
236 move_id: outgoing_shipment_icecream244 move_id: outgoing_shipment_monitor
237 location_id: location_refrigerator245 location_id: location_monitor
238 location_dest_id: location_delivery_counter246 location_dest_id: stock_location_output
239-247-
240 !python {model: stock.partial.move }: |248 !python {model: stock.partial.move }: |
241 self.do_partial(cr, uid, [ref('partial_outgoing_icecream')], context=context)249 self.do_partial(cr, uid, [ref('partial_outgoing_monitor')], context=context)
242250
243-251-
244 I packing outgoing shipment into box per 10kgm with unique tracking lot.252 I pack outgoing shipment into box of 10 Unit with unique tracking lot.
245-253-
246 !python {model: stock.move}: |254 !python {model: stock.move}: |
247 stock_split = self.pool.get('stock.split.into')255 stock_split = self.pool.get('stock.split.into')
248 move = self.browse(cr, uid, ref('outgoing_shipment_icecream'), context=context)256 move = self.browse(cr, uid, ref('outgoing_shipment_monitor'), context=context)
249 context.update({'active_model': 'stock.move', 'active_id': move.id, 'active_ids': [move.id]})257 context.update({'active_model': 'stock.move', 'active_id': move.id, 'active_ids': [move.id]})
250 total_qty = move.product_qty258 total_qty = move.product_qty
251 split_qty = 10259 split_qty = 10
@@ -254,7 +262,7 @@
254 stock_split.split(cr, uid, [split_id], context=context)262 stock_split.split(cr, uid, [split_id], context=context)
255 total_qty -= split_qty263 total_qty -= split_qty
256-264-
257 I deliver outgoing shipment.265 I deliver the outgoing shipment.
258-266-
259 !python {model: stock.partial.picking}: |267 !python {model: stock.partial.picking}: |
260 context.update({'active_model': 'stock.picking', 'active_id': ref('outgoing_shipment'), 'active_ids': [ref('outgoing_shipment')]})268 context.update({'active_model': 'stock.picking', 'active_id': ref('outgoing_shipment'), 'active_ids': [ref('outgoing_shipment')]})
@@ -266,7 +274,7 @@
266 self.do_partial(cr, uid, [ref('partial_outgoing')], context=context)274 self.do_partial(cr, uid, [ref('partial_outgoing')], context=context)
267275
268-276-
269 I check outgoing shipment after deliver.277 I check outgoing shipment after delivery.
270-278-
271 !python {model: stock.picking}: |279 !python {model: stock.picking}: |
272 shipment = self.browse(cr, uid, ref("outgoing_shipment"), context=context)280 shipment = self.browse(cr, uid, ref("outgoing_shipment"), context=context)
@@ -274,9 +282,9 @@
274 for move_line in shipment.move_lines:282 for move_line in shipment.move_lines:
275 assert move_line.state == "done", "Move should be closed."283 assert move_line.state == "done", "Move should be closed."
276-284-
277 I check availaible stock after deliver.285 I check available stock after delivery.
278-286-
279 !python {model: product.product}: |287 !python {model: product.product}: |
280 product = self.browse(cr, uid, ref('product_icecream'), context=context)288 product = self.browse(cr, uid, ref('product_product_6'), context=context)
281 assert round(product.qty_available, 2) == 5.96, "Stock does not correspond."289 assert round(product.qty_available, 2) == 6, "Stock does not correspond."
282 assert round(product.virtual_available, 2) == -4.04, "Vitual stock does not correspond."290 assert round(product.virtual_available, 2) == -4.00, "Virtual stock does not correspond."
283291
=== modified file 'stock/test/stock_report.yml'
--- stock/test/stock_report.yml 2013-02-22 13:35:11 +0000
+++ stock/test/stock_report.yml 2013-09-12 07:07:28 +0000
@@ -1,11 +1,16 @@
1-1-
2 Stock user can print all reports related to stock, so let's check data with giving the access rights of user.
3-
4 !context
5 uid: 'res_users_stock_user'
6-
2 I print a stock overview report of location.7 I print a stock overview report of location.
3-8-
4 !python {model: stock.location}: |9 !python {model: stock.location}: |
5 import os10 import os
6 import openerp.report11 import openerp.report
7 from openerp import tools12 from openerp import tools
8 data, format = openerp.report.render_report(cr, uid, [ref('location_refrigerator')], 'lot.stock.overview', {}, {})13 data, format = openerp.report.render_report(cr, uid, [ref('location_monitor')], 'lot.stock.overview', {}, {})
9 if tools.config['test_report_directory']:14 if tools.config['test_report_directory']:
10 file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data)15 file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data)
11-16-
@@ -15,7 +20,7 @@
15 import os20 import os
16 import openerp.report21 import openerp.report
17 from openerp import tools22 from openerp import tools
18 data, format = openerp.report.render_report(cr, uid, [ref('location_refrigerator')], 'lot.stock.overview_all', {}, {})23 data, format = openerp.report.render_report(cr, uid, [ref('location_monitor')], 'lot.stock.overview_all', {}, {})
19 if tools.config['test_report_directory']:24 if tools.config['test_report_directory']:
20 file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data)25 file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data)
21-26-
@@ -25,7 +30,7 @@
25 import os30 import os
26 import openerp.report31 import openerp.report
27 from openerp import tools32 from openerp import tools
28 data, format = openerp.report.render_report(cr, uid, [ref('stock_inventory_icecream')], 'stock.inventory.move', {}, {})33 data, format = openerp.report.render_report(cr, uid, [ref('stock_inventory_0')], 'stock.inventory.move', {}, {})
29 if tools.config['test_report_directory']:34 if tools.config['test_report_directory']:
30 file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data)35 file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data)
31-36-
@@ -45,7 +50,7 @@
45 import os50 import os
46 import openerp.report51 import openerp.report
47 from openerp import tools52 from openerp import tools
48 data, format = openerp.report.render_report(cr, uid, [ref('product_icecream')], 'stock.product.history', {}, {})53 data, format = openerp.report.render_report(cr, uid, [ref('product_product_6')], 'stock.product.history', {}, {})
49 if tools.config['test_report_directory']:54 if tools.config['test_report_directory']:
50 file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data)55 file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data)
5156
5257
=== added file 'stock/test/stock_users.yml'
--- stock/test/stock_users.yml 1970-01-01 00:00:00 +0000
+++ stock/test/stock_users.yml 2013-09-12 07:07:28 +0000
@@ -0,0 +1,30 @@
1-
2 Create a user as 'Stock Manager'
3-
4 !record {model: res.users, id: res_users_stock_manager}:
5 company_id: base.main_company
6 name: Stock Manager
7 login: sam
8 password: sam
9 email: stockmanager@yourcompany.com
10-
11 I added groups for Stock Manager.
12-
13 !record {model: res.users, id: res_users_stock_manager}:
14 groups_id:
15 - stock.group_stock_manager
16-
17 Create a user as 'Stock User'
18-
19 !record {model: res.users, id: res_users_stock_user}:
20 company_id: base.main_company
21 name: Stock User
22 login: sau
23 password: sau
24 email: stockuser@yourcompany.com
25-
26 I added groups for Stock User.
27-
28 !record {model: res.users, id: res_users_stock_user}:
29 groups_id:
30 - stock.group_stock_user

Subscribers

People subscribed via source and target branches

to all changes: