From 5ec04f670303a984c53b11bcdc0c0fed0bd51720 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Mon, 4 Feb 2013 15:04:25 +0530 Subject: [PATCH 01/88] [IMP]add yml file based on new session tag which test yml as per session user bzr revid: sgo@tinyerp.com-20130204093425-blivw1198zxhsh2u --- addons/sale/__openerp__.py | 3 ++- addons/sale/test/sale_order_demo.yml | 16 ---------------- 2 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 addons/sale/test/sale_order_demo.yml diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py index 8cc4919e3a1..6ba3a02bb00 100644 --- a/addons/sale/__openerp__.py +++ b/addons/sale/__openerp__.py @@ -80,7 +80,8 @@ The Dashboard for the Sales Manager will include ], 'demo': ['sale_demo.xml'], 'test': [ - 'test/sale_order_demo.yml', + 'test/sale_order_salesmanager_demo.yml', + 'test/sale_order_salesman_demo.yml', 'test/manual_order_policy.yml', 'test/cancel_order.yml', 'test/delete_order.yml', diff --git a/addons/sale/test/sale_order_demo.yml b/addons/sale/test/sale_order_demo.yml deleted file mode 100644 index 7e5a223e8b0..00000000000 --- a/addons/sale/test/sale_order_demo.yml +++ /dev/null @@ -1,16 +0,0 @@ -- - In order to test process of the Sale Order, I create sale order -- - !record {model: sale.order, id: sale_order_test1}: - partner_id: base.res_partner_2 - note: Invoice after delivery - payment_term: account.account_payment_term - order_line: - - product_id: product.product_product_7 - product_uom_qty: 8 -- - I verify that the onchange was correctly triggered -- - !assert {model: sale.order, id: sale.sale_order_test1, string: The onchange function of product was not correctly triggered}: - - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor' - - order_line[0].price_unit == 1350.0 From 72043cfbc34586a937918ea2ac1a5f7ab177fb25 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Mon, 4 Feb 2013 18:02:12 +0530 Subject: [PATCH 02/88] [ADD]yml files bzr revid: sgo@tinyerp.com-20130204123212-psghdi2mnp4r2lut --- addons/sale/test/sale_order_salesman_demo.yml | 32 +++++++++++++++++++ .../test/sale_order_salesmanager_demo.yml | 28 ++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 addons/sale/test/sale_order_salesman_demo.yml create mode 100644 addons/sale/test/sale_order_salesmanager_demo.yml diff --git a/addons/sale/test/sale_order_salesman_demo.yml b/addons/sale/test/sale_order_salesman_demo.yml new file mode 100644 index 00000000000..4e297249322 --- /dev/null +++ b/addons/sale/test/sale_order_salesman_demo.yml @@ -0,0 +1,32 @@ +- + In order to test process of the Sale Order, I create sale order +- + Create a user 'Salesman' +- + !record {model: res.users, id: res_users_salesman}: + company_id: base.main_company + name: Salesman + login: su + password: su + groups_id: + - base.group_sale_salesman_all_leads +- + Create a user 'Salesman' +- + Now, check the data with salesman +- + !session {uid: res_users_salesman}: +- + !record {model: sale.order, id: sale_order_test2}: + partner_id: base.res_partner_3 + note: Invoice after delivery + payment_term: account.account_payment_term + order_line: + - product_id: product.product_product_7 + product_uom_qty: 7 +- + I verify that the onchange was correctly triggered +- + !assert {model: sale.order, id: sale.sale_order_test2, string: The onchange function of product was not correctly triggered}: + - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor' + - order_line[0].price_unit == 1350.0 diff --git a/addons/sale/test/sale_order_salesmanager_demo.yml b/addons/sale/test/sale_order_salesmanager_demo.yml new file mode 100644 index 00000000000..f4d7750029d --- /dev/null +++ b/addons/sale/test/sale_order_salesmanager_demo.yml @@ -0,0 +1,28 @@ +- + In order to test process of the Sale Order, I create sale order +- + !record {model: res.users, id: res_users_salesmanager}: + company_id: base.main_company + name: Sales manager + login: sm + password: sm + groups_id: + - base.group_sale_manager +- + Now, check the data with sales Manager +- + !session {uid: res_users_salesmanager}: +- + !record {model: sale.order, id: sale_order_test1}: + partner_id: base.res_partner_2 + note: Invoice after delivery + payment_term: account.account_payment_term + order_line: + - product_id: product.product_product_7 + product_uom_qty: 8 +- + I verify that the onchange was correctly triggered +- + !assert {model: sale.order, id: sale.sale_order_test1, string: The onchange function of product was not correctly triggered}: + - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor' + - order_line[0].price_unit == 1350.0 From 3be3625587d11fbb44f2df3ca0c920d58831ad1b Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Mon, 18 Feb 2013 12:58:21 +0530 Subject: [PATCH 03/88] [IMP]improve code as per new spec bzr revid: sgo@tinyerp.com-20130218072821-c1x1bwvv1gp77w9t --- addons/sale/test/sale_order_salesman_demo.yml | 3 ++- addons/sale/test/sale_order_salesmanager_demo.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/sale/test/sale_order_salesman_demo.yml b/addons/sale/test/sale_order_salesman_demo.yml index 4e297249322..dbaf35c7a8f 100644 --- a/addons/sale/test/sale_order_salesman_demo.yml +++ b/addons/sale/test/sale_order_salesman_demo.yml @@ -15,7 +15,8 @@ - Now, check the data with salesman - - !session {uid: res_users_salesman}: + !context + 'uid': 'res_users_salesman' - !record {model: sale.order, id: sale_order_test2}: partner_id: base.res_partner_3 diff --git a/addons/sale/test/sale_order_salesmanager_demo.yml b/addons/sale/test/sale_order_salesmanager_demo.yml index f4d7750029d..47bb9081a55 100644 --- a/addons/sale/test/sale_order_salesmanager_demo.yml +++ b/addons/sale/test/sale_order_salesmanager_demo.yml @@ -11,7 +11,8 @@ - Now, check the data with sales Manager - - !session {uid: res_users_salesmanager}: + !context + 'uid': 'res_users_salesmanager' - !record {model: sale.order, id: sale_order_test1}: partner_id: base.res_partner_2 From e983e49f209d4ac7283a6cc034cfbc9e27c3138d Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Mon, 18 Feb 2013 15:40:43 +0530 Subject: [PATCH 04/88] [IMP]improve code bzr revid: sgo@tinyerp.com-20130218101043-7hy8m5goylr7fv2t --- addons/sale/test/sale_order_salesman_demo.yml | 6 ++---- addons/sale/test/sale_order_salesmanager_demo.yml | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/sale/test/sale_order_salesman_demo.yml b/addons/sale/test/sale_order_salesman_demo.yml index dbaf35c7a8f..56c781d1451 100644 --- a/addons/sale/test/sale_order_salesman_demo.yml +++ b/addons/sale/test/sale_order_salesman_demo.yml @@ -1,7 +1,7 @@ - In order to test process of the Sale Order, I create sale order - - Create a user 'Salesman' + Create a user as 'Salesman' - !record {model: res.users, id: res_users_salesman}: company_id: base.main_company @@ -10,13 +10,11 @@ password: su groups_id: - base.group_sale_salesman_all_leads -- - Create a user 'Salesman' - Now, check the data with salesman - !context - 'uid': 'res_users_salesman' + uid: 'res_users_salesman' - !record {model: sale.order, id: sale_order_test2}: partner_id: base.res_partner_3 diff --git a/addons/sale/test/sale_order_salesmanager_demo.yml b/addons/sale/test/sale_order_salesmanager_demo.yml index 47bb9081a55..f09e1327a75 100644 --- a/addons/sale/test/sale_order_salesmanager_demo.yml +++ b/addons/sale/test/sale_order_salesmanager_demo.yml @@ -1,5 +1,7 @@ - In order to test process of the Sale Order, I create sale order +- + Create a user as 'Salesmanager' - !record {model: res.users, id: res_users_salesmanager}: company_id: base.main_company @@ -12,7 +14,7 @@ Now, check the data with sales Manager - !context - 'uid': 'res_users_salesmanager' + uid: 'res_users_salesmanager' - !record {model: sale.order, id: sale_order_test1}: partner_id: base.res_partner_2 From 83af08294e7ca5b0f788ea99822a19ba4fd0660f Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 19 Feb 2013 12:57:34 +0530 Subject: [PATCH 05/88] [IMP]improve yaml for cancel order bzr revid: sgo@tinyerp.com-20130219072734-70093wqxyory3arz --- addons/sale/__openerp__.py | 2 +- ..._order.yml => cancel_order_sale_manager.yml} | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) rename addons/sale/test/{cancel_order.yml => cancel_order_sale_manager.yml} (89%) diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py index 6ba3a02bb00..26014e8cadd 100644 --- a/addons/sale/__openerp__.py +++ b/addons/sale/__openerp__.py @@ -83,7 +83,7 @@ The Dashboard for the Sales Manager will include 'test/sale_order_salesmanager_demo.yml', 'test/sale_order_salesman_demo.yml', 'test/manual_order_policy.yml', - 'test/cancel_order.yml', + 'test/cancel_order_sale_manager.yml', 'test/delete_order.yml', 'test/edi_sale_order.yml', ], diff --git a/addons/sale/test/cancel_order.yml b/addons/sale/test/cancel_order_sale_manager.yml similarity index 89% rename from addons/sale/test/cancel_order.yml rename to addons/sale/test/cancel_order_sale_manager.yml index 12b28fcb7e8..78a3af6113b 100644 --- a/addons/sale/test/cancel_order.yml +++ b/addons/sale/test/cancel_order_sale_manager.yml @@ -3,7 +3,21 @@ I confirm order (with at least 2 lines) - !workflow {model: sale.order, action: order_confirm, ref: sale_order_8} - +- + Create a user as 'Salesmanager for cancel order' +- + !record {model: res.users, id: res_users_can_so}: + company_id: base.main_company + name: Sales manager for cancel + login: smc + password: smc + groups_id: + - base.group_sale_manager +- + Now, check the data with sales Manager for cancel order. +- + !context + uid: 'res_users_can_so' - I check state of order in 'Sale Order'. - @@ -32,6 +46,7 @@ ctx = context.copy() ctx.update({"active_model": 'sale.order', "active_ids": [ref("sale_order_8")], "active_id":ref("sale_order_8")}) pay_id = self.create(cr, uid, {'advance_payment_method': 'fixed', 'amount': 5}) + print ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.",uid self.create_invoices(cr, uid, [pay_id], context=ctx) invoice_ids = self.pool.get('sale.order').browse(cr, uid, ref("sale_order_8")).invoice_ids From 3e01083a1bb6bac3e2b46734cbd154a685283634 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 19 Feb 2013 14:23:28 +0530 Subject: [PATCH 06/88] [IMP]improve code bzr revid: sgo@tinyerp.com-20130219085328-um1q8bs4iw773ivs --- addons/sale/test/cancel_order_sale_manager.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/sale/test/cancel_order_sale_manager.yml b/addons/sale/test/cancel_order_sale_manager.yml index 78a3af6113b..770d1a5924d 100644 --- a/addons/sale/test/cancel_order_sale_manager.yml +++ b/addons/sale/test/cancel_order_sale_manager.yml @@ -46,7 +46,6 @@ ctx = context.copy() ctx.update({"active_model": 'sale.order', "active_ids": [ref("sale_order_8")], "active_id":ref("sale_order_8")}) pay_id = self.create(cr, uid, {'advance_payment_method': 'fixed', 'amount': 5}) - print ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.",uid self.create_invoices(cr, uid, [pay_id], context=ctx) invoice_ids = self.pool.get('sale.order').browse(cr, uid, ref("sale_order_8")).invoice_ids From d4a1cec260ffa9fb1c10430df6e8c38880ecaf6a Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 19 Feb 2013 18:49:21 +0530 Subject: [PATCH 07/88] [IMP]improve code and yml bzr revid: sgo@tinyerp.com-20130219131921-nbfs273xujvriomu --- addons/sale/__openerp__.py | 4 +- addons/sale/test/create_sale_users.yml | 20 +++++++++ addons/sale/test/sale_order_demo.yml | 41 +++++++++++++++++++ .../test/sale_order_salesmanager_demo.yml | 31 -------------- 4 files changed, 63 insertions(+), 33 deletions(-) create mode 100644 addons/sale/test/create_sale_users.yml create mode 100644 addons/sale/test/sale_order_demo.yml delete mode 100644 addons/sale/test/sale_order_salesmanager_demo.yml diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py index 6ba3a02bb00..2bea86b41af 100644 --- a/addons/sale/__openerp__.py +++ b/addons/sale/__openerp__.py @@ -80,8 +80,8 @@ The Dashboard for the Sales Manager will include ], 'demo': ['sale_demo.xml'], 'test': [ - 'test/sale_order_salesmanager_demo.yml', - 'test/sale_order_salesman_demo.yml', + 'test/create_sale_users.yml', + 'test/sale_order_demo.yml', 'test/manual_order_policy.yml', 'test/cancel_order.yml', 'test/delete_order.yml', diff --git a/addons/sale/test/create_sale_users.yml b/addons/sale/test/create_sale_users.yml new file mode 100644 index 00000000000..a61c4bd7c99 --- /dev/null +++ b/addons/sale/test/create_sale_users.yml @@ -0,0 +1,20 @@ +- + Create a user as 'Salesmanager' +- + !record {model: res.users, id: res_users_salesmanager}: + company_id: base.main_company + name: Sales manager + login: sm + password: sm + groups_id: + - base.group_sale_manager +- + Create a user as 'Salesman' +- + !record {model: res.users, id: res_users_salesman}: + company_id: base.main_company + name: Salesman + login: su + password: su + groups_id: + - base.group_sale_salesman_all_leads diff --git a/addons/sale/test/sale_order_demo.yml b/addons/sale/test/sale_order_demo.yml new file mode 100644 index 00000000000..84aaa43a3cf --- /dev/null +++ b/addons/sale/test/sale_order_demo.yml @@ -0,0 +1,41 @@ +- + Test the data with salesman, +- + !context + uid: 'res_users_salesman' +- + In order to test process of the Sale Order, I create sale order +- + !record {model: sale.order, id: sale_order_test1}: + partner_id: base.res_partner_2 + note: Invoice after delivery + payment_term: account.account_payment_term + order_line: + - product_id: product.product_product_7 + product_uom_qty: 8 +- + I verify that the onchange was correctly triggered +- + !assert {model: sale.order, id: sale.sale_order_test1, string: The onchange function of product was not correctly triggered}: + - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor' + - order_line[0].price_unit == 1350.0 + - order_line[0].product_uom_qty == 8 + - order_line[0].product_uom.id == ref('product.product_uom_unit') + +- + I create another sale order +- + !record {model: sale.order, id: sale_order_test2}: + partner_id: base.res_partner_2 + order_line: + - product_id: product.product_product_7 + product_uom_qty: 16 + product_uom: product.product_uom_dozen +- + I verify that the onchange was correctly triggered +- + !assert {model: sale.order, id: sale.sale_order_test2, string: The onchange function of product was not correctly triggered}: + - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor' + - order_line[0].price_unit == 1350.0 * 12 + - order_line[0].product_uom.id == ref('product.product_uom_dozen') + - order_line[0].product_uom_qty == 16 \ No newline at end of file diff --git a/addons/sale/test/sale_order_salesmanager_demo.yml b/addons/sale/test/sale_order_salesmanager_demo.yml deleted file mode 100644 index f09e1327a75..00000000000 --- a/addons/sale/test/sale_order_salesmanager_demo.yml +++ /dev/null @@ -1,31 +0,0 @@ -- - In order to test process of the Sale Order, I create sale order -- - Create a user as 'Salesmanager' -- - !record {model: res.users, id: res_users_salesmanager}: - company_id: base.main_company - name: Sales manager - login: sm - password: sm - groups_id: - - base.group_sale_manager -- - Now, check the data with sales Manager -- - !context - uid: 'res_users_salesmanager' -- - !record {model: sale.order, id: sale_order_test1}: - partner_id: base.res_partner_2 - note: Invoice after delivery - payment_term: account.account_payment_term - order_line: - - product_id: product.product_product_7 - product_uom_qty: 8 -- - I verify that the onchange was correctly triggered -- - !assert {model: sale.order, id: sale.sale_order_test1, string: The onchange function of product was not correctly triggered}: - - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor' - - order_line[0].price_unit == 1350.0 From 33636c1dcfdd95e231d5e6b202775129d8e8ddd8 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 19 Feb 2013 18:57:12 +0530 Subject: [PATCH 08/88] [REM]remove file bzr revid: sgo@tinyerp.com-20130219132712-hr0sns52uy0821th --- addons/sale/test/sale_order_salesman_demo.yml | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 addons/sale/test/sale_order_salesman_demo.yml diff --git a/addons/sale/test/sale_order_salesman_demo.yml b/addons/sale/test/sale_order_salesman_demo.yml deleted file mode 100644 index 56c781d1451..00000000000 --- a/addons/sale/test/sale_order_salesman_demo.yml +++ /dev/null @@ -1,31 +0,0 @@ -- - In order to test process of the Sale Order, I create sale order -- - Create a user as 'Salesman' -- - !record {model: res.users, id: res_users_salesman}: - company_id: base.main_company - name: Salesman - login: su - password: su - groups_id: - - base.group_sale_salesman_all_leads -- - Now, check the data with salesman -- - !context - uid: 'res_users_salesman' -- - !record {model: sale.order, id: sale_order_test2}: - partner_id: base.res_partner_3 - note: Invoice after delivery - payment_term: account.account_payment_term - order_line: - - product_id: product.product_product_7 - product_uom_qty: 7 -- - I verify that the onchange was correctly triggered -- - !assert {model: sale.order, id: sale.sale_order_test2, string: The onchange function of product was not correctly triggered}: - - order_line[0].name == u'[LCD17] 17\u201d LCD Monitor' - - order_line[0].price_unit == 1350.0 From fad27029faa105e9ca8d934d00680373d1487dc5 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 20 Feb 2013 10:27:34 +0530 Subject: [PATCH 09/88] [IMP] add yml file & improve code in crm bzr revid: fka@tinyerp.com-20130220045734-auwnnd55vpimt3ep --- addons/crm/__openerp__.py | 1 + addons/crm/security/ir.model.access.csv | 1 + .../crm/test/process/lead2opportunity2win.yml | 5 +++ .../lead2opportunity_assign_salesmen.yml | 45 ++++++++++--------- addons/crm/test/process/merge_opportunity.yml | 1 - addons/crm/test/process/phonecalls.yml | 5 +++ addons/crm/test/ui/crm_access_group_users.yml | 20 +++++++++ addons/mail/security/ir.model.access.csv | 4 +- 8 files changed, 59 insertions(+), 23 deletions(-) create mode 100644 addons/crm/test/ui/crm_access_group_users.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 0dd075d48e6..1d0ea32c0bc 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -103,6 +103,7 @@ Dashboard for CRM will include: 'crm_action_rule_demo.xml', ], 'test': [ + 'test/ui/crm_access_group_users.yml', 'test/process/communication_with_customer.yml', 'test/process/lead2opportunity2win.yml', 'test/process/lead2opportunity_assign_salesmen.yml', diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv index 74394d3c5ce..0f2cf267b47 100644 --- a/addons/crm/security/ir.model.access.csv +++ b/addons/crm/security/ir.model.access.csv @@ -29,6 +29,7 @@ access_calendar_attendee_crm_manager,calendar.attendee.crm.manager,model_calenda access_res_partner,res.partner.crm.user,base.model_res_partner,base.group_sale_salesman,1,1,1,0 access_res_partner_category,res.partner.category.crm.user,base.model_res_partner_category,base.group_sale_salesman,1,1,1,0 mail_mailgate_thread,mail.thread,mail.model_mail_thread,base.group_sale_salesman,1,1,1,1 +access_mail_message,mail.message,mail.model_mail_message,base.group_sale_salesman,1,1,1,0 access_crm_case_categ_manager,crm.case.categ manager,model_crm_case_categ,base.group_sale_manager,1,1,1,1 access_base_action_rule_manager,base.action.rule manager,base_action_rule.model_base_action_rule,base.group_sale_manager,1,1,1,1 access_crm_lead_report_user,crm.lead.report user,model_crm_lead_report,base.group_sale_salesman,1,1,1,1 diff --git a/addons/crm/test/process/lead2opportunity2win.yml b/addons/crm/test/process/lead2opportunity2win.yml index 94e7149ef77..fc56b513588 100644 --- a/addons/crm/test/process/lead2opportunity2win.yml +++ b/addons/crm/test/process/lead2opportunity2win.yml @@ -1,3 +1,8 @@ +- + Now, check the data with Salesman. +- + !context + uid: 'crm_res_users_salesman' - In order to test the conversion of a lead into a opportunity, - diff --git a/addons/crm/test/process/lead2opportunity_assign_salesmen.yml b/addons/crm/test/process/lead2opportunity_assign_salesmen.yml index 0edd3b8edce..0d823dc87f4 100644 --- a/addons/crm/test/process/lead2opportunity_assign_salesmen.yml +++ b/addons/crm/test/process/lead2opportunity_assign_salesmen.yml @@ -1,5 +1,30 @@ - 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). +- + !record {model: res.users, id: test_res_user_01}: + name: 'Test user A' + login: 'tua' + new_password: 'tua' +- + !record {model: res.users, id: test_res_user_02}: + name: 'Test user B' + login: 'tub' + new_password: 'tub' +- + !record {model: res.users, id: test_res_user_03}: + name: 'Test user C' + login: 'tuc' + new_password: 'tuc' +- + !record {model: res.users, id: test_res_user_04}: + name: 'Test user D' + login: 'tud' + new_password: 'tud' +- + Now, check the data with Salesman. +- + !context + uid: 'crm_res_users_salesman' - !record {model: crm.lead, id: test_crm_lead_01}: type: 'lead' @@ -36,26 +61,6 @@ name: 'Test lead 6' partner_name: 'Agrolait SuperSeed SA' stage_id: stage_lead1 -- - !record {model: res.users, id: test_res_user_01}: - name: 'Test user A' - login: 'tua' - new_password: 'tua' -- - !record {model: res.users, id: test_res_user_02}: - name: 'Test user B' - login: 'tub' - new_password: 'tub' -- - !record {model: res.users, id: test_res_user_03}: - name: 'Test user C' - login: 'tuc' - new_password: 'tuc' -- - !record {model: res.users, id: test_res_user_04}: - name: 'Test user D' - login: 'tud' - new_password: 'tud' - I create a mass convert wizard and convert all the leads. - diff --git a/addons/crm/test/process/merge_opportunity.yml b/addons/crm/test/process/merge_opportunity.yml index c50af5214e6..e9027e228d7 100644 --- a/addons/crm/test/process/merge_opportunity.yml +++ b/addons/crm/test/process/merge_opportunity.yml @@ -1,4 +1,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. - diff --git a/addons/crm/test/process/phonecalls.yml b/addons/crm/test/process/phonecalls.yml index 51a933f3223..a71bfc05e03 100644 --- a/addons/crm/test/process/phonecalls.yml +++ b/addons/crm/test/process/phonecalls.yml @@ -1,3 +1,8 @@ +- + Now, check the data with Salesman. +- + !context + uid: 'crm_res_users_salesman' - I schedule a phone call with a customer. - diff --git a/addons/crm/test/ui/crm_access_group_users.yml b/addons/crm/test/ui/crm_access_group_users.yml new file mode 100644 index 00000000000..194c202ef15 --- /dev/null +++ b/addons/crm/test/ui/crm_access_group_users.yml @@ -0,0 +1,20 @@ +- + Create a user as 'Salesmanager' +- + !record {model: res.users, id: crm_res_users_salesmanager}: + company_id: base.main_company + name: Sales manager + login: csm + password: csm + groups_id: + - base.group_sale_manager +- + Create a user as 'Salesman' +- + !record {model: res.users, id: crm_res_users_salesman}: + company_id: base.main_company + name: Salesman + login: csu + password: csu + groups_id: + - base.group_sale_salesman_all_leads diff --git a/addons/mail/security/ir.model.access.csv b/addons/mail/security/ir.model.access.csv index 1141a3f928d..8faa06b0aa5 100644 --- a/addons/mail/security/ir.model.access.csv +++ b/addons/mail/security/ir.model.access.csv @@ -7,12 +7,12 @@ access_mail_mail_system,mail.mail.system,model_mail_mail,base.group_system,1,1,1 access_mail_followers_all,mail.followers.all,model_mail_followers,,1,0,0,0 access_mail_followers_user,mail.followers.user,model_mail_followers,base.group_user,1,1,0,0 access_mail_followers_system,mail.followers.system,model_mail_followers,base.group_system,1,1,1,1 -access_mail_notification_all,mail.notification.all,model_mail_notification,,1,0,0,0 +access_mail_notification_all,mail.notification.all,model_mail_notification,,1,0,1,0 access_mail_notification_user,mail.notification.user,model_mail_notification,base.group_user,1,1,1,0 access_mail_notification_system,mail.notification.system,model_mail_notification,base.group_system,1,1,1,1 access_mail_group_all,mail.group.all,model_mail_group,,1,0,0,0 access_mail_group_user,mail.group.user,model_mail_group,base.group_user,1,1,1,1 -access_mail_alias_all,mail.alias.all,model_mail_alias,,1,0,0,0 +access_mail_alias_all,mail.alias.all,model_mail_alias,,1,0,1,0 access_mail_alias_user,mail.alias.user,model_mail_alias,base.group_user,1,1,1,0 access_mail_alias_system,mail.alias.system,model_mail_alias,base.group_system,1,1,1,1 access_mail_message_subtype_all,mail.message.subtype.all,model_mail_message_subtype,,1,0,0,0 From e07255568279284eebf4e337131ec7fb6af3984d Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Wed, 20 Feb 2013 11:33:26 +0530 Subject: [PATCH 10/88] [IMP]improve yml give them to appropriate access rights bzr revid: sgo@tinyerp.com-20130220060326-q22mdh5yob7erh7e --- addons/sale/test/cancel_order.yml | 5 +++++ addons/sale/test/delete_order.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/addons/sale/test/cancel_order.yml b/addons/sale/test/cancel_order.yml index 12b28fcb7e8..48c6b91d2c4 100644 --- a/addons/sale/test/cancel_order.yml +++ b/addons/sale/test/cancel_order.yml @@ -1,3 +1,8 @@ +- + Salesman can also cancel order therfore test with that user which have salesman rights, +- + !context + uid: 'res_users_salesman' - In order to test the cancel sale order. I confirm order (with at least 2 lines) diff --git a/addons/sale/test/delete_order.yml b/addons/sale/test/delete_order.yml index abc68cb3af3..69c89020ad9 100644 --- a/addons/sale/test/delete_order.yml +++ b/addons/sale/test/delete_order.yml @@ -1,3 +1,8 @@ +- + Sales manager can only delete order therfore test with that user which have sales manager rights, +- + !context + uid: 'res_users_salesmanager' - I try to delete In progress order and check Error Message. - From 0dd9f460dad5bc1ef93bcf28370c08341d01bfb4 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 20 Feb 2013 12:07:25 +0530 Subject: [PATCH 11/88] [IMP] improve yml bzr revid: fka@tinyerp.com-20130220063725-dpa9tr2j57dor16c --- addons/crm/security/ir.model.access.csv | 1 + addons/crm/test/process/cancel_lead.yml | 19 +++++++++++-------- .../process/communication_with_customer.yml | 5 +++++ .../crm/test/process/lead2opportunity2win.yml | 2 +- .../lead2opportunity_assign_salesmen.yml | 6 +++--- addons/crm/test/ui/crm_demo.yml | 12 ++++++++---- addons/crm/test/ui/delete_lead.yml | 7 ++++++- addons/mail/security/ir.model.access.csv | 2 +- 8 files changed, 36 insertions(+), 18 deletions(-) diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv index 0f2cf267b47..cd460cf35d9 100644 --- a/addons/crm/security/ir.model.access.csv +++ b/addons/crm/security/ir.model.access.csv @@ -30,6 +30,7 @@ access_res_partner,res.partner.crm.user,base.model_res_partner,base.group_sale_s access_res_partner_category,res.partner.category.crm.user,base.model_res_partner_category,base.group_sale_salesman,1,1,1,0 mail_mailgate_thread,mail.thread,mail.model_mail_thread,base.group_sale_salesman,1,1,1,1 access_mail_message,mail.message,mail.model_mail_message,base.group_sale_salesman,1,1,1,0 +mail_mail_message,mail.message,mail.model_mail_message,base.group_sale_manager,1,1,1,1 access_crm_case_categ_manager,crm.case.categ manager,model_crm_case_categ,base.group_sale_manager,1,1,1,1 access_base_action_rule_manager,base.action.rule manager,base_action_rule.model_base_action_rule,base.group_sale_manager,1,1,1,1 access_crm_lead_report_user,crm.lead.report user,model_crm_lead_report,base.group_sale_salesman,1,1,1,1 diff --git a/addons/crm/test/process/cancel_lead.yml b/addons/crm/test/process/cancel_lead.yml index edaf844952a..ae2b6294c68 100644 --- a/addons/crm/test/process/cancel_lead.yml +++ b/addons/crm/test/process/cancel_lead.yml @@ -1,10 +1,13 @@ - - I cancel unqualified lead. + Salesman cancel unqualified lead. +- + !context + uid: 'crm_res_users_salesman' - !python {model: crm.lead}: | self.case_cancel(cr, uid, [ref("crm_case_1")]) - - I check cancelled lead. + Salesman check cancelled lead. - !python {model: crm.lead}: | lead = self.browse(cr, uid, ref('crm_case_1')) @@ -12,34 +15,34 @@ assert lead.state == 'cancel', "Opportunity is not in 'cancel' state." assert lead.probability == 0.0, 'Opportunity is probably wrong and should be 0.0.' - - I reset cancelled lead into unqualified lead. + Salesman reset cancelled lead into unqualified lead. - !python {model: crm.lead}: | self.case_reset(cr, uid, [ref("crm_case_1")]) - - I check unqualified lead after reset. + Salesman check unqualified lead after reset. - !assert {model: crm.lead, id: crm.crm_case_1, string: Lead is in draft state}: - state == "draft" - - I re-open the lead + Salesman re-open the lead - !python {model: crm.lead}: | self.case_open(cr, uid, [ref("crm_case_1")]) - - I check stage and state of the re-opened lead + Salesman check stage and state of the re-opened lead - !python {model: crm.lead}: | lead = self.browse(cr, uid, ref('crm.crm_case_1')) assert lead.stage_id.id == ref('crm.stage_lead2'), "Opportunity stage should be 'Qualification'." assert lead.state == 'open', "Opportunity should be in 'open' state." - - I escalate the lead to parent team. + Salesman escalate the lead to parent team. - !python {model: crm.lead}: | self.case_escalate(cr, uid, [ref("crm_case_1")]) - - I check the lead is correctly escalated to the parent team. + Salesman check the lead is correctly escalated to the parent team. - !assert {model: crm.lead, id: crm.crm_case_1, string: Escalate lead to parent team}: - section_id.name == "Support Department" diff --git a/addons/crm/test/process/communication_with_customer.yml b/addons/crm/test/process/communication_with_customer.yml index 221a4ab634f..4a36aeebd02 100644 --- a/addons/crm/test/process/communication_with_customer.yml +++ b/addons/crm/test/process/communication_with_customer.yml @@ -1,3 +1,8 @@ +- + Salesman communication with customer. +- + !context + uid: 'crm_res_users_salesman' - Customer interested in our product, so he sends request by email to get more details. - diff --git a/addons/crm/test/process/lead2opportunity2win.yml b/addons/crm/test/process/lead2opportunity2win.yml index fc56b513588..c69eb09ac31 100644 --- a/addons/crm/test/process/lead2opportunity2win.yml +++ b/addons/crm/test/process/lead2opportunity2win.yml @@ -1,5 +1,5 @@ - - Now, check the data with Salesman. + Salesman convert the lead into opportunity. - !context uid: 'crm_res_users_salesman' diff --git a/addons/crm/test/process/lead2opportunity_assign_salesmen.yml b/addons/crm/test/process/lead2opportunity_assign_salesmen.yml index 0d823dc87f4..9583c6034bf 100644 --- a/addons/crm/test/process/lead2opportunity_assign_salesmen.yml +++ b/addons/crm/test/process/lead2opportunity_assign_salesmen.yml @@ -1,5 +1,5 @@ - - 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). + 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). - !record {model: res.users, id: test_res_user_01}: name: 'Test user A' @@ -21,7 +21,7 @@ login: 'tud' new_password: 'tud' - - Now, check the data with Salesman. + Salesman creates lead. - !context uid: 'crm_res_users_salesman' @@ -62,7 +62,7 @@ partner_name: 'Agrolait SuperSeed SA' stage_id: stage_lead1 - - I create a mass convert wizard and convert all the leads. + Salesman create a mass convert wizard and convert all the leads. - !python {model: crm.lead2opportunity.partner.mass}: | 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")}) diff --git a/addons/crm/test/ui/crm_demo.yml b/addons/crm/test/ui/crm_demo.yml index 9154ffdf513..85ed1cf7403 100644 --- a/addons/crm/test/ui/crm_demo.yml +++ b/addons/crm/test/ui/crm_demo.yml @@ -1,5 +1,9 @@ + - - I create a lead record to call a partner onchange, stage onchange and mailing opt-in onchange method. + Sales manager create a lead record to call a partner onchange, stage onchange and mailing opt-in onchange method. +- + !context + uid: 'crm_res_users_salesmanager' - !record {model: crm.lead, id: crm_case_25}: name: 'Need more info about your pc2' @@ -8,7 +12,7 @@ stage_id: crm.stage_lead1 state: draft - - I create a lead record to call a mailing opt-out onchange method. + Sales manager create a lead record to call a mailing opt-out onchange method. - !record {model: crm.lead, id: crm_case_18}: name: 'Need 20 Days of Consultancy' @@ -16,13 +20,13 @@ state: draft opt_out: True - - I create a phonecall record to call a partner onchange method. + Sales manager create a phonecall record to call a partner onchange method. - !record {model: crm.phonecall, id: crm_phonecall_5}: name: 'Bad time' partner_id: base.res_partner_5 - - I set the next stage to "New" for the lead. + Sales manager set the next stage to "New" for the lead. - !python {model: crm.lead}: | self.stage_next(cr, uid, [ref("crm_case_4")], context={'stage_type': 'lead'}) diff --git a/addons/crm/test/ui/delete_lead.yml b/addons/crm/test/ui/delete_lead.yml index 49713039f22..f68061ba6cd 100644 --- a/addons/crm/test/ui/delete_lead.yml +++ b/addons/crm/test/ui/delete_lead.yml @@ -1,5 +1,10 @@ - - I Unlink the Lead. + Sales manager can delete lead. +- + !context + uid: 'crm_res_users_salesmanager' +- + Sales manager Unlink the Lead. - !python {model: crm.lead}: | self.unlink(cr, uid, [ref("crm_case_4")]) diff --git a/addons/mail/security/ir.model.access.csv b/addons/mail/security/ir.model.access.csv index 8faa06b0aa5..81b2356938b 100644 --- a/addons/mail/security/ir.model.access.csv +++ b/addons/mail/security/ir.model.access.csv @@ -1,7 +1,7 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_mail_message_all,mail.message.all,model_mail_message,,1,0,0,0 access_mail_message_user,mail.message.user,model_mail_message,base.group_user,1,1,1,1 -access_mail_mail_all,mail.mail.all,model_mail_mail,,1,0,0,0 +access_mail_mail_all,mail.mail.all,model_mail_mail,,1,0,1,0 access_mail_mail_user,mail.mail.user,model_mail_mail,base.group_user,1,1,1,0 access_mail_mail_system,mail.mail.system,model_mail_mail,base.group_system,1,1,1,1 access_mail_followers_all,mail.followers.all,model_mail_followers,,1,0,0,0 From 99cb34cee9d978e883e2922004230a094a9037a4 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 20 Feb 2013 13:02:36 +0530 Subject: [PATCH 12/88] [IMP] add access rights in merge_opportunity.yml bzr revid: fka@tinyerp.com-20130220073236-7v3i73ui0zua4uo9 --- addons/crm/test/process/merge_opportunity.yml | 5 ++++- addons/crm/test/process/phonecalls.yml | 2 +- addons/crm/test/ui/crm_access_group_users.yml | 2 +- addons/crm/test/ui/delete_lead.yml | 4 +--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/addons/crm/test/process/merge_opportunity.yml b/addons/crm/test/process/merge_opportunity.yml index e9027e228d7..a85372bdf7b 100644 --- a/addons/crm/test/process/merge_opportunity.yml +++ b/addons/crm/test/process/merge_opportunity.yml @@ -1,5 +1,8 @@ - - 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. + 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. +- + !context + uid: 'crm_res_users_salesmanager' - !record {model: crm.lead, id: test_crm_lead_01}: type: 'lead' diff --git a/addons/crm/test/process/phonecalls.yml b/addons/crm/test/process/phonecalls.yml index a71bfc05e03..63df8ac89c2 100644 --- a/addons/crm/test/process/phonecalls.yml +++ b/addons/crm/test/process/phonecalls.yml @@ -1,5 +1,5 @@ - - Now, check the data with Salesman. + Salesman check the phone calls data. - !context uid: 'crm_res_users_salesman' diff --git a/addons/crm/test/ui/crm_access_group_users.yml b/addons/crm/test/ui/crm_access_group_users.yml index 194c202ef15..cc5be01ee85 100644 --- a/addons/crm/test/ui/crm_access_group_users.yml +++ b/addons/crm/test/ui/crm_access_group_users.yml @@ -1,5 +1,5 @@ - - Create a user as 'Salesmanager' + Create a user as 'Salesmanager' - !record {model: res.users, id: crm_res_users_salesmanager}: company_id: base.main_company diff --git a/addons/crm/test/ui/delete_lead.yml b/addons/crm/test/ui/delete_lead.yml index f68061ba6cd..10d2de82e7e 100644 --- a/addons/crm/test/ui/delete_lead.yml +++ b/addons/crm/test/ui/delete_lead.yml @@ -1,10 +1,8 @@ - - Sales manager can delete lead. + Sales manager Unlink the Lead. - !context uid: 'crm_res_users_salesmanager' -- - Sales manager Unlink the Lead. - !python {model: crm.lead}: | self.unlink(cr, uid, [ref("crm_case_4")]) From 49ef7d89a8b525acf59fd6f69d9131ec68e2d147 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 20 Feb 2013 15:02:27 +0530 Subject: [PATCH 13/88] [IMP] add yml file & add access rights in event bzr revid: fka@tinyerp.com-20130220093227-uf6oom9fginl2jdc --- addons/event/__openerp__.py | 2 +- addons/event/security/ir.model.access.csv | 2 ++ .../event/test/process/event_draft2done.yml | 5 +++++ addons/event/test/ui/event_users.yml | 20 +++++++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 addons/event/test/ui/event_users.yml diff --git a/addons/event/__openerp__.py b/addons/event/__openerp__.py index 54b77c82f69..e8ecb09bf03 100644 --- a/addons/event/__openerp__.py +++ b/addons/event/__openerp__.py @@ -52,7 +52,7 @@ Key Features 'email_template.xml', ], 'demo': ['event_demo.xml'], - 'test': ['test/process/event_draft2done.yml'], + 'test': ['test/ui/event_users.yml','test/process/event_draft2done.yml'], 'css': ['static/src/css/event.css'], 'installable': True, 'application': True, diff --git a/addons/event/security/ir.model.access.csv b/addons/event/security/ir.model.access.csv index b6cdc4c4ec6..0801b8306f0 100644 --- a/addons/event/security/ir.model.access.csv +++ b/addons/event/security/ir.model.access.csv @@ -6,3 +6,5 @@ access_event_registration,event.registration,model_event_registration,event.grou access_report_event_registration,report.event.registration,model_report_event_registration,event.group_event_user,1,1,1,1 access_event_event_portal,event.event,model_event_event,,1,0,0,0 access_event_registration_portal,event.registration,model_event_registration,,1,0,0,0 +access_event_partner,res.partner,model_res_partner,event.group_event_user,1,1,1,0 +access_mail_message,mail.message,mail.model_mail_message,event.group_event_user,1,1,1,0 diff --git a/addons/event/test/process/event_draft2done.yml b/addons/event/test/process/event_draft2done.yml index eb40340befd..e485cb5af6c 100644 --- a/addons/event/test/process/event_draft2done.yml +++ b/addons/event/test/process/event_draft2done.yml @@ -1,3 +1,8 @@ +- + give the access rights of Event user to organize an event and also do registration. +- + !context + uid: 'res_users_eventuser' - I want to organize an event, into this conference I should create two registration. diff --git a/addons/event/test/ui/event_users.yml b/addons/event/test/ui/event_users.yml new file mode 100644 index 00000000000..34564d6c433 --- /dev/null +++ b/addons/event/test/ui/event_users.yml @@ -0,0 +1,20 @@ +- + Create a user as 'Event manager' +- + !record {model: res.users, id: res_users_eventmanager}: + company_id: base.main_company + name: Event manager + login: em + password: em + groups_id: + - event.group_event_manager +- + Create a user as 'Event user' +- + !record {model: res.users, id: res_users_eventuser}: + company_id: base.main_company + name: User + login: eu + password: eu + groups_id: + - event.group_event_user \ No newline at end of file From 96ec54e330a394a9aa0b92faad7280ec97512f98 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 20 Feb 2013 18:45:24 +0530 Subject: [PATCH 14/88] [IMP] add yml file in purchase bzr revid: fka@tinyerp.com-20130220131524-joc0qyy5dfdc1o6j --- addons/purchase/__openerp__.py | 3 ++- addons/purchase/purchase_order_demo.yml | 5 +++++ addons/purchase/test/process/cancel_order.yml | 5 +++++ .../test/process/generate_invoice_from_reception.yml | 5 +++++ addons/purchase/test/process/merge_order.yml | 5 +++++ addons/purchase/test/ui/delete_order.yml | 5 +++++ 6 files changed, 27 insertions(+), 1 deletion(-) diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index a7c66344f4a..3f3acdf9f0f 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -67,6 +67,8 @@ Dashboard / Reports for Purchase Management will include: 'res_config_view.xml', ], 'test': [ + 'test/ui/purchase_users.yml', + 'purchase_order_demo.yml', 'test/process/cancel_order.yml', 'test/process/rfq2order2done.yml', 'test/process/generate_invoice_from_reception.yml', @@ -79,7 +81,6 @@ Dashboard / Reports for Purchase Management will include: 'test/ui/delete_order.yml', ], 'demo': [ - 'purchase_order_demo.yml', 'purchase_demo.xml', ], 'installable': True, diff --git a/addons/purchase/purchase_order_demo.yml b/addons/purchase/purchase_order_demo.yml index 9c83ff84406..fb49bfc1248 100644 --- a/addons/purchase/purchase_order_demo.yml +++ b/addons/purchase/purchase_order_demo.yml @@ -1,3 +1,8 @@ +- + Give access rights of Purchase user to create purchase order +- + !context + uid: 'res_users_purchase_user' - !record {model: purchase.order, id: purchase_order_1}: partner_id: base.res_partner_1 diff --git a/addons/purchase/test/process/cancel_order.yml b/addons/purchase/test/process/cancel_order.yml index 80fd7b5ff57..d3695cba6c8 100644 --- a/addons/purchase/test/process/cancel_order.yml +++ b/addons/purchase/test/process/cancel_order.yml @@ -1,3 +1,8 @@ +- + Purchase user can also cancel order therfore test with that user which have Purchase user rights. +- + !context + uid: 'res_users_purchase_user' - In order to test the cancel flow, I start it from canceling confirmed purchase order. - diff --git a/addons/purchase/test/process/generate_invoice_from_reception.yml b/addons/purchase/test/process/generate_invoice_from_reception.yml index 6390413b418..565f52f258f 100644 --- a/addons/purchase/test/process/generate_invoice_from_reception.yml +++ b/addons/purchase/test/process/generate_invoice_from_reception.yml @@ -1,3 +1,8 @@ +- + Purchase user can create an invoice for order on receptions therfore test with that user which have Purchase user rights. +- + !context + uid: 'res_users_purchase_user' - I confirm another order where invoice control is 'Bases on incoming shipments'. - diff --git a/addons/purchase/test/process/merge_order.yml b/addons/purchase/test/process/merge_order.yml index fb39bed310c..fdc7f0092e7 100644 --- a/addons/purchase/test/process/merge_order.yml +++ b/addons/purchase/test/process/merge_order.yml @@ -1,3 +1,8 @@ +- + Give access rights of Purchase user to merge two RFQ. +- + !context + uid: 'res_users_purchase_user' - In order to merge RFQ, I merge two RFQ which has same supplier and check new merged order. - diff --git a/addons/purchase/test/ui/delete_order.yml b/addons/purchase/test/ui/delete_order.yml index f8795007622..6f9ba54e89d 100644 --- a/addons/purchase/test/ui/delete_order.yml +++ b/addons/purchase/test/ui/delete_order.yml @@ -1,3 +1,8 @@ +- + Give access rights of Purchase user to delete purchase order +- + !context + uid: 'res_users_purchase_user' - In order to test to delete process on purchase order. - From 5252d9ac9cdf02f6a405bbe041cb54e62d7d4428 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 21 Feb 2013 10:44:59 +0530 Subject: [PATCH 15/88] [IMP] add yml file in purchase_reqisition bzr revid: fka@tinyerp.com-20130221051459-v20ilhc128ipw6yi --- addons/purchase/test/ui/purchase_users.yml | 20 +++++++++++++++++++ addons/purchase_requisition/__openerp__.py | 1 + .../test/cancel_purchase_requisition.yml | 5 +++++ .../test/purchase_reqisition_users.yml | 20 +++++++++++++++++++ .../test/purchase_requisition.yml | 5 +++++ .../test/purchase_requisition_demo.yml | 5 +++++ 6 files changed, 56 insertions(+) create mode 100644 addons/purchase/test/ui/purchase_users.yml create mode 100644 addons/purchase_requisition/test/purchase_reqisition_users.yml diff --git a/addons/purchase/test/ui/purchase_users.yml b/addons/purchase/test/ui/purchase_users.yml new file mode 100644 index 00000000000..e36d8140d28 --- /dev/null +++ b/addons/purchase/test/ui/purchase_users.yml @@ -0,0 +1,20 @@ +- + Create a user as 'Purchase manager' +- + !record {model: res.users, id: res_users_purchase_manager}: + company_id: base.main_company + name: Purchase Manager + login: pm + password: pm + groups_id: + - purchase.group_purchase_manager +- + Create a user as 'Purchase user' +- + !record {model: res.users, id: res_users_purchase_user}: + company_id: base.main_company + name: Purchase User + login: pu + password: pu + groups_id: + - purchase.group_purchase_user \ No newline at end of file diff --git a/addons/purchase_requisition/__openerp__.py b/addons/purchase_requisition/__openerp__.py index 2ba0ad95e09..d2a94365318 100644 --- a/addons/purchase_requisition/__openerp__.py +++ b/addons/purchase_requisition/__openerp__.py @@ -43,6 +43,7 @@ keep track and order all your purchase orders. ], 'auto_install': False, 'test': [ + 'test/purchase_reqisition_users.yml', 'test/purchase_requisition_demo.yml', 'test/purchase_requisition.yml', 'test/cancel_purchase_requisition.yml', diff --git a/addons/purchase_requisition/test/cancel_purchase_requisition.yml b/addons/purchase_requisition/test/cancel_purchase_requisition.yml index 389c328a5cf..a865cb0548a 100644 --- a/addons/purchase_requisition/test/cancel_purchase_requisition.yml +++ b/addons/purchase_requisition/test/cancel_purchase_requisition.yml @@ -1,3 +1,8 @@ +- + Give access rights of Purchase Requisition User to cancelled requisition +- + !context + uid: 'res_users_purchase_requisition_user' - I cancel requisition. - diff --git a/addons/purchase_requisition/test/purchase_reqisition_users.yml b/addons/purchase_requisition/test/purchase_reqisition_users.yml new file mode 100644 index 00000000000..aa07e8a53f1 --- /dev/null +++ b/addons/purchase_requisition/test/purchase_reqisition_users.yml @@ -0,0 +1,20 @@ +- + Create a user as 'Purchase Reqisition Manager' +- + !record {model: res.users, id: res_users_purchase_requisition_manager}: + company_id: base.main_company + name: Purchase Reqisition Manager + login: prm + password: prm + groups_id: + - purchase_reqisition.group_purchase_requisition_manager +- + Create a user as 'Purchase Reqisition User' +- + !record {model: res.users, id: res_users_purchase_requisition_user}: + company_id: base.main_company + name: Purchase Reqisition User + login: pru + password: pru + groups_id: + - purchase_reqisition.group_purchase_requisition_user \ No newline at end of file diff --git a/addons/purchase_requisition/test/purchase_requisition.yml b/addons/purchase_requisition/test/purchase_requisition.yml index 8fd36e07d71..5477f46e18b 100644 --- a/addons/purchase_requisition/test/purchase_requisition.yml +++ b/addons/purchase_requisition/test/purchase_requisition.yml @@ -1,3 +1,8 @@ +- + Give access rights of Purchase Requisition User +- + !context + uid: 'res_users_purchase_requisition_user' - I create the procurement order and run that procurement. - diff --git a/addons/purchase_requisition/test/purchase_requisition_demo.yml b/addons/purchase_requisition/test/purchase_requisition_demo.yml index 5e441f26ea3..8265e6c72da 100755 --- a/addons/purchase_requisition/test/purchase_requisition_demo.yml +++ b/addons/purchase_requisition/test/purchase_requisition_demo.yml @@ -1,3 +1,8 @@ +- + Give access rights of Purchase Requisition User to create requisition +- + !context + uid: 'res_users_purchase_requisition_user' - In order to test process of the purchase requisition ,I create requisition - From 56cb7db019b771014a0a62a5b8824abe241022b4 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Thu, 21 Feb 2013 10:59:58 +0530 Subject: [PATCH 16/88] [IMP]improve yml for account bzr revid: sgo@tinyerp.com-20130221052958-metvr090gsubdc5u --- addons/account/__openerp__.py | 1 + addons/account/security/account_security.xml | 2 +- .../account/test/account_customer_invoice.yml | 5 +++++ addons/account/test/account_invoice_state.yml | 5 +++++ addons/account/test/account_test_users.yml | 20 +++++++++++++++++++ .../test/account_validate_account_move.yml | 5 +++++ 6 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 addons/account/test/account_test_users.yml diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 43aaa2f58c1..d72711424f2 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -146,6 +146,7 @@ for a particular financial year and for preparation of vouchers there is a modul 'account_unit_test.xml', ], 'test': [ + 'test/account_test_users.yml', 'test/account_customer_invoice.yml', 'test/account_supplier_invoice.yml', 'test/account_change_currency.yml', diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml index 9a2383de45b..c86e1cf5eb6 100644 --- a/addons/account/security/account_security.xml +++ b/addons/account/security/account_security.xml @@ -12,7 +12,7 @@ Accountant - + diff --git a/addons/account/test/account_customer_invoice.yml b/addons/account/test/account_customer_invoice.yml index b2d87e753de..866e8921220 100644 --- a/addons/account/test/account_customer_invoice.yml +++ b/addons/account/test/account_customer_invoice.yml @@ -11,6 +11,11 @@ footer: True bank: base.res_bank_1 bank_name: Reserve +- + Test with that user which have rights to make Invoicing and payment and who is accountant. +- + !context + uid: 'res_users_account_user' - I create a customer invoice - diff --git a/addons/account/test/account_invoice_state.yml b/addons/account/test/account_invoice_state.yml index 7b995150af0..34ac53e7b85 100644 --- a/addons/account/test/account_invoice_state.yml +++ b/addons/account/test/account_invoice_state.yml @@ -1,3 +1,8 @@ +- + Test with that user which have rights to make Invoicing. +- + !context + uid: 'res_users_account_user' - In order to test Confirm Draft Invoice wizard I create an invoice and confirm it with this wizard - diff --git a/addons/account/test/account_test_users.yml b/addons/account/test/account_test_users.yml new file mode 100644 index 00000000000..55e57968f50 --- /dev/null +++ b/addons/account/test/account_test_users.yml @@ -0,0 +1,20 @@ +- + Create a user as 'Accountant' +- + !record {model: res.users, id: res_users_account_user}: + company_id: base.main_company + name: Accountant + login: acc + password: acc + groups_id: + - account.group_account_user +- + Create a user as 'Financial Manager' +- + !record {model: res.users, id: res_users_account_manager}: + company_id: base.main_company + name: Financial Manager + login: fm + password: fm + groups_id: + - account.group_account_manager \ No newline at end of file diff --git a/addons/account/test/account_validate_account_move.yml b/addons/account/test/account_validate_account_move.yml index d47ee564019..a99ae3b4d43 100644 --- a/addons/account/test/account_validate_account_move.yml +++ b/addons/account/test/account_validate_account_move.yml @@ -1,3 +1,8 @@ +- + Test validate account move with user who is accountant which have its rights.' +- + !context + uid: 'res_users_account_user' - In order to test the account move lines in OpenERP, I create account move - From c7a417ea03e80da6f8895f6514d00d17362450e0 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 21 Feb 2013 11:47:37 +0530 Subject: [PATCH 17/88] [IMP] improve code bzr revid: fka@tinyerp.com-20130221061737-d7vyr9lpwnas1qay --- addons/purchase/__openerp__.py | 4 ++-- .../purchase_requisition/security/purchase_tender.xml | 1 + .../test/purchase_reqisition_users.yml | 4 ++-- .../purchase_requisition/test/purchase_requisition.yml | 10 +++++----- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index 3f3acdf9f0f..b75c84e332b 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -67,8 +67,6 @@ Dashboard / Reports for Purchase Management will include: 'res_config_view.xml', ], 'test': [ - 'test/ui/purchase_users.yml', - 'purchase_order_demo.yml', 'test/process/cancel_order.yml', 'test/process/rfq2order2done.yml', 'test/process/generate_invoice_from_reception.yml', @@ -81,6 +79,8 @@ Dashboard / Reports for Purchase Management will include: 'test/ui/delete_order.yml', ], 'demo': [ + 'test/ui/purchase_users.yml', + 'purchase_order_demo.yml', 'purchase_demo.xml', ], 'installable': True, diff --git a/addons/purchase_requisition/security/purchase_tender.xml b/addons/purchase_requisition/security/purchase_tender.xml index e60665e202b..f365643a8fe 100644 --- a/addons/purchase_requisition/security/purchase_tender.xml +++ b/addons/purchase_requisition/security/purchase_tender.xml @@ -10,6 +10,7 @@ User + diff --git a/addons/purchase_requisition/test/purchase_reqisition_users.yml b/addons/purchase_requisition/test/purchase_reqisition_users.yml index aa07e8a53f1..abf62286998 100644 --- a/addons/purchase_requisition/test/purchase_reqisition_users.yml +++ b/addons/purchase_requisition/test/purchase_reqisition_users.yml @@ -7,7 +7,7 @@ login: prm password: prm groups_id: - - purchase_reqisition.group_purchase_requisition_manager + - purchase_requisition.group_purchase_requisition_manager - Create a user as 'Purchase Reqisition User' - @@ -17,4 +17,4 @@ login: pru password: pru groups_id: - - purchase_reqisition.group_purchase_requisition_user \ No newline at end of file + - purchase_requisition.group_purchase_requisition_user \ No newline at end of file diff --git a/addons/purchase_requisition/test/purchase_requisition.yml b/addons/purchase_requisition/test/purchase_requisition.yml index 5477f46e18b..648425829cb 100644 --- a/addons/purchase_requisition/test/purchase_requisition.yml +++ b/addons/purchase_requisition/test/purchase_requisition.yml @@ -1,8 +1,3 @@ -- - Give access rights of Purchase Requisition User -- - !context - uid: 'res_users_purchase_requisition_user' - I create the procurement order and run that procurement. - @@ -35,6 +30,11 @@ assert line.product_id.id == procurement.product_id.id, "Product is not correspond." assert line.product_uom_id.id == procurement.product_uom.id, "UOM is not correspond." assert line.product_qty == procurement.product_qty, "Quantity is not correspond." +- + Give access rights of Purchase Requisition User to open requisition +- + !context + uid: 'res_users_purchase_requisition_user' - I open another requisition. - From 12701f01a66944f37d21616ad24ffbcbb48455f6 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Thu, 21 Feb 2013 12:19:44 +0530 Subject: [PATCH 18/88] [IMP]add manager in supplier invoice yml bzr revid: sgo@tinyerp.com-20130221064944-zhgumhtnum6z21jz --- addons/account/test/account_supplier_invoice.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/account/test/account_supplier_invoice.yml b/addons/account/test/account_supplier_invoice.yml index 02c3d367050..e1528abd980 100644 --- a/addons/account/test/account_supplier_invoice.yml +++ b/addons/account/test/account_supplier_invoice.yml @@ -1,3 +1,8 @@ +- + Test with that Finance manager who can only create supplier invoice. +- + !context + uid: 'res_users_account_manager' - In order to test account invoice I create a new supplier invoice - From 794926267e07eb14e73ce3b9845e61e0910cd6d1 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 21 Feb 2013 12:31:28 +0530 Subject: [PATCH 19/88] [IMP] add hr_users.yml in hr bzr revid: fka@tinyerp.com-20130221070128-bycahqtp3sqjm06d --- addons/hr/__openerp__.py | 1 + addons/hr/test/hr_demo.yml | 5 ++++ addons/hr/test/hr_users.yml | 30 +++++++++++++++++++++++ addons/hr/test/open2recruit2close_job.yml | 5 ++++ 4 files changed, 41 insertions(+) create mode 100644 addons/hr/test/hr_users.yml diff --git a/addons/hr/__openerp__.py b/addons/hr/__openerp__.py index b4b8e982845..001933ad2bf 100644 --- a/addons/hr/__openerp__.py +++ b/addons/hr/__openerp__.py @@ -62,6 +62,7 @@ You can manage: ], 'demo': ['hr_demo.xml'], 'test': [ + 'test/hr_users.yml', 'test/open2recruit2close_job.yml', 'test/hr_demo.yml', ], diff --git a/addons/hr/test/hr_demo.yml b/addons/hr/test/hr_demo.yml index 7c184a25c52..c9de2e4ff21 100644 --- a/addons/hr/test/hr_demo.yml +++ b/addons/hr/test/hr_demo.yml @@ -1,3 +1,8 @@ +- + give the access rights of Hr Officer to create employee. +- + !context + uid: 'res_users_hr_officer' - !record {model: hr.job, id: job_developer, view: False}: no_of_employee: 0.0 diff --git a/addons/hr/test/hr_users.yml b/addons/hr/test/hr_users.yml new file mode 100644 index 00000000000..3415b20efbd --- /dev/null +++ b/addons/hr/test/hr_users.yml @@ -0,0 +1,30 @@ +- + Create a user as 'HR Manager' +- + !record {model: res.users, id: res_users_hr_manager}: + company_id: base.main_company + name: HR manager + login: hrm + password: hrm + groups_id: + - base.group_hr_manager +- + Create a user as 'HR Officer' +- + !record {model: res.users, id: res_users_hr_officer}: + company_id: base.main_company + name: HR Officer + login: hro + password: hro + groups_id: + - base.group_hr_user +- + Create a user as 'Employee' +- + !record {model: res.users, id: res_users_employee}: + company_id: base.main_company + name: Employee + login: emp + password: emp + groups_id: + - base.group_user \ No newline at end of file diff --git a/addons/hr/test/open2recruit2close_job.yml b/addons/hr/test/open2recruit2close_job.yml index 5a01b55439b..66fdfa393c8 100644 --- a/addons/hr/test/open2recruit2close_job.yml +++ b/addons/hr/test/open2recruit2close_job.yml @@ -1,3 +1,8 @@ +- + give the access rights of Hr Officer to the user to test the process of Human Resource Management. +- + !context + uid: 'res_users_hr_officer' - In order to test the process of Human Resource Management, I open Job Postion for "Developer". - From d9d8abd8b0960c26a63b2cce783fbde03a5dbca6 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 21 Feb 2013 14:33:00 +0530 Subject: [PATCH 20/88] [IMP] add access rights in hr_attendance bzr revid: fka@tinyerp.com-20130221090300-is57aytddja1m4f5 --- addons/hr_attendance/test/attendance_process.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/addons/hr_attendance/test/attendance_process.yml b/addons/hr_attendance/test/attendance_process.yml index 7902bf11d9d..9f197341b55 100644 --- a/addons/hr_attendance/test/attendance_process.yml +++ b/addons/hr_attendance/test/attendance_process.yml @@ -1,3 +1,18 @@ +- + Create a user as 'HR Attendance Officer' +- + !record {model: res.users, id: res_users_attendance_officer}: + company_id: base.main_company + name: HR Officer + login: ao + password: ao + groups_id: + - base.group_hr_user +- + give the access rights of Hr Officer to test attendance process. +- + !context + uid: 'res_users_attendance_officer' - In order to test attendance process in OpenERP, I entry of SignIn of employee. - From 8d7669d0ade7ccd7e6cef7b0630bac6cb6dbf729 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 21 Feb 2013 16:09:22 +0530 Subject: [PATCH 21/88] [IMP] add access rights in hr_recruitment bzr revid: fka@tinyerp.com-20130221103922-tczeru30rer8ae6e --- .../security/hr_recruitment_security.xml | 3 +++ .../hr_recruitment/test/recruitment_process.yml | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/addons/hr_recruitment/security/hr_recruitment_security.xml b/addons/hr_recruitment/security/hr_recruitment_security.xml index 570b0f036cd..a85643b62ec 100644 --- a/addons/hr_recruitment/security/hr_recruitment_security.xml +++ b/addons/hr_recruitment/security/hr_recruitment_security.xml @@ -9,6 +9,9 @@ ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + + + diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index f2d4e4736fa..0359f253dd9 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -1,5 +1,18 @@ - - In Order to test process of Recruitment, + Create a user as 'HR Recruitment Officer' +- + !record {model: res.users, id: res_users_hr_officer}: + company_id: base.main_company + name: HR Officer + login: hrro + password: hrro + groups_id: + - base.group_hr_user +- + In Order to test process of Recruitment so giving HR officer's rights, +- + !context + uid: 'res_users_hr_officer' - An applicant is interested in the job position. So he sends a resume by email. - From fa94d5e112bb7dcce1d53fb80f6af3a25838e5d3 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Thu, 21 Feb 2013 16:47:28 +0530 Subject: [PATCH 22/88] [IMP]improve yml for account_voucher bzr revid: sgo@tinyerp.com-20130221111728-jlvv0lf5w258ujbz --- addons/account_voucher/__openerp__.py | 1 + .../account_voucher/test/account_voucher.yml | 6 ++++++ .../test/account_voucher_users.yml | 20 +++++++++++++++++++ addons/account_voucher/test/case_eur_usd.yml | 5 +++++ addons/account_voucher/test/sales_payment.yml | 5 +++++ addons/account_voucher/test/sales_receipt.yml | 5 +++++ 6 files changed, 42 insertions(+) create mode 100644 addons/account_voucher/test/account_voucher_users.yml diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py index 345c3378aa0..a6cbc9a3e40 100644 --- a/addons/account_voucher/__openerp__.py +++ b/addons/account_voucher/__openerp__.py @@ -61,6 +61,7 @@ This module manages: 'account_voucher_data.xml', ], 'test' : [ + 'test/account_voucher_users.yml', 'test/case5_suppl_usd_usd.yml', 'test/account_voucher.yml', 'test/sales_receipt.yml', diff --git a/addons/account_voucher/test/account_voucher.yml b/addons/account_voucher/test/account_voucher.yml index c9270dc695c..e2df6b8597f 100644 --- a/addons/account_voucher/test/account_voucher.yml +++ b/addons/account_voucher/test/account_voucher.yml @@ -1,3 +1,9 @@ +- + I check the voucher module with user who is accountant. +- + !context + uid: 'res_users_account_voucher_user' + - In order to check account voucher module in OpenERP I create a customer voucher - diff --git a/addons/account_voucher/test/account_voucher_users.yml b/addons/account_voucher/test/account_voucher_users.yml new file mode 100644 index 00000000000..e8a4fa3e612 --- /dev/null +++ b/addons/account_voucher/test/account_voucher_users.yml @@ -0,0 +1,20 @@ +- + Create a user as 'Accountant for voucher' +- + !record {model: res.users, id: res_users_account_voucher_user}: + company_id: base.main_company + name: Voucher Accountant + login: vacc + password: acc + groups_id: + - account.group_account_user +- + Create a user as 'Financial Manager for account voucher' +- + !record {model: res.users, id: res_users_account_voucher_manager}: + company_id: base.main_company + name: Financial Manager for voucher + login: fmv + password: fmv + groups_id: + - account.group_account_manager \ No newline at end of file diff --git a/addons/account_voucher/test/case_eur_usd.yml b/addons/account_voucher/test/case_eur_usd.yml index 94f0c718980..23a35d8ad24 100644 --- a/addons/account_voucher/test/case_eur_usd.yml +++ b/addons/account_voucher/test/case_eur_usd.yml @@ -1,4 +1,9 @@ ##YAML test on the account_voucher as depicted in this bug report: https://bugs.launchpad.net/openobject-addons/+bug/954155 +- + Only manager can create and take decision about bank and currency there I checkd this test with user who is finance manager. +- + !context + uid: 'res_users_account_voucher_manager' - In order to check the payment with multi-currency in OpenERP, I create an invoice in EUR and make payment in USD based on the currency rating. diff --git a/addons/account_voucher/test/sales_payment.yml b/addons/account_voucher/test/sales_payment.yml index 37264de114a..005c5cc79c3 100644 --- a/addons/account_voucher/test/sales_payment.yml +++ b/addons/account_voucher/test/sales_payment.yml @@ -1,3 +1,8 @@ +- + I test sales payment with user who is accountant. +- + !context + uid: 'res_users_account_voucher_user' - Create an invoice for the partner Seagate with amount 450.0 - diff --git a/addons/account_voucher/test/sales_receipt.yml b/addons/account_voucher/test/sales_receipt.yml index dc5602753fd..c637cfd8835 100644 --- a/addons/account_voucher/test/sales_receipt.yml +++ b/addons/account_voucher/test/sales_receipt.yml @@ -1,3 +1,8 @@ +- + Accountant can also be created receipt and validate it there for I checked it with that user who is accountant. +- + !context + uid: 'res_users_account_voucher_user' - Creating a Voucher Receipt for partner Seagate with amount 30000.0 - From edc4077c54ba215228036a4316706e07a094b5df Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 22 Feb 2013 12:57:57 +0530 Subject: [PATCH 23/88] [IMP] remove access rights in mail,crm,event bzr revid: fka@tinyerp.com-20130222072757-0fain23pzyb8dzk9 --- addons/crm/security/crm_security.xml | 1 + addons/crm/security/ir.model.access.csv | 2 -- addons/event/security/event_security.xml | 1 + addons/event/security/ir.model.access.csv | 2 -- addons/mail/security/ir.model.access.csv | 6 +++--- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/addons/crm/security/crm_security.xml b/addons/crm/security/crm_security.xml index 2c34252209c..97bc220cf04 100644 --- a/addons/crm/security/crm_security.xml +++ b/addons/crm/security/crm_security.xml @@ -5,6 +5,7 @@ User: Own Leads Only + the user will have access to his own data in the sales application. diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv index cd460cf35d9..74394d3c5ce 100644 --- a/addons/crm/security/ir.model.access.csv +++ b/addons/crm/security/ir.model.access.csv @@ -29,8 +29,6 @@ access_calendar_attendee_crm_manager,calendar.attendee.crm.manager,model_calenda access_res_partner,res.partner.crm.user,base.model_res_partner,base.group_sale_salesman,1,1,1,0 access_res_partner_category,res.partner.category.crm.user,base.model_res_partner_category,base.group_sale_salesman,1,1,1,0 mail_mailgate_thread,mail.thread,mail.model_mail_thread,base.group_sale_salesman,1,1,1,1 -access_mail_message,mail.message,mail.model_mail_message,base.group_sale_salesman,1,1,1,0 -mail_mail_message,mail.message,mail.model_mail_message,base.group_sale_manager,1,1,1,1 access_crm_case_categ_manager,crm.case.categ manager,model_crm_case_categ,base.group_sale_manager,1,1,1,1 access_base_action_rule_manager,base.action.rule manager,base_action_rule.model_base_action_rule,base.group_sale_manager,1,1,1,1 access_crm_lead_report_user,crm.lead.report user,model_crm_lead_report,base.group_sale_salesman,1,1,1,1 diff --git a/addons/event/security/event_security.xml b/addons/event/security/event_security.xml index 83039ca4686..470365dd5f0 100644 --- a/addons/event/security/event_security.xml +++ b/addons/event/security/event_security.xml @@ -10,6 +10,7 @@ User + diff --git a/addons/event/security/ir.model.access.csv b/addons/event/security/ir.model.access.csv index 0801b8306f0..b6cdc4c4ec6 100644 --- a/addons/event/security/ir.model.access.csv +++ b/addons/event/security/ir.model.access.csv @@ -6,5 +6,3 @@ access_event_registration,event.registration,model_event_registration,event.grou access_report_event_registration,report.event.registration,model_report_event_registration,event.group_event_user,1,1,1,1 access_event_event_portal,event.event,model_event_event,,1,0,0,0 access_event_registration_portal,event.registration,model_event_registration,,1,0,0,0 -access_event_partner,res.partner,model_res_partner,event.group_event_user,1,1,1,0 -access_mail_message,mail.message,mail.model_mail_message,event.group_event_user,1,1,1,0 diff --git a/addons/mail/security/ir.model.access.csv b/addons/mail/security/ir.model.access.csv index 81b2356938b..1141a3f928d 100644 --- a/addons/mail/security/ir.model.access.csv +++ b/addons/mail/security/ir.model.access.csv @@ -1,18 +1,18 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_mail_message_all,mail.message.all,model_mail_message,,1,0,0,0 access_mail_message_user,mail.message.user,model_mail_message,base.group_user,1,1,1,1 -access_mail_mail_all,mail.mail.all,model_mail_mail,,1,0,1,0 +access_mail_mail_all,mail.mail.all,model_mail_mail,,1,0,0,0 access_mail_mail_user,mail.mail.user,model_mail_mail,base.group_user,1,1,1,0 access_mail_mail_system,mail.mail.system,model_mail_mail,base.group_system,1,1,1,1 access_mail_followers_all,mail.followers.all,model_mail_followers,,1,0,0,0 access_mail_followers_user,mail.followers.user,model_mail_followers,base.group_user,1,1,0,0 access_mail_followers_system,mail.followers.system,model_mail_followers,base.group_system,1,1,1,1 -access_mail_notification_all,mail.notification.all,model_mail_notification,,1,0,1,0 +access_mail_notification_all,mail.notification.all,model_mail_notification,,1,0,0,0 access_mail_notification_user,mail.notification.user,model_mail_notification,base.group_user,1,1,1,0 access_mail_notification_system,mail.notification.system,model_mail_notification,base.group_system,1,1,1,1 access_mail_group_all,mail.group.all,model_mail_group,,1,0,0,0 access_mail_group_user,mail.group.user,model_mail_group,base.group_user,1,1,1,1 -access_mail_alias_all,mail.alias.all,model_mail_alias,,1,0,1,0 +access_mail_alias_all,mail.alias.all,model_mail_alias,,1,0,0,0 access_mail_alias_user,mail.alias.user,model_mail_alias,base.group_user,1,1,1,0 access_mail_alias_system,mail.alias.system,model_mail_alias,base.group_system,1,1,1,1 access_mail_message_subtype_all,mail.message.subtype.all,model_mail_message_subtype,,1,0,0,0 From bf814eb41456d692cb166581dcbda13980ecadd6 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 22 Feb 2013 15:03:15 +0530 Subject: [PATCH 24/88] [IMP] improve yml string bzr revid: fka@tinyerp.com-20130222093315-efl5r3wjwn7wu2nd --- addons/crm/test/process/cancel_lead.yml | 2 +- addons/crm/test/process/communication_with_customer.yml | 2 +- addons/crm/test/process/lead2opportunity2win.yml | 2 +- addons/crm/test/process/lead2opportunity_assign_salesmen.yml | 2 +- addons/crm/test/process/phonecalls.yml | 2 +- addons/crm/test/ui/delete_lead.yml | 2 +- addons/event/test/process/event_draft2done.yml | 2 +- addons/hr/test/hr_demo.yml | 2 +- addons/hr/test/open2recruit2close_job.yml | 2 +- addons/hr_attendance/test/attendance_process.yml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/crm/test/process/cancel_lead.yml b/addons/crm/test/process/cancel_lead.yml index ae2b6294c68..bbd17dc2bb0 100644 --- a/addons/crm/test/process/cancel_lead.yml +++ b/addons/crm/test/process/cancel_lead.yml @@ -1,5 +1,5 @@ - - Salesman cancel unqualified lead. + Salesman can also cancelled unqualified lead and re-open lead so giving access rights of salesman. - !context uid: 'crm_res_users_salesman' diff --git a/addons/crm/test/process/communication_with_customer.yml b/addons/crm/test/process/communication_with_customer.yml index 4a36aeebd02..8cce69dada9 100644 --- a/addons/crm/test/process/communication_with_customer.yml +++ b/addons/crm/test/process/communication_with_customer.yml @@ -1,5 +1,5 @@ - - Salesman communication with customer. + Give the access rights of Salesman to communicat with customer. - !context uid: 'crm_res_users_salesman' diff --git a/addons/crm/test/process/lead2opportunity2win.yml b/addons/crm/test/process/lead2opportunity2win.yml index c69eb09ac31..1e42fba0e9c 100644 --- a/addons/crm/test/process/lead2opportunity2win.yml +++ b/addons/crm/test/process/lead2opportunity2win.yml @@ -1,5 +1,5 @@ - - Salesman convert the lead into opportunity. + Giving access rights of salesman to convert the lead into opportunity. - !context uid: 'crm_res_users_salesman' diff --git a/addons/crm/test/process/lead2opportunity_assign_salesmen.yml b/addons/crm/test/process/lead2opportunity_assign_salesmen.yml index 9583c6034bf..5a750c94b72 100644 --- a/addons/crm/test/process/lead2opportunity_assign_salesmen.yml +++ b/addons/crm/test/process/lead2opportunity_assign_salesmen.yml @@ -21,7 +21,7 @@ login: 'tud' new_password: 'tud' - - Salesman creates lead. + Salesman also creates lead so giving access rights of salesman. - !context uid: 'crm_res_users_salesman' diff --git a/addons/crm/test/process/phonecalls.yml b/addons/crm/test/process/phonecalls.yml index 63df8ac89c2..e92ae999a87 100644 --- a/addons/crm/test/process/phonecalls.yml +++ b/addons/crm/test/process/phonecalls.yml @@ -1,5 +1,5 @@ - - Salesman check the phone calls data. + Salesman check the phone calls data so test with the access rights of salesman. - !context uid: 'crm_res_users_salesman' diff --git a/addons/crm/test/ui/delete_lead.yml b/addons/crm/test/ui/delete_lead.yml index 10d2de82e7e..be545e53773 100644 --- a/addons/crm/test/ui/delete_lead.yml +++ b/addons/crm/test/ui/delete_lead.yml @@ -1,5 +1,5 @@ - - Sales manager Unlink the Lead. + Only Sales manager Unlink the Lead so test with Manager's access rights'. - !context uid: 'crm_res_users_salesmanager' diff --git a/addons/event/test/process/event_draft2done.yml b/addons/event/test/process/event_draft2done.yml index e485cb5af6c..2ad762682e5 100644 --- a/addons/event/test/process/event_draft2done.yml +++ b/addons/event/test/process/event_draft2done.yml @@ -1,5 +1,5 @@ - - give the access rights of Event user to organize an event and also do registration. + Give the access rights of Event user to organize an event and also do registration. - !context uid: 'res_users_eventuser' diff --git a/addons/hr/test/hr_demo.yml b/addons/hr/test/hr_demo.yml index c9de2e4ff21..db0d0037c4a 100644 --- a/addons/hr/test/hr_demo.yml +++ b/addons/hr/test/hr_demo.yml @@ -1,5 +1,5 @@ - - give the access rights of Hr Officer to create employee. + Give the access rights of Hr Officer to create employee. - !context uid: 'res_users_hr_officer' diff --git a/addons/hr/test/open2recruit2close_job.yml b/addons/hr/test/open2recruit2close_job.yml index 66fdfa393c8..5519635d2fc 100644 --- a/addons/hr/test/open2recruit2close_job.yml +++ b/addons/hr/test/open2recruit2close_job.yml @@ -1,5 +1,5 @@ - - give the access rights of Hr Officer to the user to test the process of Human Resource Management. + Give the access rights of Hr Officer to the user to test the process of Human Resource Management. - !context uid: 'res_users_hr_officer' diff --git a/addons/hr_attendance/test/attendance_process.yml b/addons/hr_attendance/test/attendance_process.yml index 9f197341b55..8348757b63e 100644 --- a/addons/hr_attendance/test/attendance_process.yml +++ b/addons/hr_attendance/test/attendance_process.yml @@ -9,7 +9,7 @@ groups_id: - base.group_hr_user - - give the access rights of Hr Officer to test attendance process. + Give the access rights of Hr Officer to test attendance process. - !context uid: 'res_users_attendance_officer' From ca1bf8f8f71a9b88af89c8903199e9f4bd1356d1 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 22 Feb 2013 18:59:40 +0530 Subject: [PATCH 25/88] [IMP] add access rights of ir_property in crm bzr revid: fka@tinyerp.com-20130222132940-2r0kuv66ul3k3pdu --- addons/crm/security/ir.model.access.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv index 74394d3c5ce..3aada0d10be 100644 --- a/addons/crm/security/ir.model.access.csv +++ b/addons/crm/security/ir.model.access.csv @@ -37,3 +37,4 @@ access_crm_lead_partner_manager,crm.lead.partner.manager,model_crm_lead,base.gro access_crm_phonecall_partner_manager,crm.phonecall.partner.manager,model_crm_phonecall,base.group_partner_manager,1,1,1,1 access_crm_payment_mode_user,crm.payment.mode,model_crm_payment_mode,base.group_sale_salesman,1,0,0,0 access_crm_payment_mode,crm.payment.mode,model_crm_payment_mode,base.group_sale_manager,1,1,1,1 +access_ir_property_salesman,ir_property_salesman,base.model_ir_property,base.group_sale_salesman,1,1,1,0 From ffc81649c6c1948ac2f812cbe3b5c9175b160cd2 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 26 Feb 2013 15:20:17 +0530 Subject: [PATCH 26/88] [IMP]improve code bzr revid: sgo@tinyerp.com-20130226095017-f7bbnnqngszfq95r --- addons/account/security/account_security.xml | 2 +- addons/account/security/ir.model.access.csv | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/security/account_security.xml b/addons/account/security/account_security.xml index c86e1cf5eb6..9a2383de45b 100644 --- a/addons/account/security/account_security.xml +++ b/addons/account/security/account_security.xml @@ -12,7 +12,7 @@ Accountant - + diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index d1f0bbab6b5..d164b8026ce 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -71,6 +71,7 @@ access_report_account_type_sales,report.account_type.sales,model_report_account_ access_report_account_sales,report.account.sales,model_report_account_sales,account.group_account_manager,1,1,1,1 access_account_invoice_report,account.invoice.report,model_account_invoice_report,account.group_account_manager,1,1,1,1 access_res_partner_group_account_manager,res_partner group_account_manager,model_res_partner,account.group_account_manager,1,0,0,0 +access_res_partner_group_account_user,res_partner group_account_user,model_res_partner,account.group_account_user,1,1,1,0 access_account_invoice_accountant,account.invoice accountant,model_account_invoice,account.group_account_user,1,0,0,0 access_account_tax_code_accountant,account.tax.code accountant,model_account_tax_code,account.group_account_user,1,1,1,1 access_account_move_line_manager,account.move.line manager,model_account_move_line,account.group_account_manager,1,0,0,0 From 345845415d0e3a507cac078c4c5b887d7ab19213 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 28 Feb 2013 10:30:26 +0530 Subject: [PATCH 27/88] [IMP] change all data of stock yml bzr revid: fka@tinyerp.com-20130228050026-5yaf2ftrps77jlff --- addons/stock/__openerp__.py | 8 +- addons/stock/product.py | 5 +- addons/stock/stock.py | 1 - addons/stock/stock_demo.yml | 118 ++++++++++++++-------------- addons/stock/test/opening_stock.yml | 62 +++++++-------- addons/stock/test/shipment.yml | 103 ++++++++++++------------ 6 files changed, 146 insertions(+), 151 deletions(-) diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py index b3d7e30f1ce..e1c96ba0c25 100644 --- a/addons/stock/__openerp__.py +++ b/addons/stock/__openerp__.py @@ -59,7 +59,6 @@ Dashboard / Reports for Warehouse Management will include: 'sequence': 16, 'demo': [ 'stock_demo.xml', -# 'stock_demo.yml', ], 'data': [ 'security/stock_security.xml', @@ -91,9 +90,10 @@ Dashboard / Reports for Warehouse Management will include: 'res_config_view.xml', ], 'test': [ -# 'test/opening_stock.yml', -# 'test/shipment.yml', -# 'test/stock_report.yml', + 'stock_demo.yml', + 'test/opening_stock.yml', + 'test/shipment.yml', + #'test/stock_report.yml', ], 'installable': True, 'application': True, diff --git a/addons/stock/product.py b/addons/stock/product.py index 1d56ce64988..b00f8615667 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -55,15 +55,14 @@ class product_product(osv.osv): if context is None: context = {} product_obj = self.pool.get('product.product').browse(cr, uid, product_id, context=context) - stock_input_acc = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id or False if not stock_input_acc: stock_input_acc = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id or False - + stock_output_acc = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id or False if not stock_output_acc: stock_output_acc = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id or False - + journal_id = product_obj.categ_id.property_stock_journal and product_obj.categ_id.property_stock_journal.id or False account_valuation = product_obj.categ_id.property_stock_valuation_account_id and product_obj.categ_id.property_stock_valuation_account_id.id or False return { diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 8e4611dc5d0..ed2b36bd1f5 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2233,7 +2233,6 @@ class stock_move(osv.osv): acc_valuation = accounts.get('property_stock_valuation_account_id', False) journal_id = accounts['stock_journal'] - if acc_dest == acc_valuation: raise osv.except_osv(_('Error!'), _('Cannot create Journal Entry, Output Account of this product and Valuation account on category of this product are same.')) diff --git a/addons/stock/stock_demo.yml b/addons/stock/stock_demo.yml index 99565f0c08c..8e9ea4977b8 100644 --- a/addons/stock/stock_demo.yml +++ b/addons/stock/stock_demo.yml @@ -1,99 +1,97 @@ - - !record {model: stock.location, id: location_refrigerator}: - name: Refrigerator + !record {model: stock.location, id: location_monitor}: + name: chicago shop usage: internal - - !record {model: stock.location, id: location_delivery_counter}: - name: Delivery Counter + !record {model: stock.location, id: stock_location_output}: + name: Output usage: internal - - !record {model: stock.location, id: location_refrigerator_small}: - name: Small Refrigerator + !record {model: stock.location, id: location_monitor_small}: + name: Small chicago shop usage: internal - location_id: location_refrigerator + location_id: location_monitor - !record {model: stock.location, id: location_opening}: name: opening usage: inventory - - !record {model: stock.location, id: location_convenience_shop}: - name: Convenient Store + !record {model: stock.location, id: stock_location_3}: + name: IT Suppliers usage: supplier - - !record {model: stock.warehouse, id: warehouse_icecream}: - name: Ice Cream Shop - lot_input_id: location_refrigerator - lot_stock_id: location_refrigerator - lot_output_id: location_delivery_counter + !record {model: stock.warehouse, id: stock_warehouse_shop0}: + name: Chicago Warehouse + lot_input_id: location_monitor + lot_stock_id: location_monitor + lot_output_id: stock_location_output - - !record {model: product.product, id: product_icecream}: - default_code: 001 - name: Ice Cream - type: product - categ_id: product.product_category_1 - list_price: 100.0 - standard_price: 70.0 - uom_id: product.product_uom_kgm - uom_po_id: product.product_uom_kgm - procure_method: make_to_stock + !record {model: product.product, id: product_product_6}: + default_code: LCD15 + name: 15” LCD Monitor + type: consu + categ_id: product.product_category_8 + list_price: 1200.0 + standard_price: 800.0 + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit property_stock_inventory: location_opening valuation: real_time cost_method: average - property_stock_account_input: account.o_expense - property_stock_account_output: account.o_income - 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. - + property_stock_account_input: account.conf_o_expense + property_stock_account_output: account.conf_o_income - - !record {model: stock.production.lot, id: lot_icecream_0}: - name: Lot0 for Ice cream - product_id: product_icecream + !record {model: stock.production.lot, id: lot_monitor_0}: + name: Lot0 for LCD Monitor + product_id: product_product_6 - - !record {model: stock.production.lot, id: lot_icecream_1}: - name: Lot1 for Ice cream - product_id: product_icecream + !record {model: stock.production.lot, id: lot_monitor_1}: + name: Lot1 for LCD Monitor + product_id: product_product_6 - - !record {model: stock.inventory, id: stock_inventory_icecream}: - name: Inventory for icecream + !record {model: stock.inventory, id: stock_inventory_0}: + name: Starting Inventory + state: draft - - !record {model: stock.inventory.line, id: stock_inventory_line_icecream_lot0}: - product_id: product_icecream - product_uom: product.product_uom_kgm - inventory_id: stock_inventory_icecream + !record {model: stock.inventory.line, id: stock_inventory_line_3}: + product_id: product_product_6 + product_uom: product.product_uom_unit + inventory_id: stock_inventory_0 product_qty: 50.0 - prod_lot_id: lot_icecream_0 - location_id: location_refrigerator + prod_lot_id: lot_monitor_0 + location_id: location_monitor - - !record {model: stock.inventory.line, id: stock_inventory_line_icecream_lot1}: - product_id: product_icecream - product_uom: product.product_uom_kgm - inventory_id: stock_inventory_icecream + !record {model: stock.inventory.line, id: stock_inventory_line_monitor}: + product_id: product_product_6 + product_uom: product.product_uom_unit + inventory_id: stock_inventory_0 product_qty: 40.0 - prod_lot_id: lot_icecream_1 - location_id: location_refrigerator + prod_lot_id: lot_monitor_1 + location_id: location_monitor - !record {model: stock.picking, id: outgoing_shipment}: type: out - location_dest_id: location_delivery_counter + location_dest_id: stock_location_output - - !record {model: stock.move, id: outgoing_shipment_icecream}: + !record {model: stock.move, id: outgoing_shipment_monitor}: picking_id: outgoing_shipment - product_id: product_icecream - product_uom: product.product_uom_kgm + product_id: product_product_6 + product_uom: product.product_uom_unit product_qty: 130.0 - location_id: location_refrigerator - location_dest_id: location_delivery_counter + location_id: location_monitor + location_dest_id: stock_location_output - !record {model: stock.picking, id: incomming_shipment}: type: in invoice_state: 2binvoiced partner_id: base.res_partner_address_9 - location_dest_id: location_refrigerator + location_dest_id: location_monitor - - !record {model: stock.move, id: incomming_shipment_icecream}: + !record {model: stock.move, id: incomming_shipment_monitor}: picking_id: incomming_shipment - product_id: product_icecream - product_uom: product.product_uom_kgm + product_id: product_product_6 + product_uom: product.product_uom_unit product_qty: 50.0 - location_id: location_convenience_shop - location_dest_id: location_refrigerator + location_id: stock_location_3 + location_dest_id: location_monitor diff --git a/addons/stock/test/opening_stock.yml b/addons/stock/test/opening_stock.yml index 2e3eaeadc74..41b906e560c 100644 --- a/addons/stock/test/opening_stock.yml +++ b/addons/stock/test/opening_stock.yml @@ -1,42 +1,42 @@ - - I update the price of the Ice-cream. + I update the price of the 15” LCD Monitor. - !python {model: stock.change.standard.price}: | - context.update({'active_model':'product.product', 'active_id': ref('product_icecream'), 'active_ids':[ref('product_icecream')]}) + context.update({'active_model':'product.product', 'active_id': ref('product_product_6'), 'active_ids':[ref('product_product_6')]}) - !record {model: stock.change.standard.price, id: change_price}: - new_price: 120 + new_price: 1500 - !python {model: stock.change.standard.price}: | self.change_price(cr, uid, [ref('change_price')], context=context) - - I check price of Ice-cream after update price. + I check price of 15” LCD Monitor after update price. - !python {model: product.product}: | - product = self.browse(cr, uid, ref('product_icecream'), context=context) - assert product.standard_price == 120, "Price is not updated." + product = self.browse(cr, uid, ref('product_product_6'), context=context) + assert product.standard_price == 1500, "Price is not updated." - - I update the current stock of the Ice-cream with 10 kgm in Small Refrigerator in lot0. + I update the current stock of the 15” LCD Monitor with 10 unit in stock location shop1 in lot0. - !record {model: stock.change.product.qty, id: change_qty}: - location_id: location_refrigerator_small + location_id: location_monitor_small new_quantity: 10 - product_id: product_icecream - prodlot_id: lot_icecream_1 + product_id: product_product_6 + prodlot_id: lot_monitor_1 - !python {model: stock.change.product.qty}: | self.change_product_qty(cr, uid, [ref('change_qty')], context=context) - - I check available stock of Ice-cream after update stock. + I check available stock of 15” LCD Monitor after update stock. - !python {model: product.product}: | - product = self.browse(cr, uid, ref('product_icecream'), context=context) + product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.qty_available == 10, "Stock is not updated." - I merge inventory. - !python {model: stock.inventory.merge }: | - context.update({'active_model': 'stock.inventory', 'active_id': ref('stock_inventory_icecream'), 'active_ids': [ref('stock_inventory_icecream')]}) + context.update({'active_model': 'stock.inventory', 'active_id': ref('stock_inventory_0'), 'active_ids': [ref('stock_inventory_0')]}) - !record {model: stock.inventory.merge, id: merge_inventory}: - @@ -46,22 +46,22 @@ I cancel inventory. - !python {model: stock.inventory}: | - self.action_cancel_inventory(cr, uid, [ref('stock_inventory_icecream')]) + self.action_cancel_inventory(cr, uid, [ref('stock_inventory_0')]) - I reset to draft inventory. - !python {model: stock.inventory}: | - self.action_cancel_draft(cr, uid, [ref('stock_inventory_icecream')]) + self.action_cancel_draft(cr, uid, [ref('stock_inventory_0')]) - - I confirm physical inventory of Ice-cream which are came in different lots. + I confirm physical inventory of 15” LCD Monitor which are came in different lots. - !python {model: stock.inventory}: | - self.action_confirm(cr, uid, [ref('stock_inventory_icecream')], context=context) + self.action_confirm(cr, uid, [ref('stock_inventory_0')], context=context) - I check move details after confirmed physical inventory. - !python {model: stock.inventory}: | - inventory = self.browse(cr, uid, ref('stock_inventory_icecream'), context=context) + inventory = self.browse(cr, uid, ref('stock_inventory_0'), context=context) assert len(inventory.move_ids) == len(inventory.inventory_line_id), "moves are not correspond." for move_line in inventory.move_ids: for line in inventory.inventory_line_id: @@ -77,15 +77,15 @@ I split inventory line. - !python {model: stock.inventory.line.split}: | - context.update({'active_model': 'stock.inventory.line', 'active_id': ref('stock_inventory_line_icecream_lot0'), 'active_ids': [ref('stock_inventory_line_icecream_lot0')]}) + context.update({'active_model': 'stock.inventory.line', 'active_id': ref('stock_inventory_line_3'), 'active_ids': [ref('stock_inventory_line_3')]}) - !record {model: stock.inventory.line.split, id: split_inventory_lot0}: use_exist: True line_exist_ids: - quantity: 6 - prodlot_id: lot_icecream_0 + prodlot_id: lot_monitor_0 - quantity: 4 - prodlot_id: lot_icecream_0 + prodlot_id: lot_monitor_0 - !python {model: stock.inventory.line.split }: | self.split_lot(cr, uid, [ref('split_inventory_lot0')], context=context) @@ -93,39 +93,39 @@ I fill inventory line. - !python {model: stock.fill.inventory}: | - context.update({'active_model': 'stock.inventory', 'active_id': ref('stock_inventory_icecream'), 'active_ids': [ref('stock_inventory_icecream')]}) + context.update({'active_model': 'stock.inventory', 'active_id': ref('stock_inventory_0'), 'active_ids': [ref('stock_inventory_0')]}) - !record {model: stock.fill.inventory, id: fill_inventory}: - location_id: location_refrigerator + location_id: location_monitor recursive: True - !python {model: stock.fill.inventory }: | self.fill_inventory(cr, uid, [ref('fill_inventory')], context=context) - - Now I check vitual stock of Ice-cream after confirmed physical inventory. + Now I check vitual stock of 15” LCD Monitor after confirmed physical inventory. - !python {model: product.product}: | - product = self.browse(cr, uid, ref('product_icecream'), context=context) + product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.virtual_available == 100, "Vitual stock is not updated." - - I close physical inventory of Ice-cream. + I close physical inventory of 15” LCD Monitor. - !python {model: stock.inventory}: | - self.action_done(cr, uid, [ref('stock_inventory_icecream')], context=context) + self.action_done(cr, uid, [ref('stock_inventory_0')], context=context) - - I check closed move and real stock of Ice-cream after closed physical inventory. + I check closed move and real stock of 15” LCD Monitor after closed physical inventory. - !python {model: stock.inventory}: | - inventory = self.browse(cr, uid, ref('stock_inventory_icecream'), context=context) + inventory = self.browse(cr, uid, ref('stock_inventory_0'), context=context) assert inventory.state == 'done', "inventory is not closed." for move_line in inventory.move_ids: assert move_line.state == 'done', "Move is not closed." - product = self.pool.get('product.product').browse(cr, uid, ref('product_icecream'), context=context) + product = self.pool.get('product.product').browse(cr, uid, ref('product_product_6'), context=context) product.qty_available == 100, "Real stock is not updated." - I check stock in lot. - !python {model: stock.production.lot}: | - lot = self.browse(cr, uid, ref('lot_icecream_0'), context=context) + lot = self.browse(cr, uid, ref('lot_monitor_0'), context=context) assert lot.stock_available == 50, "Stock in lot is not correspond." diff --git a/addons/stock/test/shipment.yml b/addons/stock/test/shipment.yml index b30feccdacf..27d5c44d199 100644 --- a/addons/stock/test/shipment.yml +++ b/addons/stock/test/shipment.yml @@ -1,5 +1,5 @@ - - I confirm outgoing shipment of 130 kgm Ice-cream. + I confirm outgoing shipment of 130 unit 15” LCD Monitor. - !workflow {model: stock.picking, action: button_confirm, ref: outgoing_shipment} - @@ -12,18 +12,18 @@ assert move_line.state == "confirmed", "Move should be confirmed." - - Now I check vitual stock of Ice-cream after confirmed outgoing shipment. + Now I check vitual stock of 15” LCD Monitor after confirmed outgoing shipment. - !python {model: product.product}: | - product = self.browse(cr, uid, ref('product_icecream'), context=context) + product = self.browse(cr, uid, ref('product_product_6'), context=context) product.virtual_available == -30, "Vitual stock is not updated." - - I confirm incomming shipment of 50 kgm Ice-cream. + I confirm incomming shipment of 50 unit 15” LCD Monitor. - !workflow {model: stock.picking, action: button_confirm, ref: incomming_shipment} - - I receive 40kgm Ice-cream so I make backorder of incomming shipment for 40 kgm. + I receive 40 unit 15” LCD Monitor so I make backorder of incomming shipment for 40 unit. - !python {model: stock.partial.picking}: | context.update({'active_model': 'stock.picking', 'active_id': ref('incomming_shipment'), 'active_ids': [ref('incomming_shipment')]}) @@ -31,11 +31,11 @@ !record {model: stock.partial.picking, id: partial_incomming}: move_ids: - quantity: 40 - product_id: product_icecream - product_uom: product.product_uom_kgm - move_id: incomming_shipment_icecream - location_id: location_convenience_shop - location_dest_id: location_refrigerator + product_id: product_product_6 + product_uom: product.product_uom_unit + move_id: incomming_shipment_monitor + location_id: stock_location_3 + location_dest_id: location_monitor - !python {model: stock.partial.picking }: | self.do_partial(cr, uid, [ref('partial_incomming')], context=context) @@ -51,16 +51,16 @@ assert move_line.product_qty == 40, "Qty in backorder does not correspond." assert move_line.state == 'done', "Move line of backorder should be closed." - - I receive another 10kgm Ice-cream. + I receive another 10 unit 15” LCD Monitor. - !record {model: stock.partial.picking, id: partial_incomming}: move_ids: - quantity: 10 - product_id: product_icecream - product_uom: product.product_uom_kgm - move_id: incomming_shipment_icecream - location_id: location_convenience_shop - location_dest_id: location_refrigerator + product_id: product_product_6 + product_uom: product.product_uom_unit + move_id: incomming_shipment_monitor + location_id: stock_location_3 + location_dest_id: location_monitor - !python {model: stock.partial.picking }: | self.do_partial(cr, uid, [ref('partial_incomming')], context=context) @@ -77,7 +77,7 @@ assert move_line.state == 'done', "Move line should be closed." - - I return last incomming shipment for 10 kgm Ice-cream. + I return last incomming shipment for 10 unit 15” LCD Monitor. - !record {model: stock.return.picking, id: return_incomming}: invoice_state: none @@ -115,11 +115,11 @@ I check available stock after received incomming shipping. - !python {model: product.product}: | - product = self.browse(cr, uid, ref('product_icecream'), context=context) + product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.qty_available == 140, "Stock does not correspond." assert product.virtual_available == 0, "Vitual stock does not correspond." - - I split incomming shipment into lots. each lot contain 10 kgm Ice-cream. + I split incomming shipment into lots. each lot contain 10 unit 15” LCD Monitor. - !python {model: stock.picking}: | shipment = self.browse(cr, uid, ref("incomming_shipment")) @@ -147,7 +147,7 @@ lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incomming'), context=context) lot_ids = self.pool.get('stock.production.lot').search(cr, uid, [('name','in',[x.name for x in lot.line_ids])]) assert len(lot_ids) == 4, 'lots of incomming shipment are not correspond.' - move_ids = self.search(cr, uid, [('location_dest_id','=',ref('location_refrigerator')),('prodlot_id','in',lot_ids)]) + move_ids = self.search(cr, uid, [('location_dest_id','=',ref('location_monitor')),('prodlot_id','in',lot_ids)]) assert len(move_ids) == 4, 'move lines are not correspond per prodcution lot after splited.' for move in self.browse(cr, uid, move_ids, context=context): assert move.prodlot_id.name in ['incoming_lot0', 'incoming_lot1', 'incoming_lot2', 'incoming_lot3'], "lot does not correspond." @@ -171,39 +171,39 @@ assert account_move_line.credit == 0.0, "Credit amount does not correspond." assert account_move_line.debit == 800.0, "Debit amount does not correspond." - - I consume 1 kgm ice-cream from each incoming lots into internal production. + I consume 1 unit 15” LCD Monitor from each incoming lots into internal production. - !record {model: stock.move.consume, id: consume_lot_incomming}: product_qty: 1 - location_id: location_refrigerator + location_id: location_monitor - !python {model: stock.move.consume}: | self.do_move_consume(cr, uid, [ref('consume_lot_incomming')], context=context) - - I scrap 10 gm ice-cream from each incoming lots into scrap location. + I scrap 1 unit 15” LCD Monitor from each incoming lots into scrap location. - !record {model: stock.move.scrap, id: scrap_lot_incomming}: - product_qty: 0.010 + product_qty: 1 - !python {model: stock.move.scrap}: | self.move_scrap(cr, uid, [ref('scrap_lot_incomming')], context=context) - - I check stock in scrap location and refrigerator location. + I check stock in scrap location and stock location shop0. - !python {model: stock.location}: | - ctx = {'product_id': ref('product_icecream')} - refrigerator_location = self.pool.get('stock.location').browse(cr, uid, ref('location_refrigerator'), context=ctx) - assert refrigerator_location.stock_real == 135.96, 'stock does not correspond in refrigerator location.' + ctx = {'product_id': ref('product_product_6')} + refrigerator_location = self.pool.get('stock.location').browse(cr, uid, ref('location_monitor'), context=ctx) + assert refrigerator_location.stock_real == 36.0, 'stock does not correspond in stock location shop0.' scrapped_location = self.browse(cr, uid, ref('stock_location_scrapped'), context=ctx) - assert scrapped_location.stock_real == 0.010*4, 'scraped stock does not correspond in scrap location.' + assert scrapped_location.stock_real == 1*4, 'scraped stock does not correspond in scrap location.' - I check availabile stock after consumed and scraped. - !python {model: product.product}: | - product = self.browse(cr, uid, ref('product_icecream'), context=context) - assert product.qty_available == 135.96, "Stock does not correspond." - assert round(product.virtual_available, 2) == -4.04, "Vitual stock does not correspond." + product = self.browse(cr, uid, ref('product_product_6'), context=context) + assert product.qty_available == 136.0, "Stock does not correspond." + assert round(product.virtual_available, 2) == -4.00, "Vitual stock does not correspond." - I trace all incoming lots. - @@ -212,40 +212,39 @@ lot_ids = self.search(cr, uid, [('name', 'in', [x.name for x in lot.line_ids])]) self.action_traceability(cr, uid, lot_ids, context=context) - - I check outgoing shipment after stock availablity in refrigerator. + I check outgoing shipment after stock availablity in Chicago shop. - !python {model: stock.picking}: | shipment = self.browse(cr, uid, ref("outgoing_shipment"), context=context) - self.pool.get('stock.move').action_assign(cr, uid, [x.id for x in shipment.move_lines]) #TOFIX: assignment of move lines should be call before testing assigment otherwise picking never gone in assign state - #TOFIX: shipment should be assigned if stock available - #assert shipment.state == "assigned", "Shipment should be assigned." - #for move_line in shipment.move_lines: - # assert move_line.state == "assigned", "Move should be assigned." + self.pool.get('stock.move').action_assign(cr, uid, [x.id for x in shipment.move_lines]) + assert shipment.state == "assigned", "Shipment should be assigned." + for move_line in shipment.move_lines: + assert move_line.state == "assigned", "Move should be assigned." self.force_assign(cr, uid, [shipment.id]) - - I deliver 5kgm Ice-cream to customer so I make partial deliver + I deliver 5 unit 15” LCD Monitor to customer so I make partial deliver - !python {model: stock.partial.move}: | - context.update({'active_model': 'stock.move', 'active_id': ref('outgoing_shipment_icecream'), 'active_ids': [ref('outgoing_shipment_icecream')]}) + context.update({'active_model': 'stock.move', 'active_id': ref('outgoing_shipment_monitor'), 'active_ids': [ref('outgoing_shipment_monitor')]}) - - !record {model: stock.partial.move, id: partial_outgoing_icecream}: + !record {model: stock.partial.move, id: partial_outgoing_monitor}: move_ids: - quantity: 5 - product_id: product_icecream - product_uom: product.product_uom_kgm - move_id: outgoing_shipment_icecream - location_id: location_refrigerator - location_dest_id: location_delivery_counter + product_id: product_product_6 + product_uom: product.product_uom_unit + move_id: outgoing_shipment_monitor + location_id: location_monitor + location_dest_id: stock_location_output - !python {model: stock.partial.move }: | - self.do_partial(cr, uid, [ref('partial_outgoing_icecream')], context=context) + self.do_partial(cr, uid, [ref('partial_outgoing_monitor')], context=context) - - I packing outgoing shipment into box per 10kgm with unique tracking lot. + I packing outgoing shipment into box per 10 unit with unique tracking lot. - !python {model: stock.move}: | stock_split = self.pool.get('stock.split.into') - move = self.browse(cr, uid, ref('outgoing_shipment_icecream'), context=context) + move = self.browse(cr, uid, ref('outgoing_shipment_monitor'), context=context) context.update({'active_model': 'stock.move', 'active_id': move.id, 'active_ids': [move.id]}) total_qty = move.product_qty split_qty = 10 @@ -277,6 +276,6 @@ I check availaible stock after deliver. - !python {model: product.product}: | - product = self.browse(cr, uid, ref('product_icecream'), context=context) - assert round(product.qty_available, 2) == 5.96, "Stock does not correspond." - assert round(product.virtual_available, 2) == -4.04, "Vitual stock does not correspond." + product = self.browse(cr, uid, ref('product_product_6'), context=context) + assert round(product.qty_available, 2) == 6, "Stock does not correspond." + assert round(product.virtual_available, 2) == -4.00, "Vitual stock does not correspond." From 4de42a4254bb6abc30321d183c8609e04dc18009 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 28 Feb 2013 12:01:46 +0530 Subject: [PATCH 28/88] [IMP] improve stock yml bzr revid: fka@tinyerp.com-20130228063146-kfy538aq3p1hh029 --- addons/stock/stock_demo.yml | 4 ++-- addons/stock/test/shipment.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/stock/stock_demo.yml b/addons/stock/stock_demo.yml index 8e9ea4977b8..b79fd68d509 100644 --- a/addons/stock/stock_demo.yml +++ b/addons/stock/stock_demo.yml @@ -38,8 +38,8 @@ property_stock_inventory: location_opening valuation: real_time cost_method: average - property_stock_account_input: account.conf_o_expense - property_stock_account_output: account.conf_o_income + property_stock_account_input: account.conf_o_income + property_stock_account_output: account.conf_o_expense - !record {model: stock.production.lot, id: lot_monitor_0}: name: Lot0 for LCD Monitor diff --git a/addons/stock/test/shipment.yml b/addons/stock/test/shipment.yml index 27d5c44d199..4622e0072bc 100644 --- a/addons/stock/test/shipment.yml +++ b/addons/stock/test/shipment.yml @@ -165,11 +165,11 @@ for account_move_line in account_move.line_id: for stock_move in incomming_shipment.move_lines: if account_move_line.account_id.id == stock_move.product_id.property_stock_account_input.id: - assert account_move_line.credit == 800.0, "Credit amount does not correspond." + assert account_move_line.credit == 10000.0, "Credit amount does not correspond." assert account_move_line.debit == 0.0, "Debit amount does not correspond." else: assert account_move_line.credit == 0.0, "Credit amount does not correspond." - assert account_move_line.debit == 800.0, "Debit amount does not correspond." + assert account_move_line.debit == 10000.0, "Debit amount does not correspond." - I consume 1 unit 15” LCD Monitor from each incoming lots into internal production. - @@ -193,7 +193,7 @@ !python {model: stock.location}: | ctx = {'product_id': ref('product_product_6')} refrigerator_location = self.pool.get('stock.location').browse(cr, uid, ref('location_monitor'), context=ctx) - assert refrigerator_location.stock_real == 36.0, 'stock does not correspond in stock location shop0.' + assert refrigerator_location.stock_real == 136.0, 'stock does not correspond in stock location shop0.' scrapped_location = self.browse(cr, uid, ref('stock_location_scrapped'), context=ctx) assert scrapped_location.stock_real == 1*4, 'scraped stock does not correspond in scrap location.' From 506b7c9c64f5e0022aa15aeab05d18ca6b766fed Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 28 Feb 2013 12:13:38 +0530 Subject: [PATCH 29/88] [IMP] change data of stock_report.yml bzr revid: fka@tinyerp.com-20130228064338-r93gtraqgrfc76mc --- addons/stock/__openerp__.py | 2 +- addons/stock/test/shipment.yml | 4 ++-- addons/stock/test/stock_report.yml | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py index e1c96ba0c25..323fac889be 100644 --- a/addons/stock/__openerp__.py +++ b/addons/stock/__openerp__.py @@ -93,7 +93,7 @@ Dashboard / Reports for Warehouse Management will include: 'stock_demo.yml', 'test/opening_stock.yml', 'test/shipment.yml', - #'test/stock_report.yml', + 'test/stock_report.yml', ], 'installable': True, 'application': True, diff --git a/addons/stock/test/shipment.yml b/addons/stock/test/shipment.yml index 4622e0072bc..96273a081b7 100644 --- a/addons/stock/test/shipment.yml +++ b/addons/stock/test/shipment.yml @@ -192,8 +192,8 @@ - !python {model: stock.location}: | ctx = {'product_id': ref('product_product_6')} - refrigerator_location = self.pool.get('stock.location').browse(cr, uid, ref('location_monitor'), context=ctx) - assert refrigerator_location.stock_real == 136.0, 'stock does not correspond in stock location shop0.' + monitor_location = self.pool.get('stock.location').browse(cr, uid, ref('location_monitor'), context=ctx) + assert monitor_location.stock_real == 136.0, 'stock does not correspond in stock location shop0.' scrapped_location = self.browse(cr, uid, ref('stock_location_scrapped'), context=ctx) assert scrapped_location.stock_real == 1*4, 'scraped stock does not correspond in scrap location.' diff --git a/addons/stock/test/stock_report.yml b/addons/stock/test/stock_report.yml index b1590a4d819..b16ade8a085 100644 --- a/addons/stock/test/stock_report.yml +++ b/addons/stock/test/stock_report.yml @@ -4,7 +4,7 @@ !python {model: stock.location}: | import os from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.lot.stock.overview').create(cr, uid, [ref('location_refrigerator')], {}, {}) + (data, format) = netsvc.LocalService('report.lot.stock.overview').create(cr, uid, [ref('location_monitor')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-overview'+format), 'wb+').write(data) - @@ -13,7 +13,7 @@ !python {model: stock.location}: | import os from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.lot.stock.overview_all').create(cr, uid, [ref('location_refrigerator')], {}, {}) + (data, format) = netsvc.LocalService('report.lot.stock.overview_all').create(cr, uid, [ref('location_monitor')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-overviewall'+format), 'wb+').write(data) - @@ -22,7 +22,7 @@ !python {model: stock.inventory}: | import os from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.stock.inventory.move').create(cr, uid, [ref('stock_inventory_icecream')], {}, {}) + (data, format) = netsvc.LocalService('report.stock.inventory.move').create(cr, uid, [ref('stock_inventory_0')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-stock_inventory_move.'+format), 'wb+').write(data) - @@ -40,7 +40,7 @@ !python {model: product.product}: | import os from openerp import netsvc, tools - (data, format) = netsvc.LocalService('report.stock.product.history').create(cr, uid, [ref('product_icecream')], {}, {}) + (data, format) = netsvc.LocalService('report.stock.product.history').create(cr, uid, [ref('product_product_6')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'stock-product_stock_report.'+format), 'wb+').write(data) From 721daed4c6bdd35ae44476ad9ae0c3edbb823e89 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 28 Feb 2013 14:35:06 +0530 Subject: [PATCH 30/88] [IMP] add stock_users.yml file in stock for test access rights bzr revid: fka@tinyerp.com-20130228090506-esh7d6nycoqqymay --- addons/stock/__openerp__.py | 1 + addons/stock/stock_demo.yml | 10 ++++++++++ addons/stock/test/stock_users.yml | 20 ++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 addons/stock/test/stock_users.yml diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py index 323fac889be..dd2a996f6dd 100644 --- a/addons/stock/__openerp__.py +++ b/addons/stock/__openerp__.py @@ -90,6 +90,7 @@ Dashboard / Reports for Warehouse Management will include: 'res_config_view.xml', ], 'test': [ + 'test/stock_users.yml', 'stock_demo.yml', 'test/opening_stock.yml', 'test/shipment.yml', diff --git a/addons/stock/stock_demo.yml b/addons/stock/stock_demo.yml index b79fd68d509..64be92f8d06 100644 --- a/addons/stock/stock_demo.yml +++ b/addons/stock/stock_demo.yml @@ -1,3 +1,8 @@ +- + Only stock manager can create location,warehouse and product, so let's check data with giving the access rights of manager +- + !context + uid: 'res_users_stock_manager' - !record {model: stock.location, id: location_monitor}: name: chicago shop @@ -40,6 +45,11 @@ cost_method: average property_stock_account_input: account.conf_o_income property_stock_account_output: account.conf_o_expense +- + Stock user can handled production lot,inventory and picking, so let's check data with giving the access rights of user +- + !context + uid: 'res_users_stock_user' - !record {model: stock.production.lot, id: lot_monitor_0}: name: Lot0 for LCD Monitor diff --git a/addons/stock/test/stock_users.yml b/addons/stock/test/stock_users.yml new file mode 100644 index 00000000000..82d48197b0d --- /dev/null +++ b/addons/stock/test/stock_users.yml @@ -0,0 +1,20 @@ +- + Create a user as 'Stock Manager' +- + !record {model: res.users, id: res_users_stock_manager}: + company_id: base.main_company + name: Stock Manager + login: sam + password: sam + groups_id: + - stock.group_stock_manager +- + Create a user as 'Stock User' +- + !record {model: res.users, id: res_users_stock_user}: + company_id: base.main_company + name: Stock User + login: sau + password: sau + groups_id: + - stock.group_stock_user From 8009999e2981260e73fd11e11bacfa8a1fd84e2f Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 28 Feb 2013 18:58:36 +0530 Subject: [PATCH 31/88] [IMP] give access rights to the user in stock ymls bzr revid: fka@tinyerp.com-20130228132836-e2f7rknoodpqix0p --- addons/stock/security/stock_security.xml | 2 +- addons/stock/test/opening_stock.yml | 30 ++++++++++++++++++++++++ addons/stock/test/stock_report.yml | 5 ++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/addons/stock/security/stock_security.xml b/addons/stock/security/stock_security.xml index 10ae6a16d59..e51f20c67c9 100644 --- a/addons/stock/security/stock_security.xml +++ b/addons/stock/security/stock_security.xml @@ -10,7 +10,7 @@ Manager - + diff --git a/addons/stock/test/opening_stock.yml b/addons/stock/test/opening_stock.yml index 41b906e560c..9efcfd3af99 100644 --- a/addons/stock/test/opening_stock.yml +++ b/addons/stock/test/opening_stock.yml @@ -1,3 +1,8 @@ +- + Only stock manager can change the price and update stock of products, so let's check data with giving the access rights of manager +- + !context + uid: 'res_users_stock_manager' - I update the price of the 15” LCD Monitor. - @@ -32,6 +37,11 @@ !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.qty_available == 10, "Stock is not updated." +- + Stock user can merge inventory, so let's check data with giving the access rights of user. +- + !context + uid: 'res_users_stock_user' - I merge inventory. - @@ -42,11 +52,21 @@ - !python {model: stock.inventory.merge }: | self.do_merge(cr, uid, [ref('merge_inventory')], context=context) +- + Only stock manager cancelled inventory, so let's check data with giving the access rights of manager +- + !context + uid: 'res_users_stock_manager' - I cancel inventory. - !python {model: stock.inventory}: | self.action_cancel_inventory(cr, uid, [ref('stock_inventory_0')]) +- + stock user can reset inventory, so let's check data with giving the access rights of user +- + !context + uid: 'res_users_stock_user' - I reset to draft inventory. - @@ -108,11 +128,21 @@ !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.virtual_available == 100, "Vitual stock is not updated." +- + Only stock manager can close physical inventory, so let's check data with giving the access rights of manager +- + !context + uid: 'res_users_stock_manager' - I close physical inventory of 15” LCD Monitor. - !python {model: stock.inventory}: | self.action_done(cr, uid, [ref('stock_inventory_0')], context=context) +- + Stock user can check closed move and real stock, so let's check data with giving the access rights of user +- + !context + uid: 'res_users_stock_user' - I check closed move and real stock of 15” LCD Monitor after closed physical inventory. - diff --git a/addons/stock/test/stock_report.yml b/addons/stock/test/stock_report.yml index b16ade8a085..f1a31f23d93 100644 --- a/addons/stock/test/stock_report.yml +++ b/addons/stock/test/stock_report.yml @@ -1,3 +1,8 @@ +- + Stock user can print all reports related to stock, so let's check data with giving the access rights of user. +- + !context + uid: 'res_users_stock_user' - I print a stock overview report of location. - From 8eb3f28c28d54a7cca27ac274f78054db9185991 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 1 Mar 2013 11:12:53 +0530 Subject: [PATCH 32/88] [IMP] remove space bzr revid: fka@tinyerp.com-20130301054253-qbep31elzopq6xa4 --- addons/stock/product.py | 5 +++-- addons/stock/stock.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/stock/product.py b/addons/stock/product.py index b00f8615667..254eb53d255 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -55,14 +55,15 @@ class product_product(osv.osv): if context is None: context = {} product_obj = self.pool.get('product.product').browse(cr, uid, product_id, context=context) + stock_input_acc = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id or False if not stock_input_acc: stock_input_acc = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id or False - + stock_output_acc = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id or False if not stock_output_acc: stock_output_acc = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id or False - + journal_id = product_obj.categ_id.property_stock_journal and product_obj.categ_id.property_stock_journal.id or False account_valuation = product_obj.categ_id.property_stock_valuation_account_id and product_obj.categ_id.property_stock_valuation_account_id.id or False return { diff --git a/addons/stock/stock.py b/addons/stock/stock.py index ed2b36bd1f5..8e4611dc5d0 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2233,6 +2233,7 @@ class stock_move(osv.osv): acc_valuation = accounts.get('property_stock_valuation_account_id', False) journal_id = accounts['stock_journal'] + if acc_dest == acc_valuation: raise osv.except_osv(_('Error!'), _('Cannot create Journal Entry, Output Account of this product and Valuation account on category of this product are same.')) From b6cbd45d01274615bdb1ee17a831dbddc4fdc091 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 1 Mar 2013 11:17:45 +0530 Subject: [PATCH 33/88] [IMP] remove space bzr revid: fka@tinyerp.com-20130301054745-52t0n0mh8b3xo4qt --- addons/stock/product.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/stock/product.py b/addons/stock/product.py index 254eb53d255..1d56ce64988 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -55,15 +55,15 @@ class product_product(osv.osv): if context is None: context = {} product_obj = self.pool.get('product.product').browse(cr, uid, product_id, context=context) - + stock_input_acc = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id or False if not stock_input_acc: stock_input_acc = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id or False - + stock_output_acc = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id or False if not stock_output_acc: stock_output_acc = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id or False - + journal_id = product_obj.categ_id.property_stock_journal and product_obj.categ_id.property_stock_journal.id or False account_valuation = product_obj.categ_id.property_stock_valuation_account_id and product_obj.categ_id.property_stock_valuation_account_id.id or False return { From ab83bc5d851b6339806c56804adb0eee151816a0 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 1 Mar 2013 14:58:05 +0530 Subject: [PATCH 34/88] [IMP] add yml of mrp_users and give access rights bzr revid: fka@tinyerp.com-20130301092805-56z3lzm8obeon6re --- addons/mrp/__openerp__.py | 7 ++++--- addons/mrp/security/ir.model.access.csv | 1 + addons/mrp/security/mrp_security.xml | 1 + addons/mrp/test/cancel_order.yml | 5 +++++ addons/mrp/test/mrp_users.yml | 20 ++++++++++++++++++++ addons/mrp/test/order_demo.yml | 5 +++++ addons/mrp/test/order_process.yml | 5 +++++ 7 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 addons/mrp/test/mrp_users.yml diff --git a/addons/mrp/__openerp__.py b/addons/mrp/__openerp__.py index 6e025ae2d90..5f5ded337a7 100644 --- a/addons/mrp/__openerp__.py +++ b/addons/mrp/__openerp__.py @@ -77,9 +77,10 @@ Dashboard / Reports for MRP will include: #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 # so the ymls are too complex to change at this stage 'test': [ -# 'test/order_demo.yml', -# 'test/order_process.yml', -# 'test/cancel_order.yml', + 'test/mrp_users.yml', + 'test/order_demo.yml', + 'test/order_process.yml', + 'test/cancel_order.yml', ], 'installable': True, 'application': True, diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv index 7a94b1a660c..2d0a478c33d 100644 --- a/addons/mrp/security/ir.model.access.csv +++ b/addons/mrp/security/ir.model.access.csv @@ -1,4 +1,5 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_account_analytic_line_user,account.analytic.line,account.model_account_analytic_line,group_mrp_user,1,1,1,0 access_mrp_workcenter,mrp.workcenter,model_mrp_workcenter,mrp.group_mrp_user,1,0,0,0 access_mrp_routing,mrp.routing,model_mrp_routing,mrp.group_mrp_user,1,0,0,0 access_mrp_routing_workcenter,mrp.routing.workcenter,model_mrp_routing_workcenter,mrp.group_mrp_user,1,0,0,0 diff --git a/addons/mrp/security/mrp_security.xml b/addons/mrp/security/mrp_security.xml index 35aae42b53d..9e5dc919720 100644 --- a/addons/mrp/security/mrp_security.xml +++ b/addons/mrp/security/mrp_security.xml @@ -4,6 +4,7 @@ User + diff --git a/addons/mrp/test/cancel_order.yml b/addons/mrp/test/cancel_order.yml index 9e197156b15..2f721b6c653 100644 --- a/addons/mrp/test/cancel_order.yml +++ b/addons/mrp/test/cancel_order.yml @@ -1,3 +1,8 @@ +- + MRP user can cancelled Production Order, so let's check data with giving the access rights of user. +- + !context + uid: 'res_users_mrp_user' - I first confirm order for PC Assemble SC349. - diff --git a/addons/mrp/test/mrp_users.yml b/addons/mrp/test/mrp_users.yml new file mode 100644 index 00000000000..d18cc51e8e6 --- /dev/null +++ b/addons/mrp/test/mrp_users.yml @@ -0,0 +1,20 @@ +- + Create a user as 'MRP Manager' +- + !record {model: res.users, id: res_users_mrp_manager}: + company_id: base.main_company + name: MRP Manager + login: mam + password: mam + groups_id: + - mrp.group_mrp_manager +- + Create a user as 'MRP User' +- + !record {model: res.users, id: res_users_mrp_user}: + company_id: base.main_company + name: MRP User + login: mau + password: mau + groups_id: + - mrp.group_mrp_user diff --git a/addons/mrp/test/order_demo.yml b/addons/mrp/test/order_demo.yml index ee21fee96df..0e4914390fb 100644 --- a/addons/mrp/test/order_demo.yml +++ b/addons/mrp/test/order_demo.yml @@ -1,3 +1,8 @@ +- + MRP user can create Production Order, so let's check data with giving the access rights of user. +- + !context + uid: 'res_users_mrp_user' - I create Production Order of PC Assemble SC349 to produce 5.0 Unit. - diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml index 89331d5c255..8aa408483e9 100644 --- a/addons/mrp/test/order_process.yml +++ b/addons/mrp/test/order_process.yml @@ -1,3 +1,8 @@ +- + MRP user can doing all process related to Production Order, so let's check data with giving the access rights of user. +- + !context + uid: 'res_users_mrp_user' - I compute the production order. - From b98082337bae437ac615465e40226a4f42838575 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 12 Mar 2013 14:09:55 +0530 Subject: [PATCH 35/88] [IMP]Improve yml and make work with purchase user bzr revid: sgo@tinyerp.com-20130312083955-la478tbdpfqtv1wr --- addons/purchase/test/process/invoice_on_poline.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/purchase/test/process/invoice_on_poline.yml b/addons/purchase/test/process/invoice_on_poline.yml index 8a391b13ebb..d31b371f009 100644 --- a/addons/purchase/test/process/invoice_on_poline.yml +++ b/addons/purchase/test/process/invoice_on_poline.yml @@ -1,3 +1,8 @@ +- + Purchase User confirm the order and create invoice based on purchase order line. +- + !context + uid: 'res_users_purchase_user' - I confirm purchase order which has invoicing control method "Based on Purchase Order Lines". - @@ -17,10 +22,4 @@ !python {model: purchase.order}: | purchase_order = self.browse(cr, uid, ref("purchase_order_6")) for purchase_line in purchase_order.order_line: - assert len(purchase_order.invoice_ids) == 1, "Invoice should be generated." -- - I set the default invoicing control method "Based on Purchase Order Lines". -- - !python {model: purchase.config.settings}: | - new_id = self.create(cr, uid, {'default_invoice_method': 'manual'}) - self.execute(cr, uid, [new_id]) + assert len(purchase_order.invoice_ids) == 1, "Invoice should be generated." \ No newline at end of file From 15f6bea1e9eacbe97b90b38337105a1c4219d757 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 12 Mar 2013 16:57:00 +0530 Subject: [PATCH 36/88] [IMP]improve yml for project and add access rights as needed bzr revid: sgo@tinyerp.com-20130312112700-zamjzcjp5d9nv5n0 --- addons/project/__openerp__.py | 1 + addons/project/security/ir.model.access.csv | 1 + addons/project/security/project_security.xml | 1 + addons/project/test/project_demo.yml | 23 +++++++++---- addons/project/test/project_process.yml | 5 +++ addons/project/test/project_users.yml | 20 +++++++++++ addons/project/test/task_process.yml | 35 +++++++++++--------- 7 files changed, 65 insertions(+), 21 deletions(-) create mode 100644 addons/project/test/project_users.yml diff --git a/addons/project/__openerp__.py b/addons/project/__openerp__.py index c0a516cf555..94761835656 100644 --- a/addons/project/__openerp__.py +++ b/addons/project/__openerp__.py @@ -79,6 +79,7 @@ Dashboard / Reports for Project Management will include: ], 'demo': ['project_demo.xml'], 'test': [ + 'test/project_users.yml', 'test/project_demo.yml', 'test/project_process.yml', 'test/task_process.yml', diff --git a/addons/project/security/ir.model.access.csv b/addons/project/security/ir.model.access.csv index a76faa0fcce..1428f445e43 100644 --- a/addons/project/security/ir.model.access.csv +++ b/addons/project/security/ir.model.access.csv @@ -19,6 +19,7 @@ access_project_task_history,project.task.history project,project.model_project_t access_project_task_history_cumulative,project.task.history project,project.model_project_task_history_cumulative,project.group_project_manager,1,0,0,0 access_project_task_history_cumulative,project.task.history project,project.model_project_task_history_cumulative,project.group_project_user,1,0,0,0 access_resource_calendar,project.resource_calendar manager,resource.model_resource_calendar,project.group_project_manager,1,0,0,0 +access_resource_calendar_leaves,project.resource_calendar_leaves manager,resource.model_resource_calendar_leaves,project.group_project_manager,1,0,0,0 access_project_category,project.project_category,model_project_category,,1,0,0,0 access_project_category_manager,project.project_category,model_project_category,project.group_project_manager,1,1,1,1 access_mail_alias,mail.alias,mail.model_mail_alias,project.group_project_manager,1,1,1,1 diff --git a/addons/project/security/project_security.xml b/addons/project/security/project_security.xml index f1d8c7e760f..f17c781d702 100644 --- a/addons/project/security/project_security.xml +++ b/addons/project/security/project_security.xml @@ -4,6 +4,7 @@ User + diff --git a/addons/project/test/project_demo.yml b/addons/project/test/project_demo.yml index 5f6acbb913e..21d0af324ff 100644 --- a/addons/project/test/project_demo.yml +++ b/addons/project/test/project_demo.yml @@ -1,12 +1,23 @@ +- + I Update project and create the new task with project manager +- + !context + uid: 'res_users_project_manager' +- + Change partner for The Jackson Group's Project - !record {model: project.project, id: project_project_1, view: False}: partner_id: base.res_partner_2 - - !record {model: project.task, id: project_task_1, view: False}: + I create task for The Jackson Group's Project project user can create task. +- + !context + uid: 'res_users_project_user' +- + !record {model: project.task, id: project_task_for_project1}: + name: Worked on new specification + user_id: res_users_project_user remaining_hours: 10.00 -- - !record {model: project.task, id: project_task_1, view: False}: planned_hours: 10.00 -- - !record {model: project.task, id: project_task_1, view: False}: - project_id: project_project_1 \ No newline at end of file + project_id: project_project_1 + stage_id: project_tt_specification \ No newline at end of file diff --git a/addons/project/test/project_process.yml b/addons/project/test/project_process.yml index c2a5c072e9d..9ef488a07b4 100644 --- a/addons/project/test/project_process.yml +++ b/addons/project/test/project_process.yml @@ -1,3 +1,8 @@ +- + Test the whole project process with project manager. +- + !context + uid: 'res_users_project_manager' - In order to Test Process of Project Management, - diff --git a/addons/project/test/project_users.yml b/addons/project/test/project_users.yml new file mode 100644 index 00000000000..b23ab0fc7f6 --- /dev/null +++ b/addons/project/test/project_users.yml @@ -0,0 +1,20 @@ +- + Create a user as 'Project manager' +- + !record {model: res.users, id: res_users_project_manager}: + company_id: base.main_company + name: Project Manager + login: prm + password: prm + groups_id: + - project.group_project_manager +- + Create a user as 'Project user' +- + !record {model: res.users, id: res_users_project_user}: + company_id: base.main_company + name: Project User + login: pru + password: pru + groups_id: + - project.group_project_user \ No newline at end of file diff --git a/addons/project/test/task_process.yml b/addons/project/test/task_process.yml index e37b2116714..664f0b1563e 100644 --- a/addons/project/test/task_process.yml +++ b/addons/project/test/task_process.yml @@ -1,46 +1,51 @@ +- + Test the whole task process with project user. +- + !context + uid: 'res_users_project_user' - I put task in pending due to specification is not clear. - !python {model: project.task}: | - self.do_pending(cr, uid, [ref("project_task_1")]) - context.update({"active_id": ref("project_task_1")}) + self.do_pending(cr, uid, [ref("project_task_for_project1")]) + context.update({"active_id": ref("project_task_for_project1")}) - I check state of task after put in pending. - - !assert {model: project.task, id: project_task_1, severity: error, string: task should be in pending state}: + !assert {model: project.task, id: project_task_for_project1, severity: error, string: task should be in pending state}: - state == "pending" - !record {model: project.task.delegate, id: delegate_id}: - user_id: base.user_demo + user_id: res_users_project_user planned_hours: 12.0 planned_hours_me: 2.0 - Now I delegate task to team member. - !python {model: project.task.delegate}: | - self.delegate(cr, uid, [ref("delegate_id")], {"active_id": ref("project_task_1")}) + self.delegate(cr, uid, [ref("delegate_id")], {"active_id": ref("project_task_for_project1")}) - I check delegated task details. - !python {model: project.task}: | - task = self.browse(cr, uid, ref("project_task_1"), context=context) + task = self.browse(cr, uid, ref("project_task_for_project1"), context=context) assert task.planned_hours == 2.0, "Planning hours is not correct after delegated." assert task.state == "pending", "Task should be in Pending after delegated." - I re-open the task. - !python {model: project.task}: | - self.do_reopen(cr, uid, [ref("project_task_1")]) + self.do_reopen(cr, uid, [ref("project_task_for_project1")]) - I check reopened task details. - - !assert {model: project.task, id: project_task_1, severity: error, string: task should be open.}: + !assert {model: project.task, id: project_task_for_project1, severity: error, string: task should be open.}: - state == "open" - I change the stage of task to next stage. - !python {model: project.task}: | - self.stage_next(cr, uid, [ref("project_task_1")]) + self.stage_next(cr, uid, [ref("project_task_for_project1")]) - !record {model: project.task.reevaluate, id: reevaluate_id}: remaining_hours : 120 @@ -48,29 +53,29 @@ I reevaluate task with remaining hours. - !python {model: project.task.reevaluate}: | - self.compute_hours(cr, uid, [ref("reevaluate_id")], {"active_id": ref("project_task_1")}) + self.compute_hours(cr, uid, [ref("reevaluate_id")], {"active_id": ref("project_task_for_project1")}) - I check remaining hours after reevaluated task. - - !assert {model: project.task, id: project_task_1, severity: error, string: task should be reevaluated}: + !assert {model: project.task, id: project_task_for_project1, severity: error, string: task should be reevaluated}: - remaining_hours == 120.0 - I close the task. - !python {model: project.task}: | - self.action_close(cr, uid, [ref("project_task_1")]) + self.action_close(cr, uid, [ref("project_task_for_project1")]) - I check state after closed. - - !assert {model: project.task, id: project_task_1, severity: error, string: task is in open state}: + !assert {model: project.task, id: project_task_for_project1, severity: error, string: task is in open state}: - state == "done" - I change the stage of task to previous stage. - !python {model: project.task}: | - self.stage_previous(cr, uid, [ref("project_task_1")]) + self.stage_previous(cr, uid, [ref("project_task_for_project1")]) - I cancel Task. - !python {model: project.task}: | - self.do_cancel(cr, uid, [ref("project_task_2")]) + self.do_cancel(cr, uid, [ref("project_task_for_project1")]) From 6bc66196127703dfc15245872fa99ee23dc91946 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 14 Mar 2013 15:11:01 +0530 Subject: [PATCH 37/88] [IMP] give access rights in project issue bzr revid: fka@tinyerp.com-20130314094101-3n3mkiw1msm0vyrc --- addons/project_issue/__openerp__.py | 1 + addons/project_issue/test/cancel_issue.yml | 5 +++++ addons/project_issue/test/issue_demo.yml | 5 +++++ addons/project_issue/test/issue_process.yml | 15 ++++++++++++++ addons/project_issue/test/issue_users.yml | 20 +++++++++++++++++++ addons/project_issue/test/subscribe_issue.yml | 7 ++++++- 6 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 addons/project_issue/test/issue_users.yml diff --git a/addons/project_issue/__openerp__.py b/addons/project_issue/__openerp__.py index 2c5f311c044..553268ca224 100644 --- a/addons/project_issue/__openerp__.py +++ b/addons/project_issue/__openerp__.py @@ -53,6 +53,7 @@ It allows the manager to quickly check the issues, assign them and decide on the ], 'demo': ['project_issue_demo.xml'], 'test': [ + 'test/issue_users.yml', 'test/subscribe_issue.yml', 'test/issue_process.yml', 'test/cancel_issue.yml', diff --git a/addons/project_issue/test/cancel_issue.yml b/addons/project_issue/test/cancel_issue.yml index 76ffa212638..b69f95675c6 100644 --- a/addons/project_issue/test/cancel_issue.yml +++ b/addons/project_issue/test/cancel_issue.yml @@ -1,3 +1,8 @@ +- + Project user can cancelled issue, so let's check data with giving the access rights of user. +- + !context + uid: 'res_users_project_issue_user' - In order to test process of issue tracking in OpenERP, I cancel the unqualified Issue. - diff --git a/addons/project_issue/test/issue_demo.yml b/addons/project_issue/test/issue_demo.yml index 4e3790361e5..7040b631f46 100644 --- a/addons/project_issue/test/issue_demo.yml +++ b/addons/project_issue/test/issue_demo.yml @@ -1,3 +1,8 @@ +- + Test the whole create project issue with project user. +- + !context + uid: 'res_users_project_issue_user' - !record {model: project.issue, id: project_task_1, view: False}: task_id: 'project.project_task_17' diff --git a/addons/project_issue/test/issue_process.yml b/addons/project_issue/test/issue_process.yml index afb68a9b6c2..b5fe763fb43 100644 --- a/addons/project_issue/test/issue_process.yml +++ b/addons/project_issue/test/issue_process.yml @@ -1,3 +1,8 @@ +- + Project user can subscribe issue, so let's check data with giving the access rights of user. +- + !context + uid: 'res_users_project_issue_user' - In order to test process of issue tracking in OpenERP, I Open the Issue. - @@ -40,11 +45,21 @@ - !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in open state}: - state == 'open' +- + Only project manager can create Task for Issue, so let's check data with giving the access rights of manager. +- + !context + uid: 'res_users_project_issue_manager' - I create Task for Issue. - !python {model: project.issue}: | self.convert_issue_task(cr, uid, [ref("crm_case_buginaccountsmodule0")]) +- + After resolving Issue Project user can close issue, so let's check data with giving the access rights of user. +- + !context + uid: 'res_users_project_issue_user' - I close Issue after resolving it - diff --git a/addons/project_issue/test/issue_users.yml b/addons/project_issue/test/issue_users.yml new file mode 100644 index 00000000000..3493ac58ffc --- /dev/null +++ b/addons/project_issue/test/issue_users.yml @@ -0,0 +1,20 @@ +- + Create a user as 'Project manager' +- + !record {model: res.users, id: res_users_project_issue_manager}: + company_id: base.main_company + name: Project Manager + login: prim + password: prim + groups_id: + - project.group_project_manager +- + Create a user as 'Project user' +- + !record {model: res.users, id: res_users_project_issue_user}: + company_id: base.main_company + name: Project User + login: priu + password: priu + groups_id: + - project.group_project_user \ No newline at end of file diff --git a/addons/project_issue/test/subscribe_issue.yml b/addons/project_issue/test/subscribe_issue.yml index 9f16dc80b97..e07c8704a14 100644 --- a/addons/project_issue/test/subscribe_issue.yml +++ b/addons/project_issue/test/subscribe_issue.yml @@ -1,5 +1,10 @@ - - In Order to test process of Issue in OpenERP, Custmer send the issue by email. + Project user can subscribe issue, so let's check data with giving the access rights of user. +- + !context + uid: 'res_users_project_issue_user' +- + In Order to test process of Issue in OpenERP, Customer send the issue by email. - !python {model: mail.thread}: | from openerp import addons From 6f4588cc62f212ba1f0040f83ab21b0546c62989 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 14 Mar 2013 15:44:49 +0530 Subject: [PATCH 38/88] [IMP] give access rights in yml of mrp operations bzr revid: fka@tinyerp.com-20130314101449-a51uxlekaod33s8f --- addons/mrp_operations/__openerp__.py | 2 +- .../test/workcenter_operations.yml | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/addons/mrp_operations/__openerp__.py b/addons/mrp_operations/__openerp__.py index 7fedb426edd..12d86e0b532 100644 --- a/addons/mrp_operations/__openerp__.py +++ b/addons/mrp_operations/__openerp__.py @@ -70,7 +70,7 @@ So, that we can compare the theoretic delay and real delay. 'mrp_operations_demo.yml' ], 'test': [ -# 'test/workcenter_operations.yml', + 'test/workcenter_operations.yml', ], 'installable': True, 'auto_install': False, diff --git a/addons/mrp_operations/test/workcenter_operations.yml b/addons/mrp_operations/test/workcenter_operations.yml index 4754bb463ff..3bcdc77ecab 100644 --- a/addons/mrp_operations/test/workcenter_operations.yml +++ b/addons/mrp_operations/test/workcenter_operations.yml @@ -1,6 +1,19 @@ +- + Create a user as 'MRP User' +- + !record {model: res.users, id: res_mrp_operation_user}: + company_id: base.main_company + name: MRP User + login: maou + password: maou + groups_id: + - mrp.group_mrp_user - In order to test mrp_operations with OpenERP, I refer created production order of PC Assemble SC349 - with routing - Manual Component's Assembly to test complete production process with respect of workcenter. + with routing - Manual Component's Assembly to test complete production process with respect of workcenter with giving access rights of MRP User. +- + !context + uid: 'res_mrp_operation_user' - I compute the production order. - @@ -92,7 +105,7 @@ I print a Barcode Report of Operation line. - !python {model: mrp_operations.operation.code}: | - import netsvc, tools, os + from openerp import netsvc, tools (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')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-barcode_report.'+format), 'wb+').write(data) @@ -101,7 +114,7 @@ I print Workcenter's Barcode Report. - !python {model: mrp.workcenter}: | - import netsvc, tools, os + from openerp import netsvc, tools (data, format) = netsvc.LocalService('report.mrp.wc.barcode').create(cr, uid, [ref('mrp.mrp_workcenter_0'),ref('mrp.mrp_workcenter_1')], {}, {}) if tools.config['test_report_directory']: file(os.path.join(tools.config['test_report_directory'], 'mrp_operations-workcenter_barcode_report.'+format), 'wb+').write(data) From d3905268bc08f08db34669b8e90045fc2fb6f8f6 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 14 Mar 2013 16:24:11 +0530 Subject: [PATCH 39/88] [IMP] give access rights in yml of mrp repair bzr revid: fka@tinyerp.com-20130314105411-cgqik9a6grk0pqjl --- addons/mrp_repair/__openerp__.py | 3 ++- addons/mrp_repair/test/mrp_repair_users.yml | 20 +++++++++++++++++++ .../test/test_mrp_repair_afterinv.yml | 5 ++++- .../mrp_repair/test/test_mrp_repair_b4inv.yml | 5 ++++- .../test/test_mrp_repair_cancel.yml | 5 ++++- .../test/test_mrp_repair_noneinv.yml | 5 ++++- 6 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 addons/mrp_repair/test/mrp_repair_users.yml diff --git a/addons/mrp_repair/__openerp__.py b/addons/mrp_repair/__openerp__.py index 26480e975ce..a274cbc3ef4 100644 --- a/addons/mrp_repair/__openerp__.py +++ b/addons/mrp_repair/__openerp__.py @@ -52,7 +52,8 @@ The following topics should be covered by this module: 'mrp_repair_report.xml', ], 'demo': ['mrp_repair_demo.yml'], - 'test': ['test/test_mrp_repair_noneinv.yml', + 'test': ['test/mrp_repair_users.yml', + 'test/test_mrp_repair_noneinv.yml', 'test/test_mrp_repair_b4inv.yml', 'test/test_mrp_repair_afterinv.yml', 'test/test_mrp_repair_cancel.yml', diff --git a/addons/mrp_repair/test/mrp_repair_users.yml b/addons/mrp_repair/test/mrp_repair_users.yml new file mode 100644 index 00000000000..dee61653209 --- /dev/null +++ b/addons/mrp_repair/test/mrp_repair_users.yml @@ -0,0 +1,20 @@ +- + Create a user as 'MRP Repair Manager' +- + !record {model: res.users, id: res_mrp_repair_manager}: + company_id: base.main_company + name: MRP Manager + login: marm + password: marm + groups_id: + - mrp.group_mrp_manager +- + Create a user as 'MRP Repair User' +- + !record {model: res.users, id: res_mrp_repair_user}: + company_id: base.main_company + name: MRP User + login: maru + password: maru + groups_id: + - mrp.group_mrp_user \ No newline at end of file diff --git a/addons/mrp_repair/test/test_mrp_repair_afterinv.yml b/addons/mrp_repair/test/test_mrp_repair_afterinv.yml index 5ceb3f9b02b..583518ee7de 100644 --- a/addons/mrp_repair/test/test_mrp_repair_afterinv.yml +++ b/addons/mrp_repair/test/test_mrp_repair_afterinv.yml @@ -1,5 +1,8 @@ - - In order to test Invoice Method 'After Repair'. + In order to test Invoice Method 'After Repair' with giving the access rights of mrp user. +- + !context + uid: 'res_mrp_repair_user' - I confirm Repair order taking Invoice Method 'After Repair'. - diff --git a/addons/mrp_repair/test/test_mrp_repair_b4inv.yml b/addons/mrp_repair/test/test_mrp_repair_b4inv.yml index 47e301cd0bd..0b31c3970de 100644 --- a/addons/mrp_repair/test/test_mrp_repair_b4inv.yml +++ b/addons/mrp_repair/test/test_mrp_repair_b4inv.yml @@ -1,5 +1,8 @@ - - Now I test for Invoice Method 'Before Repair'. + Now I test for Invoice Method 'Before Repair' with giving the access rights of mrp user. +- + !context + uid: 'res_mrp_repair_user' - I confirm Repair order for Invoice Method 'Before Repair'. - diff --git a/addons/mrp_repair/test/test_mrp_repair_cancel.yml b/addons/mrp_repair/test/test_mrp_repair_cancel.yml index ee0e9c379e7..83a8b901fd3 100644 --- a/addons/mrp_repair/test/test_mrp_repair_cancel.yml +++ b/addons/mrp_repair/test/test_mrp_repair_cancel.yml @@ -1,6 +1,9 @@ - In order to test the cancel flow of mrp_repair module, - I start by creating new copy Repair order for "PC Assemble SC234" product. + I start by creating new copy Repair order for "PC Assemble SC234" product with giving access rights of mrp user. +- + !context + uid: 'res_mrp_repair_user' - !python {model: mrp.repair}: | copy_id = self.copy(cr, uid, ref("mrp_repair_rmrp1")) diff --git a/addons/mrp_repair/test/test_mrp_repair_noneinv.yml b/addons/mrp_repair/test/test_mrp_repair_noneinv.yml index 4334af01958..1e411e45605 100644 --- a/addons/mrp_repair/test/test_mrp_repair_noneinv.yml +++ b/addons/mrp_repair/test/test_mrp_repair_noneinv.yml @@ -1,5 +1,8 @@ - - In order to test "mrp_repair" module, I start with confirm state, and start repair. + In order to test "mrp_repair" module, I start with confirm state, and start repair with giving the access rights of mrp user. +- + !context + uid: 'res_mrp_repair_user' - I confirm Repair order for Invoice Method 'No Invoice'. - From 541a46fb877043ccb0f65768178495e8a30900c9 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 14 Mar 2013 16:50:18 +0530 Subject: [PATCH 40/88] [IMP] give access rights in yml of hr_timesheet bzr revid: fka@tinyerp.com-20130314112018-oy0m2lhwc0euq3nh --- addons/hr_timesheet/__openerp__.py | 1 + .../hr_timesheet/test/hr_timesheet_demo.yml | 5 ++++ .../hr_timesheet/test/hr_timesheet_users.yml | 30 +++++++++++++++++++ .../hr_timesheet/test/test_hr_timesheet.yml | 10 +++++++ 4 files changed, 46 insertions(+) create mode 100644 addons/hr_timesheet/test/hr_timesheet_users.yml diff --git a/addons/hr_timesheet/__openerp__.py b/addons/hr_timesheet/__openerp__.py index bff25e8e55d..3c026ac2d07 100644 --- a/addons/hr_timesheet/__openerp__.py +++ b/addons/hr_timesheet/__openerp__.py @@ -57,6 +57,7 @@ up a management by affair. ], 'demo': ['hr_timesheet_demo.xml'], 'test': [ + 'test/hr_timesheet_users.yml', 'test/test_hr_timesheet.yml', 'test/hr_timesheet_report.yml', 'test/hr_timesheet_demo.yml', diff --git a/addons/hr_timesheet/test/hr_timesheet_demo.yml b/addons/hr_timesheet/test/hr_timesheet_demo.yml index a868be2d710..723e3a1a08c 100644 --- a/addons/hr_timesheet/test/hr_timesheet_demo.yml +++ b/addons/hr_timesheet/test/hr_timesheet_demo.yml @@ -1,3 +1,8 @@ +- + Give the access rights of Hr Officer to create employee. +- + !context + uid: 'res_hr_timesheet_officer' - !record {model: hr.analytic.timesheet, id: working_hours_coding, view: False}: user_id: base.user_demo diff --git a/addons/hr_timesheet/test/hr_timesheet_users.yml b/addons/hr_timesheet/test/hr_timesheet_users.yml new file mode 100644 index 00000000000..428c1b7c40f --- /dev/null +++ b/addons/hr_timesheet/test/hr_timesheet_users.yml @@ -0,0 +1,30 @@ +- + Create a user as 'HR Manager' +- + !record {model: res.users, id: res_hr_timesheet_manager}: + company_id: base.main_company + name: HR manager + login: hrtm + password: hrtm + groups_id: + - base.group_hr_manager +- + Create a user as 'HR Officer' +- + !record {model: res.users, id: res_hr_timesheet_officer}: + company_id: base.main_company + name: HR Officer + login: hrto + password: hrto + groups_id: + - base.group_hr_user +- + Create a user as 'Employee' +- + !record {model: res.users, id: res_hr_timesheet_employee}: + company_id: base.main_company + name: Employee + login: empt + password: empt + groups_id: + - base.group_user \ No newline at end of file diff --git a/addons/hr_timesheet/test/test_hr_timesheet.yml b/addons/hr_timesheet/test/test_hr_timesheet.yml index 59d688f183b..b9010ce5e53 100644 --- a/addons/hr_timesheet/test/test_hr_timesheet.yml +++ b/addons/hr_timesheet/test/test_hr_timesheet.yml @@ -1,6 +1,11 @@ - In order to test hr_timesheet Module in OpenERP, I make "Sign In/Sign Out for Project" to encode and track time spent on the different projects. +- + Give the access rights of Hr Officer to create employee. +- + !context + uid: 'res_hr_timesheet_officer' - I create employee "Quentin Paolino" as "User". - @@ -9,6 +14,11 @@ name: Quentin Paolino parent_id: 'hr.employee_al' user_id: 'base.user_demo' +- + Give the access rights of Employee to Sign In/Sign Out in Project. +- + !context + uid: 'res_hr_timesheet_employee' - On "Sign In/Sign Out by Project" wizard i click on "Sign In/Sign Out" button of this wizard. - From 5a3acd71ed1aba2817189d4e8ffef72099c1148b Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 14 Mar 2013 19:07:50 +0530 Subject: [PATCH 41/88] [IMP] give access rights in yml of sale_stock bzr revid: fka@tinyerp.com-20130314133750-r034ygbcna6l49m6 --- addons/sale_stock/__openerp__.py | 3 +- .../test/cancel_order_sale_stock.yml | 17 +++++++- .../sale_stock/test/picking_order_policy.yml | 25 ++++++++++- .../sale_stock/test/prepaid_order_policy.yml | 5 ++- .../sale_stock/test/sale_order_onchange.yml | 5 +++ addons/sale_stock/test/sale_stock_users.yml | 41 +++++++++++++++++++ 6 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 addons/sale_stock/test/sale_stock_users.yml diff --git a/addons/sale_stock/__openerp__.py b/addons/sale_stock/__openerp__.py index a849df295d4..a1941524868 100644 --- a/addons/sale_stock/__openerp__.py +++ b/addons/sale_stock/__openerp__.py @@ -59,7 +59,8 @@ You can choose flexible invoicing methods: ], 'data': ['sale_stock_data.xml'], 'demo_xml': ['sale_stock_demo.xml'], - 'test': ['test/cancel_order_sale_stock.yml', + 'test': ['test/sale_stock_users.yml', + 'test/cancel_order_sale_stock.yml', 'test/picking_order_policy.yml', 'test/prepaid_order_policy.yml', 'test/sale_order_onchange.yml', diff --git a/addons/sale_stock/test/cancel_order_sale_stock.yml b/addons/sale_stock/test/cancel_order_sale_stock.yml index 9081cac9fa3..397bc0e49fe 100644 --- a/addons/sale_stock/test/cancel_order_sale_stock.yml +++ b/addons/sale_stock/test/cancel_order_sale_stock.yml @@ -1,6 +1,9 @@ - - In order to test the cancel sale order. + In order to test the cancel sale order with that user which have salesman rights. First I confirm order. +- + !context + uid: 'res_sale_stock_salesman' - !workflow {model: sale.order, action: order_confirm, ref: sale.sale_order_8} - @@ -8,7 +11,7 @@ - !python {model: stock.picking}: | delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))]) - first_picking = self.browse(cr, uid, delivery_orders[0], context=context) + first_picking = self.browse(cr, uid, delivery_orders[0], context=None) if first_picking.force_assign(cr, uid, first_picking): first_move = first_picking.move_lines[0] values = {'move%s'%(first_move.id): {'product_qty': 2, 'product_uom':ref('product.product_uom_unit')}} @@ -20,12 +23,22 @@ delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))]) last_delivery_order_id = delivery_orders[0] self.pool.get('stock.picking').signal_button_cancel(cr, uid, [last_delivery_order_id]) +- + Only Stock User can change data related warehouse therfore test with that user which have stcok user rights, +- + !context + uid: 'res_stock_user' - I run the scheduler. - !python {model: procurement.order}: | self.run_scheduler(cr, uid) +- + Salesman can also check order therfore test with that user which have salesman rights, +- + !context + uid: 'res_sale_stock_salesman' - I check order status in "Ship Exception". - diff --git a/addons/sale_stock/test/picking_order_policy.yml b/addons/sale_stock/test/picking_order_policy.yml index f761dfb65db..003bfbc1f30 100644 --- a/addons/sale_stock/test/picking_order_policy.yml +++ b/addons/sale_stock/test/picking_order_policy.yml @@ -1,5 +1,8 @@ - - In order to test process of the Sale Order, + In order to test process of the Sale Order with access rights of saleman, +- + !context + uid: 'res_sale_stock_salesman' - First I check the total amount of the Quotation before Approved. - @@ -33,11 +36,21 @@ assert procurement.product_qty == order_line.product_uom_qty, "Qty is not correspond." assert procurement.product_uom.id == order_line.product_uom.id, "UOM is not correspond." assert procurement.procure_method == order_line.type, "Procurement method is not correspond." +- + Only Stock User can change data related warehouse therfore test with that user which have stcok user rights, +- + !context + uid: 'res_stock_user' - I run the scheduler. - !python {model: procurement.order}: | self.run_scheduler(cr, uid) +- + Salesman can also check order therfore test with that user which have salesman rights, +- + !context + uid: 'res_sale_stock_salesman' - I check the details of delivery order after confirmed quotation. - @@ -128,6 +141,11 @@ assert inv_line.price_unit == so_line.price_unit , "Price Unit is not correspond." 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." assert inv_line.price_subtotal == so_line.price_subtotal, "Price sub total is not correspond." +- + Only Stock manager can open the Invoice therfore test with that user which have stock manager rights, +- + !context + uid: 'res_stock_manager' - I open the Invoice. - @@ -149,6 +167,11 @@ journal_ids[0], ref('account.cash'), ref('account.period_8'), journal_ids[0], name='test') +- + To test process of the Sale Order with access rights of saleman, +- + !context + uid: 'res_sale_stock_salesman' - I check the order after paid invoice. - diff --git a/addons/sale_stock/test/prepaid_order_policy.yml b/addons/sale_stock/test/prepaid_order_policy.yml index e35a9a82cf9..0e0345868d0 100644 --- a/addons/sale_stock/test/prepaid_order_policy.yml +++ b/addons/sale_stock/test/prepaid_order_policy.yml @@ -1,5 +1,8 @@ - - Now I confirm the Quotation with "Pay before delivery" policy. + Now I confirm the Quotation with "Pay before delivery" policy with access rights of salesman. +- + !context + uid: 'res_sale_stock_salesman' - !workflow {model: sale.order, action: order_confirm, ref: sale.sale_order_4} - diff --git a/addons/sale_stock/test/sale_order_onchange.yml b/addons/sale_stock/test/sale_order_onchange.yml index 1026e5627c3..d37dd74e1ef 100644 --- a/addons/sale_stock/test/sale_order_onchange.yml +++ b/addons/sale_stock/test/sale_order_onchange.yml @@ -1,3 +1,8 @@ +- + In sale order to test process of onchange of Sale Order with access rights of salemanager, +- + !context + uid: 'res_sale_stock_salesmanager' - In order to test the onchange of the Sale Order, I create a product - diff --git a/addons/sale_stock/test/sale_stock_users.yml b/addons/sale_stock/test/sale_stock_users.yml new file mode 100644 index 00000000000..f9bd1cf1727 --- /dev/null +++ b/addons/sale_stock/test/sale_stock_users.yml @@ -0,0 +1,41 @@ +- + Create a user as 'Salesmanager' +- + !record {model: res.users, id: res_sale_stock_salesmanager}: + company_id: base.main_company + name: Sales manager + login: ssm + password: ssm + groups_id: + - base.group_sale_manager +- + Create a user as 'Salesman' +- + !record {model: res.users, id: res_sale_stock_salesman}: + company_id: base.main_company + name: Salesman + login: ssu + password: ssu + groups_id: + - base.group_sale_salesman_all_leads +- + Create a user as 'Stock User' +- + !record {model: res.users, id: res_stock_user}: + company_id: base.main_company + name: Stock User + login: sau + password: sau + groups_id: + - stock.group_stock_user +- + Create a user as 'Stock Manager' +- + !record {model: res.users, id: res_stock_manager}: + company_id: base.main_company + name: Stock Manager + login: sam + password: sam + email: admin@portal.example.com + groups_id: + - stock.group_stock_manager \ No newline at end of file From 093f0f771abf94e4ec5896cf6d9b9a9572a162a9 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 15 Mar 2013 10:57:29 +0530 Subject: [PATCH 42/88] [IMP] improve yml of sale_stock bzr revid: fka@tinyerp.com-20130315052729-31z589lryen4wcy0 --- addons/sale_stock/test/sale_order_onchange.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/sale_stock/test/sale_order_onchange.yml b/addons/sale_stock/test/sale_order_onchange.yml index d37dd74e1ef..f21f88c9eb7 100644 --- a/addons/sale_stock/test/sale_order_onchange.yml +++ b/addons/sale_stock/test/sale_order_onchange.yml @@ -1,5 +1,5 @@ - - In sale order to test process of onchange of Sale Order with access rights of salemanager, + Only sales manager Creates product so let's check with access rights of salemanager. - !context uid: 'res_sale_stock_salesmanager' @@ -10,6 +10,11 @@ name: 'Devil Worship Book' list_price: 66.6 procure_method: 'make_to_order' +- + In sale order to test process of onchange of Sale Order with access rights of saleman. +- + !context + uid: 'res_sale_stock_salesman' - Now i create a sale order that uses my new product - From 2496811ec42cc6b06fa9293ff97123c85e593433 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Mon, 18 Mar 2013 11:24:12 +0530 Subject: [PATCH 43/88] [IMP] improve yml strings bzr revid: fka@tinyerp.com-20130318055412-se3c890mlckxd8ty --- addons/sale/test/cancel_order.yml | 2 +- addons/sale/test/delete_order.yml | 2 +- addons/sale_stock/test/cancel_order_sale_stock.yml | 6 +++--- addons/sale_stock/test/picking_order_policy.yml | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/sale/test/cancel_order.yml b/addons/sale/test/cancel_order.yml index 48c6b91d2c4..a2c62e16031 100644 --- a/addons/sale/test/cancel_order.yml +++ b/addons/sale/test/cancel_order.yml @@ -1,5 +1,5 @@ - - Salesman can also cancel order therfore test with that user which have salesman rights, + Salesman can also cancel order therefore test with that user which have salesman rights, - !context uid: 'res_users_salesman' diff --git a/addons/sale/test/delete_order.yml b/addons/sale/test/delete_order.yml index 69c89020ad9..9d8db337d5b 100644 --- a/addons/sale/test/delete_order.yml +++ b/addons/sale/test/delete_order.yml @@ -1,5 +1,5 @@ - - Sales manager can only delete order therfore test with that user which have sales manager rights, + Sales manager can only delete order therefore test with that user which have sales manager rights, - !context uid: 'res_users_salesmanager' diff --git a/addons/sale_stock/test/cancel_order_sale_stock.yml b/addons/sale_stock/test/cancel_order_sale_stock.yml index 397bc0e49fe..1109124705c 100644 --- a/addons/sale_stock/test/cancel_order_sale_stock.yml +++ b/addons/sale_stock/test/cancel_order_sale_stock.yml @@ -11,7 +11,7 @@ - !python {model: stock.picking}: | delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))]) - first_picking = self.browse(cr, uid, delivery_orders[0], context=None) + first_picking = self.browse(cr, uid, delivery_orders[0]) if first_picking.force_assign(cr, uid, first_picking): first_move = first_picking.move_lines[0] values = {'move%s'%(first_move.id): {'product_qty': 2, 'product_uom':ref('product.product_uom_unit')}} @@ -24,7 +24,7 @@ last_delivery_order_id = delivery_orders[0] self.pool.get('stock.picking').signal_button_cancel(cr, uid, [last_delivery_order_id]) - - Only Stock User can change data related warehouse therfore test with that user which have stcok user rights, + Only Stock User can change data related warehouse therefore test with that user which have stcok user rights, - !context uid: 'res_stock_user' @@ -35,7 +35,7 @@ self.run_scheduler(cr, uid) - - Salesman can also check order therfore test with that user which have salesman rights, + Salesman can also check order therefore test with that user which have salesman rights, - !context uid: 'res_sale_stock_salesman' diff --git a/addons/sale_stock/test/picking_order_policy.yml b/addons/sale_stock/test/picking_order_policy.yml index 003bfbc1f30..50d79058764 100644 --- a/addons/sale_stock/test/picking_order_policy.yml +++ b/addons/sale_stock/test/picking_order_policy.yml @@ -37,7 +37,7 @@ assert procurement.product_uom.id == order_line.product_uom.id, "UOM is not correspond." assert procurement.procure_method == order_line.type, "Procurement method is not correspond." - - Only Stock User can change data related warehouse therfore test with that user which have stcok user rights, + Only Stock User can change data related warehouse therefore test with that user which have stcok user rights, - !context uid: 'res_stock_user' @@ -47,7 +47,7 @@ !python {model: procurement.order}: | self.run_scheduler(cr, uid) - - Salesman can also check order therfore test with that user which have salesman rights, + Salesman can also check order therefore test with that user which have salesman rights, - !context uid: 'res_sale_stock_salesman' @@ -142,7 +142,7 @@ 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." assert inv_line.price_subtotal == so_line.price_subtotal, "Price sub total is not correspond." - - Only Stock manager can open the Invoice therfore test with that user which have stock manager rights, + Only Stock manager can open the Invoice therefore test with that user which have stock manager rights, - !context uid: 'res_stock_manager' From f748568f3c32f7c48c98518119bc19de056df36f Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Mon, 18 Mar 2013 17:19:12 +0530 Subject: [PATCH 44/88] [IMP]add access rights for create, read and write to acccount.journal and res.partner.bank bzr revid: sgo@tinyerp.com-20130318114912-klopr2dtalsgbp4g --- addons/account/security/ir.model.access.csv | 2 ++ addons/account/test/account_customer_invoice.yml | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index d164b8026ce..d6ba955aabc 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -37,6 +37,7 @@ access_account_payment_term_manager,account.payment.term,model_account_payment_t access_account_payment_term_line_manager,account.payment.term.line,model_account_payment_term_line,account.group_account_manager,1,1,1,1 access_account_tax_manager,account.tax,model_account_tax,account.group_account_manager,1,1,1,1 access_account_journal_manager,account.journal,model_account_journal,account.group_account_manager,1,1,1,1 +access_account_journal_user,account.journal,model_account_journal,account.group_account_user,1,1,1,0 access_account_journal_invoice,account.journal invoice,model_account_journal,account.group_account_invoice,1,0,0,0 access_account_period_manager,account.period,model_account_period,account.group_account_manager,1,1,1,1 access_account_period_invoice,account.period invoice,model_account_period,account.group_account_invoice,1,0,0,0 @@ -99,3 +100,4 @@ access_account_sequence_fiscal_year_sale_manager,account.sequence.fiscalyear.sal access_account_treasury_report_manager,account.treasury.report.manager,model_account_treasury_report,account.group_account_manager,1,0,0,0 access_account_financial_report,account.financial.report,model_account_financial_report,account.group_account_user,1,1,1,1 access_account_financial_report_invoice,account.financial.report invoice,model_account_financial_report,account.group_account_invoice,1,0,0,0 +access_res_partner_bank,res.partner.bank,model_res_partner_bank,account.group_account_user,1,1,1,0 diff --git a/addons/account/test/account_customer_invoice.yml b/addons/account/test/account_customer_invoice.yml index 866e8921220..a41ca9bbfe4 100644 --- a/addons/account/test/account_customer_invoice.yml +++ b/addons/account/test/account_customer_invoice.yml @@ -1,3 +1,8 @@ +- + Test with that user which have rights to make Invoicing and payment and who is accountant. +- + !context + uid: 'res_users_account_user' - In order to test account invoice I create a new customer invoice - @@ -11,11 +16,6 @@ footer: True bank: base.res_bank_1 bank_name: Reserve -- - Test with that user which have rights to make Invoicing and payment and who is accountant. -- - !context - uid: 'res_users_account_user' - I create a customer invoice - From 1c52635020820ebe927d400c26825d350da9262d Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Tue, 19 Mar 2013 14:28:54 +0530 Subject: [PATCH 45/88] [IMP] add user group in context bzr revid: fka@tinyerp.com-20130319085854-norcgk7smiz37fs8 --- addons/crm/test/ui/crm_access_group_users.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/crm/test/ui/crm_access_group_users.yml b/addons/crm/test/ui/crm_access_group_users.yml index cc5be01ee85..407eb8007e5 100644 --- a/addons/crm/test/ui/crm_access_group_users.yml +++ b/addons/crm/test/ui/crm_access_group_users.yml @@ -1,20 +1,22 @@ - Create a user as 'Salesmanager' +- + !context + default_groups_ref: ['base.group_sale_manager'] - !record {model: res.users, id: crm_res_users_salesmanager}: company_id: base.main_company name: Sales manager login: csm password: csm - groups_id: - - base.group_sale_manager - Create a user as 'Salesman' +- + !context + default_groups_ref: ['base.group_sale_salesman_all_leads'] - !record {model: res.users, id: crm_res_users_salesman}: company_id: base.main_company name: Salesman login: csu password: csu - groups_id: - - base.group_sale_salesman_all_leads From b358bcd430399d9f0801903434ede39879f23cba Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Tue, 19 Mar 2013 14:44:40 +0530 Subject: [PATCH 46/88] [IMP] add user group in context of project & project_issue yml files bzr revid: fka@tinyerp.com-20130319091440-i6xrkrxzdskeayvs --- addons/project/test/project_users.yml | 10 ++++++---- addons/project_issue/test/issue_users.yml | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/addons/project/test/project_users.yml b/addons/project/test/project_users.yml index b23ab0fc7f6..ad8503d5f76 100644 --- a/addons/project/test/project_users.yml +++ b/addons/project/test/project_users.yml @@ -1,20 +1,22 @@ - Create a user as 'Project manager' +- + !context + default_groups_ref: ['project.group_project_manager'] - !record {model: res.users, id: res_users_project_manager}: company_id: base.main_company name: Project Manager login: prm password: prm - groups_id: - - project.group_project_manager - Create a user as 'Project user' +- + !context + default_groups_ref: ['project.group_project_user'] - !record {model: res.users, id: res_users_project_user}: company_id: base.main_company name: Project User login: pru password: pru - groups_id: - - project.group_project_user \ No newline at end of file diff --git a/addons/project_issue/test/issue_users.yml b/addons/project_issue/test/issue_users.yml index 3493ac58ffc..04789eb6334 100644 --- a/addons/project_issue/test/issue_users.yml +++ b/addons/project_issue/test/issue_users.yml @@ -1,20 +1,22 @@ - Create a user as 'Project manager' +- + !context + default_groups_ref: ['project.group_project_manager'] - !record {model: res.users, id: res_users_project_issue_manager}: company_id: base.main_company name: Project Manager login: prim password: prim - groups_id: - - project.group_project_manager - Create a user as 'Project user' +- + !context + default_groups_ref: ['project.group_project_user'] - !record {model: res.users, id: res_users_project_issue_user}: company_id: base.main_company name: Project User login: priu password: priu - groups_id: - - project.group_project_user \ No newline at end of file From 4d2f294a1287443f242f2fd3ada2e89014e7ceff Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Tue, 19 Mar 2013 15:03:08 +0530 Subject: [PATCH 47/88] [IMP] add user group in context of hr & hr_recruitment yml files bzr revid: fka@tinyerp.com-20130319093308-mjopwflkzi8tasf4 --- addons/hr/test/hr_users.yml | 15 +++++++++------ .../hr_recruitment/test/recruitment_process.yml | 5 +++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/addons/hr/test/hr_users.yml b/addons/hr/test/hr_users.yml index 3415b20efbd..265482ca457 100644 --- a/addons/hr/test/hr_users.yml +++ b/addons/hr/test/hr_users.yml @@ -1,30 +1,33 @@ - Create a user as 'HR Manager' +- + !context + default_groups_ref: [base.group_hr_manager] - !record {model: res.users, id: res_users_hr_manager}: company_id: base.main_company name: HR manager login: hrm password: hrm - groups_id: - - base.group_hr_manager - Create a user as 'HR Officer' +- + !context + default_groups_ref: [base.group_hr_user] - !record {model: res.users, id: res_users_hr_officer}: company_id: base.main_company name: HR Officer login: hro password: hro - groups_id: - - base.group_hr_user - Create a user as 'Employee' +- + !context + default_groups_ref: [base.group_user] - !record {model: res.users, id: res_users_employee}: company_id: base.main_company name: Employee login: emp password: emp - groups_id: - - base.group_user \ No newline at end of file diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index 0359f253dd9..c284aeb2181 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -1,13 +1,14 @@ - Create a user as 'HR Recruitment Officer' +- + !context + default_groups_ref: [base.group_hr_user] - !record {model: res.users, id: res_users_hr_officer}: company_id: base.main_company name: HR Officer login: hrro password: hrro - groups_id: - - base.group_hr_user - In Order to test process of Recruitment so giving HR officer's rights, - From 8b123b8d744633693cdf8ce3d3e8b72a0a1cde4d Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Tue, 19 Mar 2013 15:32:52 +0530 Subject: [PATCH 48/88] [IMP] add user group in context of event & hr_timesheet yml files bzr revid: fka@tinyerp.com-20130319100252-74kzr5qc41gj6d2t --- addons/event/test/ui/event_users.yml | 10 ++++++---- addons/hr_attendance/test/attendance_process.yml | 5 +++-- addons/hr_timesheet/test/hr_timesheet_users.yml | 15 +++++++++------ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/addons/event/test/ui/event_users.yml b/addons/event/test/ui/event_users.yml index 34564d6c433..e08464bdfd8 100644 --- a/addons/event/test/ui/event_users.yml +++ b/addons/event/test/ui/event_users.yml @@ -1,20 +1,22 @@ - Create a user as 'Event manager' +- + !context + default_groups_ref: [event.group_event_manager] - !record {model: res.users, id: res_users_eventmanager}: company_id: base.main_company name: Event manager login: em password: em - groups_id: - - event.group_event_manager - Create a user as 'Event user' +- + !context + default_groups_ref: [event.group_event_user] - !record {model: res.users, id: res_users_eventuser}: company_id: base.main_company name: User login: eu password: eu - groups_id: - - event.group_event_user \ No newline at end of file diff --git a/addons/hr_attendance/test/attendance_process.yml b/addons/hr_attendance/test/attendance_process.yml index 8348757b63e..383cf209bd4 100644 --- a/addons/hr_attendance/test/attendance_process.yml +++ b/addons/hr_attendance/test/attendance_process.yml @@ -1,13 +1,14 @@ - Create a user as 'HR Attendance Officer' +- + !context + default_groups_ref: [base.group_hr_user] - !record {model: res.users, id: res_users_attendance_officer}: company_id: base.main_company name: HR Officer login: ao password: ao - groups_id: - - base.group_hr_user - Give the access rights of Hr Officer to test attendance process. - diff --git a/addons/hr_timesheet/test/hr_timesheet_users.yml b/addons/hr_timesheet/test/hr_timesheet_users.yml index 428c1b7c40f..4a557bff44f 100644 --- a/addons/hr_timesheet/test/hr_timesheet_users.yml +++ b/addons/hr_timesheet/test/hr_timesheet_users.yml @@ -1,30 +1,33 @@ - Create a user as 'HR Manager' +- + !context + default_groups_ref: [base.group_hr_manager] - !record {model: res.users, id: res_hr_timesheet_manager}: company_id: base.main_company name: HR manager login: hrtm password: hrtm - groups_id: - - base.group_hr_manager - Create a user as 'HR Officer' +- + !context + default_groups_ref: [base.group_hr_user] - !record {model: res.users, id: res_hr_timesheet_officer}: company_id: base.main_company name: HR Officer login: hrto password: hrto - groups_id: - - base.group_hr_user - Create a user as 'Employee' +- + !context + default_groups_ref: [base.group_user] - !record {model: res.users, id: res_hr_timesheet_employee}: company_id: base.main_company name: Employee login: empt password: empt - groups_id: - - base.group_user \ No newline at end of file From eff57d769b8e0792e937353525d291d4f7db53da Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 19 Mar 2013 16:24:35 +0530 Subject: [PATCH 49/88] [IMP]add user access rights as per new improvement bzr revid: sgo@tinyerp.com-20130319105435-es76c9arqghz2rys --- addons/account/test/account_test_users.yml | 10 ++++++---- addons/account_voucher/test/account_voucher_users.yml | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/addons/account/test/account_test_users.yml b/addons/account/test/account_test_users.yml index 55e57968f50..7f4ccf1ed09 100644 --- a/addons/account/test/account_test_users.yml +++ b/addons/account/test/account_test_users.yml @@ -1,20 +1,22 @@ - Create a user as 'Accountant' +- + !context + default_groups_ref: [account.group_account_user] - !record {model: res.users, id: res_users_account_user}: company_id: base.main_company name: Accountant login: acc password: acc - groups_id: - - account.group_account_user - Create a user as 'Financial Manager' +- + !context + default_groups_ref: [account.group_account_manager] - !record {model: res.users, id: res_users_account_manager}: company_id: base.main_company name: Financial Manager login: fm password: fm - groups_id: - - account.group_account_manager \ No newline at end of file diff --git a/addons/account_voucher/test/account_voucher_users.yml b/addons/account_voucher/test/account_voucher_users.yml index e8a4fa3e612..c1ecb7f59f2 100644 --- a/addons/account_voucher/test/account_voucher_users.yml +++ b/addons/account_voucher/test/account_voucher_users.yml @@ -1,20 +1,22 @@ - Create a user as 'Accountant for voucher' +- + !context + default_groups_ref: [account.group_account_user] - !record {model: res.users, id: res_users_account_voucher_user}: company_id: base.main_company name: Voucher Accountant login: vacc password: acc - groups_id: - - account.group_account_user - Create a user as 'Financial Manager for account voucher' +- + !context + default_groups_ref: [account.group_account_manager] - !record {model: res.users, id: res_users_account_voucher_manager}: company_id: base.main_company name: Financial Manager for voucher login: fmv password: fmv - groups_id: - - account.group_account_manager \ No newline at end of file From 5823dc85635d5817d8cb244a9b496d73ff64b8ac Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Tue, 19 Mar 2013 16:56:21 +0530 Subject: [PATCH 50/88] [IMP] add user group in context in all yml files bzr revid: fka@tinyerp.com-20130319112621-ohy33bgzwmtmw8kl --- addons/mrp/test/mrp_users.yml | 10 ++++++---- .../test/workcenter_operations.yml | 5 +++-- addons/mrp_repair/test/mrp_repair_users.yml | 10 ++++++---- addons/purchase/test/ui/purchase_users.yml | 10 ++++++---- .../test/purchase_reqisition_users.yml | 10 ++++++---- addons/sale/test/create_sale_users.yml | 10 ++++++---- addons/sale_stock/test/sale_stock_users.yml | 20 +++++++++++-------- addons/stock/test/stock_users.yml | 10 ++++++---- 8 files changed, 51 insertions(+), 34 deletions(-) diff --git a/addons/mrp/test/mrp_users.yml b/addons/mrp/test/mrp_users.yml index d18cc51e8e6..ccbb37e133c 100644 --- a/addons/mrp/test/mrp_users.yml +++ b/addons/mrp/test/mrp_users.yml @@ -1,20 +1,22 @@ - Create a user as 'MRP Manager' +- + !context + default_groups_ref: [mrp.group_mrp_manager] - !record {model: res.users, id: res_users_mrp_manager}: company_id: base.main_company name: MRP Manager login: mam password: mam - groups_id: - - mrp.group_mrp_manager - Create a user as 'MRP User' +- + !context + default_groups_ref: [mrp.group_mrp_user] - !record {model: res.users, id: res_users_mrp_user}: company_id: base.main_company name: MRP User login: mau password: mau - groups_id: - - mrp.group_mrp_user diff --git a/addons/mrp_operations/test/workcenter_operations.yml b/addons/mrp_operations/test/workcenter_operations.yml index 3bcdc77ecab..14eab36e345 100644 --- a/addons/mrp_operations/test/workcenter_operations.yml +++ b/addons/mrp_operations/test/workcenter_operations.yml @@ -1,13 +1,14 @@ - Create a user as 'MRP User' +- + !context + default_groups_ref: [mrp.group_mrp_user] - !record {model: res.users, id: res_mrp_operation_user}: company_id: base.main_company name: MRP User login: maou password: maou - groups_id: - - mrp.group_mrp_user - In order to test mrp_operations with OpenERP, I refer created production order of PC Assemble SC349 with routing - Manual Component's Assembly to test complete production process with respect of workcenter with giving access rights of MRP User. diff --git a/addons/mrp_repair/test/mrp_repair_users.yml b/addons/mrp_repair/test/mrp_repair_users.yml index dee61653209..986320ed941 100644 --- a/addons/mrp_repair/test/mrp_repair_users.yml +++ b/addons/mrp_repair/test/mrp_repair_users.yml @@ -1,20 +1,22 @@ - Create a user as 'MRP Repair Manager' +- + !context + default_groups_ref: [mrp.group_mrp_manager] - !record {model: res.users, id: res_mrp_repair_manager}: company_id: base.main_company name: MRP Manager login: marm password: marm - groups_id: - - mrp.group_mrp_manager - Create a user as 'MRP Repair User' +- + !context + default_groups_ref: [mrp.group_mrp_user] - !record {model: res.users, id: res_mrp_repair_user}: company_id: base.main_company name: MRP User login: maru password: maru - groups_id: - - mrp.group_mrp_user \ No newline at end of file diff --git a/addons/purchase/test/ui/purchase_users.yml b/addons/purchase/test/ui/purchase_users.yml index e36d8140d28..c0a60955d99 100644 --- a/addons/purchase/test/ui/purchase_users.yml +++ b/addons/purchase/test/ui/purchase_users.yml @@ -1,20 +1,22 @@ - Create a user as 'Purchase manager' +- + !context + default_groups_ref: ['purchase.group_purchase_manager'] - !record {model: res.users, id: res_users_purchase_manager}: company_id: base.main_company name: Purchase Manager login: pm password: pm - groups_id: - - purchase.group_purchase_manager - Create a user as 'Purchase user' +- + !context + default_groups_ref: ['purchase.group_purchase_user'] - !record {model: res.users, id: res_users_purchase_user}: company_id: base.main_company name: Purchase User login: pu password: pu - groups_id: - - purchase.group_purchase_user \ No newline at end of file diff --git a/addons/purchase_requisition/test/purchase_reqisition_users.yml b/addons/purchase_requisition/test/purchase_reqisition_users.yml index abf62286998..9a903cde306 100644 --- a/addons/purchase_requisition/test/purchase_reqisition_users.yml +++ b/addons/purchase_requisition/test/purchase_reqisition_users.yml @@ -1,20 +1,22 @@ - Create a user as 'Purchase Reqisition Manager' +- + !context + default_groups_ref: ['purchase_requisition.group_purchase_requisition_manager'] - !record {model: res.users, id: res_users_purchase_requisition_manager}: company_id: base.main_company name: Purchase Reqisition Manager login: prm password: prm - groups_id: - - purchase_requisition.group_purchase_requisition_manager - Create a user as 'Purchase Reqisition User' +- + !context + default_groups_ref: ['purchase_requisition.group_purchase_requisition_user'] - !record {model: res.users, id: res_users_purchase_requisition_user}: company_id: base.main_company name: Purchase Reqisition User login: pru password: pru - groups_id: - - purchase_requisition.group_purchase_requisition_user \ No newline at end of file diff --git a/addons/sale/test/create_sale_users.yml b/addons/sale/test/create_sale_users.yml index a61c4bd7c99..29e09b38b80 100644 --- a/addons/sale/test/create_sale_users.yml +++ b/addons/sale/test/create_sale_users.yml @@ -1,20 +1,22 @@ - Create a user as 'Salesmanager' +- + !context + default_groups_ref: ['base.group_sale_manager'] - !record {model: res.users, id: res_users_salesmanager}: company_id: base.main_company name: Sales manager login: sm password: sm - groups_id: - - base.group_sale_manager - Create a user as 'Salesman' +- + !context + default_groups_ref: ['base.group_sale_salesman_all_leads'] - !record {model: res.users, id: res_users_salesman}: company_id: base.main_company name: Salesman login: su password: su - groups_id: - - base.group_sale_salesman_all_leads diff --git a/addons/sale_stock/test/sale_stock_users.yml b/addons/sale_stock/test/sale_stock_users.yml index f9bd1cf1727..d64fcac2503 100644 --- a/addons/sale_stock/test/sale_stock_users.yml +++ b/addons/sale_stock/test/sale_stock_users.yml @@ -1,35 +1,41 @@ - Create a user as 'Salesmanager' +- + !context + default_groups_ref: ['base.group_sale_manager'] - !record {model: res.users, id: res_sale_stock_salesmanager}: company_id: base.main_company name: Sales manager login: ssm password: ssm - groups_id: - - base.group_sale_manager - Create a user as 'Salesman' +- + !context + default_groups_ref: ['base.group_sale_salesman_all_leads'] - !record {model: res.users, id: res_sale_stock_salesman}: company_id: base.main_company name: Salesman login: ssu password: ssu - groups_id: - - base.group_sale_salesman_all_leads - Create a user as 'Stock User' +- + !context + default_groups_ref: ['stock.group_stock_user'] - !record {model: res.users, id: res_stock_user}: company_id: base.main_company name: Stock User login: sau password: sau - groups_id: - - stock.group_stock_user - Create a user as 'Stock Manager' +- + !context + default_groups_ref: ['stock.group_stock_manager'] - !record {model: res.users, id: res_stock_manager}: company_id: base.main_company @@ -37,5 +43,3 @@ login: sam password: sam email: admin@portal.example.com - groups_id: - - stock.group_stock_manager \ No newline at end of file diff --git a/addons/stock/test/stock_users.yml b/addons/stock/test/stock_users.yml index 82d48197b0d..13074d752f3 100644 --- a/addons/stock/test/stock_users.yml +++ b/addons/stock/test/stock_users.yml @@ -1,20 +1,22 @@ - Create a user as 'Stock Manager' +- + !context + default_groups_ref: ['stock.group_stock_manager'] - !record {model: res.users, id: res_users_stock_manager}: company_id: base.main_company name: Stock Manager login: sam password: sam - groups_id: - - stock.group_stock_manager - Create a user as 'Stock User' +- + !context + default_groups_ref: ['stock.group_stock_user'] - !record {model: res.users, id: res_users_stock_user}: company_id: base.main_company name: Stock User login: sau password: sau - groups_id: - - stock.group_stock_user From 1e14b224351b5a784479de09ef51fd2306ec19b3 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Wed, 20 Mar 2013 11:10:49 +0530 Subject: [PATCH 51/88] [IMP]add email to user as per new improvement bzr revid: sgo@tinyerp.com-20130320054049-4cr1a52dlpfw2lgf --- addons/account/test/account_test_users.yml | 2 ++ addons/account_voucher/test/account_voucher_users.yml | 2 ++ addons/crm/test/ui/crm_access_group_users.yml | 2 ++ addons/event/test/ui/event_users.yml | 2 ++ addons/hr_recruitment/test/recruitment_process.yml | 1 + addons/mrp/test/mrp_users.yml | 2 ++ addons/mrp_operations/test/workcenter_operations.yml | 1 + addons/mrp_repair/test/mrp_repair_users.yml | 2 ++ addons/project/test/project_users.yml | 2 ++ addons/project_issue/test/issue_users.yml | 2 ++ addons/purchase/test/ui/purchase_users.yml | 2 ++ addons/purchase_requisition/__openerp__.py | 2 +- ..._reqisition_users.yml => purchase_requisition_users.yml} | 6 ++++-- addons/sale/test/create_sale_users.yml | 2 ++ addons/sale_stock/test/sale_stock_users.yml | 5 +++++ addons/stock/test/stock_users.yml | 2 ++ 16 files changed, 34 insertions(+), 3 deletions(-) rename addons/purchase_requisition/test/{purchase_reqisition_users.yml => purchase_requisition_users.yml} (77%) diff --git a/addons/account/test/account_test_users.yml b/addons/account/test/account_test_users.yml index 7f4ccf1ed09..322bc527ad7 100644 --- a/addons/account/test/account_test_users.yml +++ b/addons/account/test/account_test_users.yml @@ -9,6 +9,7 @@ name: Accountant login: acc password: acc + email: accountuser@yourcompany.com - Create a user as 'Financial Manager' - @@ -20,3 +21,4 @@ name: Financial Manager login: fm password: fm + email: accountmanager@yourcompany.com diff --git a/addons/account_voucher/test/account_voucher_users.yml b/addons/account_voucher/test/account_voucher_users.yml index c1ecb7f59f2..8888885f476 100644 --- a/addons/account_voucher/test/account_voucher_users.yml +++ b/addons/account_voucher/test/account_voucher_users.yml @@ -9,6 +9,7 @@ name: Voucher Accountant login: vacc password: acc + email: accountant@yourcompany.com - Create a user as 'Financial Manager for account voucher' - @@ -20,3 +21,4 @@ name: Financial Manager for voucher login: fmv password: fmv + email: finmanager@yourcompany.com diff --git a/addons/crm/test/ui/crm_access_group_users.yml b/addons/crm/test/ui/crm_access_group_users.yml index 407eb8007e5..158a11b5881 100644 --- a/addons/crm/test/ui/crm_access_group_users.yml +++ b/addons/crm/test/ui/crm_access_group_users.yml @@ -9,6 +9,7 @@ name: Sales manager login: csm password: csm + email: crmmanager@yourcompany.com - Create a user as 'Salesman' - @@ -20,3 +21,4 @@ name: Salesman login: csu password: csu + email: crmuser@yourcompany.com diff --git a/addons/event/test/ui/event_users.yml b/addons/event/test/ui/event_users.yml index e08464bdfd8..92c8316a5d9 100644 --- a/addons/event/test/ui/event_users.yml +++ b/addons/event/test/ui/event_users.yml @@ -9,6 +9,7 @@ name: Event manager login: em password: em + email: eventmanager@yourcompany.com - Create a user as 'Event user' - @@ -20,3 +21,4 @@ name: User login: eu password: eu + email: eventuser@yourcompany.com diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index c284aeb2181..930f95039f8 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -9,6 +9,7 @@ name: HR Officer login: hrro password: hrro + email: hrofcr@yourcompany.com - In Order to test process of Recruitment so giving HR officer's rights, - diff --git a/addons/mrp/test/mrp_users.yml b/addons/mrp/test/mrp_users.yml index ccbb37e133c..965a809eddc 100644 --- a/addons/mrp/test/mrp_users.yml +++ b/addons/mrp/test/mrp_users.yml @@ -9,6 +9,7 @@ name: MRP Manager login: mam password: mam + email: mrp_manager@yourcompany.com - Create a user as 'MRP User' - @@ -20,3 +21,4 @@ name: MRP User login: mau password: mau + email: mrp_user@yourcompany.com diff --git a/addons/mrp_operations/test/workcenter_operations.yml b/addons/mrp_operations/test/workcenter_operations.yml index 14eab36e345..3fc5b332d18 100644 --- a/addons/mrp_operations/test/workcenter_operations.yml +++ b/addons/mrp_operations/test/workcenter_operations.yml @@ -9,6 +9,7 @@ name: MRP User login: maou password: maou + email: mrp_operation_user@yourcompany.com - In order to test mrp_operations with OpenERP, I refer created production order of PC Assemble SC349 with routing - Manual Component's Assembly to test complete production process with respect of workcenter with giving access rights of MRP User. diff --git a/addons/mrp_repair/test/mrp_repair_users.yml b/addons/mrp_repair/test/mrp_repair_users.yml index 986320ed941..f7ee95314e2 100644 --- a/addons/mrp_repair/test/mrp_repair_users.yml +++ b/addons/mrp_repair/test/mrp_repair_users.yml @@ -9,6 +9,7 @@ name: MRP Manager login: marm password: marm + email: mrp_repair_manager@yourcompany.com - Create a user as 'MRP Repair User' - @@ -20,3 +21,4 @@ name: MRP User login: maru password: maru + email: mrp_repair_user@yourcompany.com diff --git a/addons/project/test/project_users.yml b/addons/project/test/project_users.yml index ad8503d5f76..8ae3c23dca1 100644 --- a/addons/project/test/project_users.yml +++ b/addons/project/test/project_users.yml @@ -9,6 +9,7 @@ name: Project Manager login: prm password: prm + email: projectmanager@yourcompany.com - Create a user as 'Project user' - @@ -20,3 +21,4 @@ name: Project User login: pru password: pru + email: projectuser@yourcompany.com diff --git a/addons/project_issue/test/issue_users.yml b/addons/project_issue/test/issue_users.yml index 04789eb6334..402478b1c54 100644 --- a/addons/project_issue/test/issue_users.yml +++ b/addons/project_issue/test/issue_users.yml @@ -9,6 +9,7 @@ name: Project Manager login: prim password: prim + email: issuemanager@yourcompany.com - Create a user as 'Project user' - @@ -20,3 +21,4 @@ name: Project User login: priu password: priu + email: issueuser@yourcompany.com diff --git a/addons/purchase/test/ui/purchase_users.yml b/addons/purchase/test/ui/purchase_users.yml index c0a60955d99..9dd5e9c0195 100644 --- a/addons/purchase/test/ui/purchase_users.yml +++ b/addons/purchase/test/ui/purchase_users.yml @@ -9,6 +9,7 @@ name: Purchase Manager login: pm password: pm + email: purchasemanager@yourcompany.com - Create a user as 'Purchase user' - @@ -20,3 +21,4 @@ name: Purchase User login: pu password: pu + email: purchaseuser@yourcompany.com diff --git a/addons/purchase_requisition/__openerp__.py b/addons/purchase_requisition/__openerp__.py index d2a94365318..3f5fce3e8cc 100644 --- a/addons/purchase_requisition/__openerp__.py +++ b/addons/purchase_requisition/__openerp__.py @@ -43,7 +43,7 @@ keep track and order all your purchase orders. ], 'auto_install': False, 'test': [ - 'test/purchase_reqisition_users.yml', + 'test/purchase_requisition_users.yml', 'test/purchase_requisition_demo.yml', 'test/purchase_requisition.yml', 'test/cancel_purchase_requisition.yml', diff --git a/addons/purchase_requisition/test/purchase_reqisition_users.yml b/addons/purchase_requisition/test/purchase_requisition_users.yml similarity index 77% rename from addons/purchase_requisition/test/purchase_reqisition_users.yml rename to addons/purchase_requisition/test/purchase_requisition_users.yml index 9a903cde306..41bc7cd318e 100644 --- a/addons/purchase_requisition/test/purchase_reqisition_users.yml +++ b/addons/purchase_requisition/test/purchase_requisition_users.yml @@ -6,9 +6,10 @@ - !record {model: res.users, id: res_users_purchase_requisition_manager}: company_id: base.main_company - name: Purchase Reqisition Manager + name: Purchase requisition Manager login: prm password: prm + email: requisition_manager@yourcompany.com - Create a user as 'Purchase Reqisition User' - @@ -17,6 +18,7 @@ - !record {model: res.users, id: res_users_purchase_requisition_user}: company_id: base.main_company - name: Purchase Reqisition User + name: Purchase requisition User login: pru password: pru + email: requisition_user@yourcompany.com diff --git a/addons/sale/test/create_sale_users.yml b/addons/sale/test/create_sale_users.yml index 29e09b38b80..ed575073f5d 100644 --- a/addons/sale/test/create_sale_users.yml +++ b/addons/sale/test/create_sale_users.yml @@ -9,6 +9,7 @@ name: Sales manager login: sm password: sm + email: salesmanager@yourcompany.com - Create a user as 'Salesman' - @@ -20,3 +21,4 @@ name: Salesman login: su password: su + email: salesman@yourcompany.com diff --git a/addons/sale_stock/test/sale_stock_users.yml b/addons/sale_stock/test/sale_stock_users.yml index d64fcac2503..c1ebd54392c 100644 --- a/addons/sale_stock/test/sale_stock_users.yml +++ b/addons/sale_stock/test/sale_stock_users.yml @@ -9,6 +9,7 @@ name: Sales manager login: ssm password: ssm + email: ss_salesmanager@yourcompany.com - Create a user as 'Salesman' - @@ -20,6 +21,7 @@ name: Salesman login: ssu password: ssu + email: ss_salesman@yourcompany.com - Create a user as 'Stock User' - @@ -31,6 +33,8 @@ name: Stock User login: sau password: sau + email: stock_user@yourcompany.com + - Create a user as 'Stock Manager' - @@ -43,3 +47,4 @@ login: sam password: sam email: admin@portal.example.com + email: stock_manager@yourcompany.com diff --git a/addons/stock/test/stock_users.yml b/addons/stock/test/stock_users.yml index 13074d752f3..b8fe0783ca1 100644 --- a/addons/stock/test/stock_users.yml +++ b/addons/stock/test/stock_users.yml @@ -9,6 +9,7 @@ name: Stock Manager login: sam password: sam + email: stockmanager@yourcompany.com - Create a user as 'Stock User' - @@ -20,3 +21,4 @@ name: Stock User login: sau password: sau + email: stockuser@yourcompany.com From 21c4fee43dde9587a42527fbb7a809f1a45b1df0 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Thu, 28 Mar 2013 17:28:01 +0530 Subject: [PATCH 52/88] [IMP]improve mrp yaml bzr revid: sgo@tinyerp.com-20130328115801-kh4k8ctnh3x5oae2 --- addons/mrp/test/order_process.yml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml index 8aa408483e9..d5cc6dee964 100644 --- a/addons/mrp/test/order_process.yml +++ b/addons/mrp/test/order_process.yml @@ -1,8 +1,3 @@ -- - MRP user can doing all process related to Production Order, so let's check data with giving the access rights of user. -- - !context - uid: 'res_users_mrp_user' - I compute the production order. - @@ -28,6 +23,7 @@ I confirm the Production Order. - !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_test1} + - I check details of Produce Move of Production Order to trace Final Product. - @@ -63,6 +59,16 @@ assert move_line.product_uos.id == order_line.product_uos.id, "UOS is not correspond in 'To consume line'." assert move_line.location_id.id == routing_loc or order.location_src_id.id, "Source location is not correspond in 'To consume line'." assert move_line.location_dest_id.id == source_location_id, "Destination Location is not correspond in 'To consume line'." +- + I consume raw materials and put one material in scrap location due to waste it. +- + !python {model: mrp.production}: | + scrap_location_ids = self.pool.get('stock.location').search(cr, uid, [('scrap_location','=',True)]) + scrap_location_id = scrap_location_ids[0] + order = self.browse(cr, uid, ref("mrp_production_test1")) + for move in order.move_lines: + if move.product_id.id == ref("product.product_product_6"): + move.action_scrap(5.0, scrap_location_id) - I check details of an Internal Shipment after confirmed production order to bring components in Raw Materials Location. - @@ -154,17 +160,6 @@ !python {model: mrp.production}: | order = self.browse(cr, uid, ref("mrp_production_test1")) assert order.state == 'in_production', 'Production order should be in production State.' -- - I consume raw materials and put one material in scrap location due to waste it. -- - !python {model: mrp.production}: | - scrap_location_ids = self.pool.get('stock.location').search(cr, uid, [('scrap_location','=',True)]) - scrap_location_id = scrap_location_ids[0] - order = self.browse(cr, uid, ref("mrp_production_test1")) - for move in order.move_lines: - move.action_consume(move.product_qty) - if move.product_id.id == ref("product.product_product_6"): - move.action_scrap(5.0, scrap_location_id) - I produce product. - From 037f2f590d8da0cdfda22738a727e2beaa1edcdd Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Thu, 28 Mar 2013 18:29:39 +0530 Subject: [PATCH 53/88] [IMP]improve stock shipment.yml bzr revid: sgo@tinyerp.com-20130328125939-06de8aj23spjc5uu --- addons/stock/test/shipment.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/stock/test/shipment.yml b/addons/stock/test/shipment.yml index 96273a081b7..4c715584756 100644 --- a/addons/stock/test/shipment.yml +++ b/addons/stock/test/shipment.yml @@ -193,7 +193,7 @@ !python {model: stock.location}: | ctx = {'product_id': ref('product_product_6')} monitor_location = self.pool.get('stock.location').browse(cr, uid, ref('location_monitor'), context=ctx) - assert monitor_location.stock_real == 136.0, 'stock does not correspond in stock location shop0.' + assert monitor_location.stock_real == 132.0, 'stock does not correspond in stock location shop0.' scrapped_location = self.browse(cr, uid, ref('stock_location_scrapped'), context=ctx) assert scrapped_location.stock_real == 1*4, 'scraped stock does not correspond in scrap location.' @@ -202,8 +202,8 @@ - !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) - assert product.qty_available == 136.0, "Stock does not correspond." - assert round(product.virtual_available, 2) == -4.00, "Vitual stock does not correspond." + assert product.qty_available == 132.0, "Stock does not correspond." + assert round(product.virtual_available, 2) == -8.00, "Vitual stock does not correspond." - I trace all incoming lots. - @@ -277,5 +277,5 @@ - !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) - assert round(product.qty_available, 2) == 6, "Stock does not correspond." - assert round(product.virtual_available, 2) == -4.00, "Vitual stock does not correspond." + assert round(product.qty_available, 2) == 2, "Stock does not correspond." + assert round(product.virtual_available, 2) == -8.00, "Vitual stock does not correspond." From 412efcda33bbf48aaff3c94dff5c5b8863cfa9cf Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Thu, 28 Mar 2013 18:37:43 +0530 Subject: [PATCH 54/88] [IMP]improve mrp yaml minor changes bzr revid: sgo@tinyerp.com-20130328130743-ky1hz52gskju1q7t --- addons/mrp/test/order_process.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml index d5cc6dee964..aac6064443d 100644 --- a/addons/mrp/test/order_process.yml +++ b/addons/mrp/test/order_process.yml @@ -1,3 +1,8 @@ +- + MRP user can doing all process related to Production Order, so let's check data with giving the access rights of user. +- + !context + uid: 'res_users_mrp_user' - I compute the production order. - From 94c7156ebe4218836df56f0407c8853345f66827 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Fri, 29 Mar 2013 14:35:58 +0530 Subject: [PATCH 55/88] [IMP]improve stock shipment yml and add test with manager bzr revid: sgo@tinyerp.com-20130329090558-ksv44h3cakskf57l --- addons/stock/test/shipment.yml | 87 ++++------------------------------ 1 file changed, 8 insertions(+), 79 deletions(-) diff --git a/addons/stock/test/shipment.yml b/addons/stock/test/shipment.yml index 4c715584756..59b6a6aad48 100644 --- a/addons/stock/test/shipment.yml +++ b/addons/stock/test/shipment.yml @@ -1,3 +1,8 @@ +- + Only stock manager can confirm shipment and picking, so let's check data with giving the access rights of manager +- + !context + uid: 'res_users_stock_manager' - I confirm outgoing shipment of 130 unit 15” LCD Monitor. - @@ -91,7 +96,7 @@ !python {model: stock.picking}: | # the cancel is not on the return, but on the incomming shipment (which now has a quantity of 10, thanks to the # backorder). This situation is a little weird as we returned a move that we finally cancelled... As result, only - # 30Kg from the original 50Kg will be counted in the stock (50 - 10 (cancelled quantity) - 10 (returned quantity)) + # 30Unit from the original 50Unit will be counted in the stock (50 - 10 (cancelled quantity) - 10 (returned quantity)) self.action_cancel(cr, uid, [ref("incomming_shipment")], context=context) - I make invoice of backorder of incomming shipment. @@ -118,41 +123,6 @@ product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.qty_available == 140, "Stock does not correspond." assert product.virtual_available == 0, "Vitual stock does not correspond." -- - I split incomming shipment into lots. each lot contain 10 unit 15” LCD Monitor. -- - !python {model: stock.picking}: | - shipment = self.browse(cr, uid, ref("incomming_shipment")) - move_ids = [x.id for x in shipment.backorder_id.move_lines] - context.update({'active_model': 'stock.move', 'active_id': move_ids[0], 'active_ids': move_ids}) -- - !record {model: stock.move.split, id: split_lot_incomming}: - line_ids: - - name: incoming_lot0 - quantity: 10 - - name: incoming_lot1 - quantity: 10 - - name: incoming_lot2 - quantity: 10 - - name: incoming_lot3 - quantity: 10 - -- - !python {model: stock.move.split }: | - self.split_lot(cr, uid, [ref('split_lot_incomming')], context=context) -- - I check move lines after spliting -- - !python {model: stock.move}: | - lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incomming'), context=context) - lot_ids = self.pool.get('stock.production.lot').search(cr, uid, [('name','in',[x.name for x in lot.line_ids])]) - assert len(lot_ids) == 4, 'lots of incomming shipment are not correspond.' - move_ids = self.search(cr, uid, [('location_dest_id','=',ref('location_monitor')),('prodlot_id','in',lot_ids)]) - assert len(move_ids) == 4, 'move lines are not correspond per prodcution lot after splited.' - for move in self.browse(cr, uid, move_ids, context=context): - assert move.prodlot_id.name in ['incoming_lot0', 'incoming_lot1', 'incoming_lot2', 'incoming_lot3'], "lot does not correspond." - assert move.product_qty == 10, "qty does not correspond per production lot." - context.update({'active_model':'stock.move', 'active_id':move_ids[0],'active_ids': move_ids}) - I check the stock valuation account entries. - @@ -170,47 +140,6 @@ else: assert account_move_line.credit == 0.0, "Credit amount does not correspond." assert account_move_line.debit == 10000.0, "Debit amount does not correspond." -- - I consume 1 unit 15” LCD Monitor from each incoming lots into internal production. -- - !record {model: stock.move.consume, id: consume_lot_incomming}: - product_qty: 1 - location_id: location_monitor -- - !python {model: stock.move.consume}: | - self.do_move_consume(cr, uid, [ref('consume_lot_incomming')], context=context) -- - I scrap 1 unit 15” LCD Monitor from each incoming lots into scrap location. -- - !record {model: stock.move.scrap, id: scrap_lot_incomming}: - product_qty: 1 -- - !python {model: stock.move.scrap}: | - self.move_scrap(cr, uid, [ref('scrap_lot_incomming')], context=context) -- - I check stock in scrap location and stock location shop0. -- - !python {model: stock.location}: | - ctx = {'product_id': ref('product_product_6')} - monitor_location = self.pool.get('stock.location').browse(cr, uid, ref('location_monitor'), context=ctx) - assert monitor_location.stock_real == 132.0, 'stock does not correspond in stock location shop0.' - scrapped_location = self.browse(cr, uid, ref('stock_location_scrapped'), context=ctx) - assert scrapped_location.stock_real == 1*4, 'scraped stock does not correspond in scrap location.' - -- - I check availabile stock after consumed and scraped. -- - !python {model: product.product}: | - product = self.browse(cr, uid, ref('product_product_6'), context=context) - assert product.qty_available == 132.0, "Stock does not correspond." - assert round(product.virtual_available, 2) == -8.00, "Vitual stock does not correspond." -- - I trace all incoming lots. -- - !python {model: stock.production.lot }: | - lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incomming'), context=context) - lot_ids = self.search(cr, uid, [('name', 'in', [x.name for x in lot.line_ids])]) - self.action_traceability(cr, uid, lot_ids, context=context) - I check outgoing shipment after stock availablity in Chicago shop. - @@ -277,5 +206,5 @@ - !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) - assert round(product.qty_available, 2) == 2, "Stock does not correspond." - assert round(product.virtual_available, 2) == -8.00, "Vitual stock does not correspond." + assert round(product.qty_available, 2) == 10, "Stock does not correspond." + From 382171d4174379567a1abe535a0cb3348ccbe089 Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Fri, 29 Mar 2013 21:04:03 +0530 Subject: [PATCH 56/88] [IMP]: stock: Improved shipment.yml for split lot problem for stock manager bzr revid: rpa@tinyerp.com-20130329153403-n85d6kwk6edrplor --- addons/stock/stock_demo.yml | 2 +- addons/stock/test/shipment.yml | 191 +++++++++++++++++---------------- 2 files changed, 100 insertions(+), 93 deletions(-) diff --git a/addons/stock/stock_demo.yml b/addons/stock/stock_demo.yml index 64be92f8d06..d925ba4dc8e 100644 --- a/addons/stock/stock_demo.yml +++ b/addons/stock/stock_demo.yml @@ -44,7 +44,7 @@ valuation: real_time cost_method: average property_stock_account_input: account.conf_o_income - property_stock_account_output: account.conf_o_expense + property_stock_account_output: account.a_expense - Stock user can handled production lot,inventory and picking, so let's check data with giving the access rights of user - diff --git a/addons/stock/test/shipment.yml b/addons/stock/test/shipment.yml index 4c715584756..909050d0483 100644 --- a/addons/stock/test/shipment.yml +++ b/addons/stock/test/shipment.yml @@ -1,3 +1,6 @@ +- + !context + uid: 'res_users_stock_manager' - I confirm outgoing shipment of 130 unit 15” LCD Monitor. - @@ -16,29 +19,68 @@ - !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) - product.virtual_available == -30, "Vitual stock is not updated." + assert product.virtual_available == -30, "Vitual stock is not updated." - I confirm incomming shipment of 50 unit 15” LCD Monitor. - !workflow {model: stock.picking, action: button_confirm, ref: incomming_shipment} +- + I split incomming shipment into lots. each lot contain 10 unit 15” LCD Monitor. +- + !python {model: stock.picking}: | + shipment = self.browse(cr, uid, ref("incomming_shipment")) + move_ids = [x.id for x in shipment.move_lines] + context.update({'active_model': 'stock.move', 'active_id': move_ids[0], 'active_ids': move_ids}) +- + !record {model: stock.move.split, id: split_lot_incomming}: + line_ids: + - name: incoming_lot0 + quantity: 10 + - name: incoming_lot1 + quantity: 10 + - name: incoming_lot2 + quantity: 10 + - name: incoming_lot3 + quantity: 10 +- + !python {model: stock.move.split }: | + self.split_lot(cr, uid, [ref('split_lot_incomming')], context=context) +- + I check move lines after spliting +- + !python {model: stock.move}: | + mm = self.browse(cr, uid, ref("incomming_shipment_monitor")) + lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incomming'), context=context) + lot_ids = self.pool.get('stock.production.lot').search(cr, uid, [('name','in',[x.name for x in lot.line_ids])]) + assert len(lot_ids) == 4, 'lots of incomming shipment are not correspond.' + move_ids = self.search(cr, uid, [('location_dest_id','=',ref('location_monitor')),('prodlot_id','in',lot_ids)]) + assert len(move_ids) == 4, 'move lines are not correspond per prodcution lot after splited.' + for move in self.browse(cr, uid, move_ids, context=context): + assert move.prodlot_id.name in ['incoming_lot0', 'incoming_lot1', 'incoming_lot2', 'incoming_lot3'], "lot does not correspond." + assert move.product_qty == 10, "qty does not correspond per production lot." - I receive 40 unit 15” LCD Monitor so I make backorder of incomming shipment for 40 unit. - !python {model: stock.partial.picking}: | context.update({'active_model': 'stock.picking', 'active_id': ref('incomming_shipment'), 'active_ids': [ref('incomming_shipment')]}) - - !record {model: stock.partial.picking, id: partial_incomming}: - move_ids: - - quantity: 40 - product_id: product_product_6 - product_uom: product.product_uom_unit - move_id: incomming_shipment_monitor - location_id: stock_location_3 - location_dest_id: location_monitor -- - !python {model: stock.partial.picking }: | - self.do_partial(cr, uid, [ref('partial_incomming')], context=context) + !python {model: stock.partial.picking}: | + partial = [] + for move in self.pool.get('stock.picking').browse(cr, uid, ref("incomming_shipment")).move_lines: + if move.prodlot_id: + partial.append((0, 0, { + 'quantity': move.product_qty, + 'product_id': move.product_id.id, + 'product_uom': move.product_uom.id, + 'move_id': move.id, + 'location_id': move.location_id.id, + 'location_dest_id': move.location_dest_id.id, + 'prodlot_id': move.prodlot_id.id, + 'cost': move.product_id.standard_price + })) + partial_id = self.create(cr, uid, {'move_ids': partial}, context=context) + self.do_partial(cr, uid, [partial_id], context=context) - I check backorder shipment after received partial shipment. - @@ -46,10 +88,12 @@ shipment = self.browse(cr, uid, ref("incomming_shipment")) backorder = shipment.backorder_id assert backorder, "Backorder should be created after partial shipment." - assert backorder.state == 'done', "Backorder should be close after received." + assert backorder.state == 'done', "Backorder should be closed after received." + qty = 0 for move_line in backorder.move_lines: - assert move_line.product_qty == 40, "Qty in backorder does not correspond." assert move_line.state == 'done', "Move line of backorder should be closed." + qty += move_line.product_qty + assert qty == 40, "Qty in backorder does not correspond." - I receive another 10 unit 15” LCD Monitor. - @@ -64,18 +108,16 @@ - !python {model: stock.partial.picking }: | self.do_partial(cr, uid, [ref('partial_incomming')], context=context) - - - I check incomming shipment after received. + I check incomming shipment after receiving it. - !python {model: stock.picking}: | shipment = self.browse(cr, uid, ref("incomming_shipment")) - assert shipment.state == 'done', "shipment should be close after received." + assert shipment.state == 'done', "shipment should be closed after receiving." for move_line in shipment.move_lines: assert move_line.product_qty == 10, "Qty does not correspond." assert move_line.product_id.virtual_available == 20, "Virtual stock does not correspond." assert move_line.state == 'done', "Move line should be closed." - - I return last incomming shipment for 10 unit 15” LCD Monitor. - @@ -91,7 +133,7 @@ !python {model: stock.picking}: | # the cancel is not on the return, but on the incomming shipment (which now has a quantity of 10, thanks to the # backorder). This situation is a little weird as we returned a move that we finally cancelled... As result, only - # 30Kg from the original 50Kg will be counted in the stock (50 - 10 (cancelled quantity) - 10 (returned quantity)) + # 30Unit from the original 50Unit will be counted in the stock (50 - 10 (cancelled quantity) - 10 (returned quantity)) self.action_cancel(cr, uid, [ref("incomming_shipment")], context=context) - I make invoice of backorder of incomming shipment. @@ -118,41 +160,6 @@ product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.qty_available == 140, "Stock does not correspond." assert product.virtual_available == 0, "Vitual stock does not correspond." -- - I split incomming shipment into lots. each lot contain 10 unit 15” LCD Monitor. -- - !python {model: stock.picking}: | - shipment = self.browse(cr, uid, ref("incomming_shipment")) - move_ids = [x.id for x in shipment.backorder_id.move_lines] - context.update({'active_model': 'stock.move', 'active_id': move_ids[0], 'active_ids': move_ids}) -- - !record {model: stock.move.split, id: split_lot_incomming}: - line_ids: - - name: incoming_lot0 - quantity: 10 - - name: incoming_lot1 - quantity: 10 - - name: incoming_lot2 - quantity: 10 - - name: incoming_lot3 - quantity: 10 - -- - !python {model: stock.move.split }: | - self.split_lot(cr, uid, [ref('split_lot_incomming')], context=context) -- - I check move lines after spliting -- - !python {model: stock.move}: | - lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incomming'), context=context) - lot_ids = self.pool.get('stock.production.lot').search(cr, uid, [('name','in',[x.name for x in lot.line_ids])]) - assert len(lot_ids) == 4, 'lots of incomming shipment are not correspond.' - move_ids = self.search(cr, uid, [('location_dest_id','=',ref('location_monitor')),('prodlot_id','in',lot_ids)]) - assert len(move_ids) == 4, 'move lines are not correspond per prodcution lot after splited.' - for move in self.browse(cr, uid, move_ids, context=context): - assert move.prodlot_id.name in ['incoming_lot0', 'incoming_lot1', 'incoming_lot2', 'incoming_lot3'], "lot does not correspond." - assert move.product_qty == 10, "qty does not correspond per production lot." - context.update({'active_model':'stock.move', 'active_id':move_ids[0],'active_ids': move_ids}) - I check the stock valuation account entries. - @@ -165,45 +172,11 @@ for account_move_line in account_move.line_id: for stock_move in incomming_shipment.move_lines: if account_move_line.account_id.id == stock_move.product_id.property_stock_account_input.id: - assert account_move_line.credit == 10000.0, "Credit amount does not correspond." + assert account_move_line.credit == 14000.0, "Credit amount does not correspond." assert account_move_line.debit == 0.0, "Debit amount does not correspond." else: assert account_move_line.credit == 0.0, "Credit amount does not correspond." - assert account_move_line.debit == 10000.0, "Debit amount does not correspond." -- - I consume 1 unit 15” LCD Monitor from each incoming lots into internal production. -- - !record {model: stock.move.consume, id: consume_lot_incomming}: - product_qty: 1 - location_id: location_monitor -- - !python {model: stock.move.consume}: | - self.do_move_consume(cr, uid, [ref('consume_lot_incomming')], context=context) -- - I scrap 1 unit 15” LCD Monitor from each incoming lots into scrap location. -- - !record {model: stock.move.scrap, id: scrap_lot_incomming}: - product_qty: 1 -- - !python {model: stock.move.scrap}: | - self.move_scrap(cr, uid, [ref('scrap_lot_incomming')], context=context) -- - I check stock in scrap location and stock location shop0. -- - !python {model: stock.location}: | - ctx = {'product_id': ref('product_product_6')} - monitor_location = self.pool.get('stock.location').browse(cr, uid, ref('location_monitor'), context=ctx) - assert monitor_location.stock_real == 132.0, 'stock does not correspond in stock location shop0.' - scrapped_location = self.browse(cr, uid, ref('stock_location_scrapped'), context=ctx) - assert scrapped_location.stock_real == 1*4, 'scraped stock does not correspond in scrap location.' - -- - I check availabile stock after consumed and scraped. -- - !python {model: product.product}: | - product = self.browse(cr, uid, ref('product_product_6'), context=context) - assert product.qty_available == 132.0, "Stock does not correspond." - assert round(product.virtual_available, 2) == -8.00, "Vitual stock does not correspond." + assert account_move_line.debit == 14000.0, "Debit amount does not correspond." - I trace all incoming lots. - @@ -221,6 +194,40 @@ for move_line in shipment.move_lines: assert move_line.state == "assigned", "Move should be assigned." self.force_assign(cr, uid, [shipment.id]) + context.update({'active_model':'stock.move', 'active_id':shipment.move_lines[0].id,'active_ids': [shipment.move_lines[0].id]}) +- + I scrap 4 units of 15” LCD Monitor into scrap location. +- + !record {model: stock.move.scrap, id: scrap_monitor1}: + product_qty: 4 +- + !python {model: stock.move.scrap}: | + self.move_scrap(cr, uid, [ref('scrap_monitor1')], context=context) +- + I consume 4 units of 15” LCD Monitor. +- + !record {model: stock.move.consume, id: consume_monitor1}: + product_qty: 4 + location_id: location_monitor +- + !python {model: stock.move.consume}: | + self.do_move_consume(cr, uid, [ref('consume_monitor1')], context=context) +- + I check stock in scrap location and stock location shop0. +- + !python {model: stock.location}: | + ctx = {'product_id': ref('product_product_6')} + monitor_location = self.pool.get('stock.location').browse(cr, uid, ref('location_monitor'), context=ctx) + assert monitor_location.stock_real == 132.0, 'stock does not correspond in stock location shop0.' + scrapped_location = self.browse(cr, uid, ref('stock_location_scrapped'), context=ctx) + assert scrapped_location.stock_real == 4, 'scraped stock does not correspond in scrap location.' +- + I check availabile stock after consumed and scraped. +- + !python {model: product.product}: | + product = self.browse(cr, uid, ref('product_product_6'), context=context) + assert product.qty_available == 132.0, "Stock does not correspond." + assert round(product.virtual_available, 2) == -4.00, "Vitual stock does not correspond." - I deliver 5 unit 15” LCD Monitor to customer so I make partial deliver - @@ -277,5 +284,5 @@ - !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) - assert round(product.qty_available, 2) == 2, "Stock does not correspond." - assert round(product.virtual_available, 2) == -8.00, "Vitual stock does not correspond." + assert round(product.qty_available, 2) == 6, "Stock does not correspond." + assert round(product.virtual_available, 2) == -4.00, "Vitual stock does not correspond." From 70995ec63dce5ca4191d1e3326b9961a6c38c8e0 Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Fri, 29 Mar 2013 21:13:18 +0530 Subject: [PATCH 57/88] [FIX]: stock: Fixed typo and grammar in shipment.yml bzr revid: rpa@tinyerp.com-20130329154318-2wswvugrl17ncy9l --- addons/stock/test/shipment.yml | 112 ++++++++++++++++----------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/addons/stock/test/shipment.yml b/addons/stock/test/shipment.yml index 909050d0483..75249aea842 100644 --- a/addons/stock/test/shipment.yml +++ b/addons/stock/test/shipment.yml @@ -2,11 +2,11 @@ !context uid: 'res_users_stock_manager' - - I confirm outgoing shipment of 130 unit 15” LCD Monitor. + I confirm outgoing shipment of 130 Unit 15” LCD Monitor. - !workflow {model: stock.picking, action: button_confirm, ref: outgoing_shipment} - - I check shipment details after confirmed. + I check shipment details after confirmation. - !python {model: stock.picking}: | shipment = self.browse(cr, uid, ref("outgoing_shipment")) @@ -15,25 +15,25 @@ assert move_line.state == "confirmed", "Move should be confirmed." - - Now I check vitual stock of 15” LCD Monitor after confirmed outgoing shipment. + Now, I check virtual stock of 15” LCD Monitor after confirming outgoing shipment. - !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) - assert product.virtual_available == -30, "Vitual stock is not updated." + assert product.virtual_available == -30, "Virtual stock is not updated." - - I confirm incomming shipment of 50 unit 15” LCD Monitor. + I confirm incoming shipment of 50 Unit 15” LCD Monitor. - - !workflow {model: stock.picking, action: button_confirm, ref: incomming_shipment} + !workflow {model: stock.picking, action: button_confirm, ref: incoming_shipment} - - I split incomming shipment into lots. each lot contain 10 unit 15” LCD Monitor. + I split incoming shipment into lots. each lot contain 10 Unit 15” LCD Monitor. - !python {model: stock.picking}: | - shipment = self.browse(cr, uid, ref("incomming_shipment")) + shipment = self.browse(cr, uid, ref("incoming_shipment")) move_ids = [x.id for x in shipment.move_lines] context.update({'active_model': 'stock.move', 'active_id': move_ids[0], 'active_ids': move_ids}) - - !record {model: stock.move.split, id: split_lot_incomming}: + !record {model: stock.move.split, id: split_lot_incoming}: line_ids: - name: incoming_lot0 quantity: 10 @@ -45,29 +45,29 @@ quantity: 10 - !python {model: stock.move.split }: | - self.split_lot(cr, uid, [ref('split_lot_incomming')], context=context) + self.split_lot(cr, uid, [ref('split_lot_incoming')], context=context) - - I check move lines after spliting + I check move lines after splitting. - !python {model: stock.move}: | - mm = self.browse(cr, uid, ref("incomming_shipment_monitor")) - lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incomming'), context=context) + mm = self.browse(cr, uid, ref("incoming_shipment_monitor")) + lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incoming'), context=context) lot_ids = self.pool.get('stock.production.lot').search(cr, uid, [('name','in',[x.name for x in lot.line_ids])]) - assert len(lot_ids) == 4, 'lots of incomming shipment are not correspond.' + assert len(lot_ids) == 4, 'lots of incoming shipment are not correspond.' move_ids = self.search(cr, uid, [('location_dest_id','=',ref('location_monitor')),('prodlot_id','in',lot_ids)]) - assert len(move_ids) == 4, 'move lines are not correspond per prodcution lot after splited.' + assert len(move_ids) == 4, 'move lines are not correspond per production lot after splitting.' for move in self.browse(cr, uid, move_ids, context=context): assert move.prodlot_id.name in ['incoming_lot0', 'incoming_lot1', 'incoming_lot2', 'incoming_lot3'], "lot does not correspond." assert move.product_qty == 10, "qty does not correspond per production lot." - - I receive 40 unit 15” LCD Monitor so I make backorder of incomming shipment for 40 unit. + I receive 40 units of 15” LCD Monitor. - !python {model: stock.partial.picking}: | - context.update({'active_model': 'stock.picking', 'active_id': ref('incomming_shipment'), 'active_ids': [ref('incomming_shipment')]}) + context.update({'active_model': 'stock.picking', 'active_id': ref('incoming_shipment'), 'active_ids': [ref('incoming_shipment')]}) - !python {model: stock.partial.picking}: | partial = [] - for move in self.pool.get('stock.picking').browse(cr, uid, ref("incomming_shipment")).move_lines: + for move in self.pool.get('stock.picking').browse(cr, uid, ref("incoming_shipment")).move_lines: if move.prodlot_id: partial.append((0, 0, { 'quantity': move.product_qty, @@ -82,10 +82,10 @@ partial_id = self.create(cr, uid, {'move_ids': partial}, context=context) self.do_partial(cr, uid, [partial_id], context=context) - - I check backorder shipment after received partial shipment. + I check backorder shipment after receiving partial shipment. - !python {model: stock.picking}: | - shipment = self.browse(cr, uid, ref("incomming_shipment")) + shipment = self.browse(cr, uid, ref("incoming_shipment")) backorder = shipment.backorder_id assert backorder, "Backorder should be created after partial shipment." assert backorder.state == 'done', "Backorder should be closed after received." @@ -95,82 +95,82 @@ qty += move_line.product_qty assert qty == 40, "Qty in backorder does not correspond." - - I receive another 10 unit 15” LCD Monitor. + I receive another 10 units of 15” LCD Monitor. - - !record {model: stock.partial.picking, id: partial_incomming}: + !record {model: stock.partial.picking, id: partial_incoming}: move_ids: - quantity: 10 product_id: product_product_6 product_uom: product.product_uom_unit - move_id: incomming_shipment_monitor + move_id: incoming_shipment_monitor location_id: stock_location_3 location_dest_id: location_monitor - !python {model: stock.partial.picking }: | - self.do_partial(cr, uid, [ref('partial_incomming')], context=context) + self.do_partial(cr, uid, [ref('partial_incoming')], context=context) - - I check incomming shipment after receiving it. + I check incoming shipment after receiving it. - !python {model: stock.picking}: | - shipment = self.browse(cr, uid, ref("incomming_shipment")) + shipment = self.browse(cr, uid, ref("incoming_shipment")) assert shipment.state == 'done', "shipment should be closed after receiving." for move_line in shipment.move_lines: assert move_line.product_qty == 10, "Qty does not correspond." assert move_line.product_id.virtual_available == 20, "Virtual stock does not correspond." assert move_line.state == 'done', "Move line should be closed." - - I return last incomming shipment for 10 unit 15” LCD Monitor. + I return last incoming shipment for 10 Unit 15” LCD Monitor. - - !record {model: stock.return.picking, id: return_incomming}: + !record {model: stock.return.picking, id: return_incoming}: invoice_state: none - !python {model: stock.return.picking }: | # this work without giving the id of the picking to return, magically, thanks to the context - self.create_returns(cr, uid, [ref('return_incomming')], context=context) + self.create_returns(cr, uid, [ref('return_incoming')], context=context) - - I cancel incomming shipment after return it. + I cancel incoming shipment after returning it. - !python {model: stock.picking}: | - # the cancel is not on the return, but on the incomming shipment (which now has a quantity of 10, thanks to the + # the cancel is not on the return, but on the incoming shipment (which now has a quantity of 10, thanks to the # backorder). This situation is a little weird as we returned a move that we finally cancelled... As result, only # 30Unit from the original 50Unit will be counted in the stock (50 - 10 (cancelled quantity) - 10 (returned quantity)) - self.action_cancel(cr, uid, [ref("incomming_shipment")], context=context) + self.action_cancel(cr, uid, [ref("incoming_shipment")], context=context) - - I make invoice of backorder of incomming shipment. + I make invoice of backorder of incoming shipment. - !python {model: stock.invoice.onshipping}: | - shipment = self.pool.get('stock.picking').browse(cr, uid, ref("incomming_shipment")) + shipment = self.pool.get('stock.picking').browse(cr, uid, ref("incoming_shipment")) context.update({'active_model': 'stock.picking', 'active_id': shipment.backorder_id.id, 'active_ids': [shipment.backorder_id.id]}) - - !record {model: stock.invoice.onshipping, id: invoice_incomming}: + !record {model: stock.invoice.onshipping, id: invoice_incoming}: group: False - !python {model: stock.invoice.onshipping }: | - self.create_invoice(cr, uid, [ref('invoice_incomming')], context=context) + self.create_invoice(cr, uid, [ref('invoice_incoming')], context=context) - - I check invoice state of backorder of incomming shipment. + I check invoice status of backorder of incoming shipment. - !python {model: stock.picking}: | - shipment = self.browse(cr, uid, ref("incomming_shipment")) - assert shipment.backorder_id.invoice_state == 'invoiced', 'Invoice state is not upadted.' + shipment = self.browse(cr, uid, ref("incoming_shipment")) + assert shipment.backorder_id.invoice_state == 'invoiced', 'Invoice state is not updated.' - - I check available stock after received incomming shipping. + I check available stock after receiving incoming shipping. - !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.qty_available == 140, "Stock does not correspond." - assert product.virtual_available == 0, "Vitual stock does not correspond." + assert product.virtual_available == 0, "Virtual stock does not correspond." - I check the stock valuation account entries. - !python {model: account.move}: | - incomming_shipment = self.pool.get('stock.picking').browse(cr, uid, ref('incomming_shipment'), context=context) - account_move_ids = self.search(cr, uid, [('ref','=',incomming_shipment.name)]) + incoming_shipment = self.pool.get('stock.picking').browse(cr, uid, ref('incoming_shipment'), context=context) + account_move_ids = self.search(cr, uid, [('ref','=',incoming_shipment.name)]) assert len(account_move_ids), "account move should be created." account_move = self.browse(cr, uid, account_move_ids[0], context=context) - assert len(account_move.line_id) == len(incomming_shipment.move_lines) + 1, 'accuont entries are not correspond.' + assert len(account_move.line_id) == len(incoming_shipment.move_lines) + 1, 'Accounting entries does not correspond.' for account_move_line in account_move.line_id: - for stock_move in incomming_shipment.move_lines: + for stock_move in incoming_shipment.move_lines: if account_move_line.account_id.id == stock_move.product_id.property_stock_account_input.id: assert account_move_line.credit == 14000.0, "Credit amount does not correspond." assert account_move_line.debit == 0.0, "Debit amount does not correspond." @@ -181,11 +181,11 @@ I trace all incoming lots. - !python {model: stock.production.lot }: | - lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incomming'), context=context) + lot = self.pool.get('stock.move.split').browse(cr, uid, ref('split_lot_incoming'), context=context) lot_ids = self.search(cr, uid, [('name', 'in', [x.name for x in lot.line_ids])]) self.action_traceability(cr, uid, lot_ids, context=context) - - I check outgoing shipment after stock availablity in Chicago shop. + I check outgoing shipment after stock availability in Chicago shop. - !python {model: stock.picking}: | shipment = self.browse(cr, uid, ref("outgoing_shipment"), context=context) @@ -213,7 +213,7 @@ !python {model: stock.move.consume}: | self.do_move_consume(cr, uid, [ref('consume_monitor1')], context=context) - - I check stock in scrap location and stock location shop0. + I check stock in scrap location and stock location. - !python {model: stock.location}: | ctx = {'product_id': ref('product_product_6')} @@ -222,14 +222,14 @@ scrapped_location = self.browse(cr, uid, ref('stock_location_scrapped'), context=ctx) assert scrapped_location.stock_real == 4, 'scraped stock does not correspond in scrap location.' - - I check availabile stock after consumed and scraped. + I check available stock after consumed and scraped move. - !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) assert product.qty_available == 132.0, "Stock does not correspond." - assert round(product.virtual_available, 2) == -4.00, "Vitual stock does not correspond." + assert round(product.virtual_available, 2) == -4.00, "Virtual stock does not correspond." - - I deliver 5 unit 15” LCD Monitor to customer so I make partial deliver + I deliver 5 Unit 15” LCD Monitor to customer partially. - !python {model: stock.partial.move}: | context.update({'active_model': 'stock.move', 'active_id': ref('outgoing_shipment_monitor'), 'active_ids': [ref('outgoing_shipment_monitor')]}) @@ -247,7 +247,7 @@ self.do_partial(cr, uid, [ref('partial_outgoing_monitor')], context=context) - - I packing outgoing shipment into box per 10 unit with unique tracking lot. + I pack outgoing shipment into box of 10 Unit with unique tracking lot. - !python {model: stock.move}: | stock_split = self.pool.get('stock.split.into') @@ -260,7 +260,7 @@ stock_split.split(cr, uid, [split_id], context=context) total_qty -= split_qty - - I deliver outgoing shipment. + I deliver the outgoing shipment. - !python {model: stock.partial.picking}: | context.update({'active_model': 'stock.picking', 'active_id': ref('outgoing_shipment'), 'active_ids': [ref('outgoing_shipment')]}) @@ -272,7 +272,7 @@ self.do_partial(cr, uid, [ref('partial_outgoing')], context=context) - - I check outgoing shipment after deliver. + I check outgoing shipment after delivery. - !python {model: stock.picking}: | shipment = self.browse(cr, uid, ref("outgoing_shipment"), context=context) @@ -280,9 +280,9 @@ for move_line in shipment.move_lines: assert move_line.state == "done", "Move should be closed." - - I check availaible stock after deliver. + I check available stock after delivery. - !python {model: product.product}: | product = self.browse(cr, uid, ref('product_product_6'), context=context) assert round(product.qty_available, 2) == 6, "Stock does not correspond." - assert round(product.virtual_available, 2) == -4.00, "Vitual stock does not correspond." + assert round(product.virtual_available, 2) == -4.00, "Virtual stock does not correspond." From 5848f817fbb7fed0d3cddfec27886952a2a03ff2 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Mon, 1 Apr 2013 12:13:59 +0530 Subject: [PATCH 58/88] [IMP]add string in shipment yml bzr revid: sgo@tinyerp.com-20130401064359-40s1a4azsvd2099v --- addons/stock/test/shipment.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/test/shipment.yml b/addons/stock/test/shipment.yml index 86b4a092108..5f2f4686621 100644 --- a/addons/stock/test/shipment.yml +++ b/addons/stock/test/shipment.yml @@ -1,3 +1,5 @@ +- + Stock manager can only test whole process related to Shipment, so let's check data with stock manager. - !context uid: 'res_users_stock_manager' From 2a7bb9a9100011088d1f7240ea265881ba1410de Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Wed, 17 Apr 2013 16:05:44 +0530 Subject: [PATCH 59/88] [IMP]Improve yml for issue demo which creates duplicate issue and improve code bzr revid: sgo@tinyerp.com-20130417103544-df29vwms1lc5xq6t --- addons/project_issue/test/issue_demo.yml | 4 ---- addons/project_issue/test/subscribe_issue.yml | 5 ----- 2 files changed, 9 deletions(-) diff --git a/addons/project_issue/test/issue_demo.yml b/addons/project_issue/test/issue_demo.yml index 7040b631f46..b7342b435ab 100644 --- a/addons/project_issue/test/issue_demo.yml +++ b/addons/project_issue/test/issue_demo.yml @@ -3,10 +3,6 @@ - !context uid: 'res_users_project_issue_user' -- - !record {model: project.issue, id: project_task_1, view: False}: - task_id: 'project.project_task_17' - name: 'Error in account module' - !record {model: project.issue, id: project01, view: False}: project_id: 'project.project_project_2' diff --git a/addons/project_issue/test/subscribe_issue.yml b/addons/project_issue/test/subscribe_issue.yml index e07c8704a14..8d7b038dccc 100644 --- a/addons/project_issue/test/subscribe_issue.yml +++ b/addons/project_issue/test/subscribe_issue.yml @@ -1,8 +1,3 @@ -- - Project user can subscribe issue, so let's check data with giving the access rights of user. -- - !context - uid: 'res_users_project_issue_user' - In Order to test process of Issue in OpenERP, Customer send the issue by email. - From bbd2c2ea5e939e6db529742754093def84e9a84c Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Mon, 29 Apr 2013 16:10:42 +0530 Subject: [PATCH 60/88] [IMP]give access rights for contact creation bzr revid: sgo@tinyerp.com-20130429104042-1elyyf00shx03rsk --- addons/account/test/account_test_users.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/test/account_test_users.yml b/addons/account/test/account_test_users.yml index 322bc527ad7..be89afefdd1 100644 --- a/addons/account/test/account_test_users.yml +++ b/addons/account/test/account_test_users.yml @@ -2,7 +2,7 @@ Create a user as 'Accountant' - !context - default_groups_ref: [account.group_account_user] + default_groups_ref: [base.group_partner_manager,account.group_account_user] - !record {model: res.users, id: res_users_account_user}: company_id: base.main_company From 2f19755c2a46a1c03af81279390013bf333ad4ca Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Mon, 29 Apr 2013 16:57:39 +0530 Subject: [PATCH 61/88] [IMP]give access rights for contact creation in account voucher yml user bzr revid: sgo@tinyerp.com-20130429112739-f06w3v6g7q9wi2fh --- addons/account_voucher/test/account_voucher_users.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_voucher/test/account_voucher_users.yml b/addons/account_voucher/test/account_voucher_users.yml index 8888885f476..0dd8fa528b5 100644 --- a/addons/account_voucher/test/account_voucher_users.yml +++ b/addons/account_voucher/test/account_voucher_users.yml @@ -2,7 +2,7 @@ Create a user as 'Accountant for voucher' - !context - default_groups_ref: [account.group_account_user] + default_groups_ref: [base.group_partner_manager,account.group_account_user] - !record {model: res.users, id: res_users_account_voucher_user}: company_id: base.main_company @@ -14,7 +14,7 @@ Create a user as 'Financial Manager for account voucher' - !context - default_groups_ref: [account.group_account_manager] + default_groups_ref: [base.group_partner_manager,account.group_account_manager] - !record {model: res.users, id: res_users_account_voucher_manager}: company_id: base.main_company From ed220968a3f02ee43b5ca542053eae28864f9ad6 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Mon, 6 May 2013 15:09:10 +0530 Subject: [PATCH 62/88] [MERGE]put yml in test from demo in purchase bzr revid: sgo@tinyerp.com-20130506093910-mlyc8a1a1hz4y433 --- addons/purchase/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index b75c84e332b..9d72579cc77 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -67,6 +67,7 @@ Dashboard / Reports for Purchase Management will include: 'res_config_view.xml', ], 'test': [ + 'test/ui/purchase_users.yml', 'test/process/cancel_order.yml', 'test/process/rfq2order2done.yml', 'test/process/generate_invoice_from_reception.yml', @@ -79,7 +80,6 @@ Dashboard / Reports for Purchase Management will include: 'test/ui/delete_order.yml', ], 'demo': [ - 'test/ui/purchase_users.yml', 'purchase_order_demo.yml', 'purchase_demo.xml', ], From ca60821869332c95d0959e8645f16865d66be531 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Mon, 6 May 2013 17:05:57 +0530 Subject: [PATCH 63/88] [IMP]improve yml code bzr revid: sgo@tinyerp.com-20130506113557-mh99n29zv2ve5pv3 --- addons/purchase/purchase_order_demo.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/addons/purchase/purchase_order_demo.yml b/addons/purchase/purchase_order_demo.yml index fb49bfc1248..7a0fae7ef68 100644 --- a/addons/purchase/purchase_order_demo.yml +++ b/addons/purchase/purchase_order_demo.yml @@ -1,8 +1,5 @@ - Give access rights of Purchase user to create purchase order -- - !context - uid: 'res_users_purchase_user' - !record {model: purchase.order, id: purchase_order_1}: partner_id: base.res_partner_1 From 5f203720edba35397296bdea2262706b2c3ebeb7 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 11:59:14 +0530 Subject: [PATCH 64/88] [IMP]remove default_groups_ref and added to groups_id in yml in account and account_Voucher bzr revid: sgo@tinyerp.com-20130507062914-t8bmem3auvjob5bl --- addons/account/test/account_test_users.yml | 19 +++++++++++----- .../test/account_voucher_users.yml | 22 +++++++++++++------ 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/addons/account/test/account_test_users.yml b/addons/account/test/account_test_users.yml index be89afefdd1..3b0fd72f0bf 100644 --- a/addons/account/test/account_test_users.yml +++ b/addons/account/test/account_test_users.yml @@ -1,8 +1,5 @@ - Create a user as 'Accountant' -- - !context - default_groups_ref: [base.group_partner_manager,account.group_account_user] - !record {model: res.users, id: res_users_account_user}: company_id: base.main_company @@ -11,10 +8,14 @@ password: acc email: accountuser@yourcompany.com - - Create a user as 'Financial Manager' + I added groups for Accountant which needed. - - !context - default_groups_ref: [account.group_account_manager] + !record {model: res.users, id: res_users_account_user}: + groups_id: + - account.group_account_user + - base.group_partner_manager +- + Create a user as 'Financial Manager' - !record {model: res.users, id: res_users_account_manager}: company_id: base.main_company @@ -22,3 +23,9 @@ login: fm password: fm email: accountmanager@yourcompany.com +- + I added groups for Financial Manager which needed. +- + !record {model: res.users, id: res_users_account_manager}: + groups_id: + - account.group_account_manager \ No newline at end of file diff --git a/addons/account_voucher/test/account_voucher_users.yml b/addons/account_voucher/test/account_voucher_users.yml index 0dd8fa528b5..feb19c0e3fb 100644 --- a/addons/account_voucher/test/account_voucher_users.yml +++ b/addons/account_voucher/test/account_voucher_users.yml @@ -1,8 +1,5 @@ - - Create a user as 'Accountant for voucher' -- - !context - default_groups_ref: [base.group_partner_manager,account.group_account_user] + Create a user as 'Accountant for account voucher' - !record {model: res.users, id: res_users_account_voucher_user}: company_id: base.main_company @@ -11,10 +8,14 @@ password: acc email: accountant@yourcompany.com - - Create a user as 'Financial Manager for account voucher' + I added groups to Accountant for account voucher which needed. - - !context - default_groups_ref: [base.group_partner_manager,account.group_account_manager] + !record {model: res.users, id: res_users_account_voucher_user}: + groups_id: + - base.group_partner_manager + - account.group_account_user +- + Create a user as 'Financial Manager for account voucher' - !record {model: res.users, id: res_users_account_voucher_manager}: company_id: base.main_company @@ -22,3 +23,10 @@ login: fmv password: fmv email: finmanager@yourcompany.com +- + I added groups to Financial Manager for account voucher which needed. +- + !record {model: res.users, id: res_users_account_voucher_manager}: + groups_id: + - base.group_partner_manager + - account.group_account_manager From 0f312151471b625c7ade63004d8293eb8ad950f2 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 12:34:46 +0530 Subject: [PATCH 65/88] [IMP]done changes as per new yml changes in crm bzr revid: sgo@tinyerp.com-20130507070446-ejlju0cnui74vy21 --- addons/crm/__openerp__.py | 2 +- addons/crm/test/{ui => }/crm_access_group_users.yml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename addons/crm/test/{ui => }/crm_access_group_users.yml (100%) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index ac0a06a384c..bc74c3350ac 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -106,7 +106,7 @@ Dashboard for CRM will include: 'crm_action_rule_demo.xml', ], 'test': [ - 'test/ui/crm_access_group_users.yml', + 'test/crm_access_group_users.yml', 'test/crm_lead_message.yml', 'test/lead2opportunity2win.yml', 'test/lead2opportunity_assign_salesmen.yml', diff --git a/addons/crm/test/ui/crm_access_group_users.yml b/addons/crm/test/crm_access_group_users.yml similarity index 100% rename from addons/crm/test/ui/crm_access_group_users.yml rename to addons/crm/test/crm_access_group_users.yml From 1373b5cda00c791b3c9a229dd0ef10a28c723679 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 12:49:59 +0530 Subject: [PATCH 66/88] [IMP]improve string and add groups in groups_id in crm and event bzr revid: sgo@tinyerp.com-20130507071959-kwqmv7wwy7gqcsfj --- addons/account/test/account_test_users.yml | 4 ++-- .../test/account_voucher_users.yml | 4 ++-- addons/crm/test/crm_access_group_users.yml | 18 ++++++++++++------ addons/event/test/ui/event_users.yml | 18 ++++++++++++------ 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/addons/account/test/account_test_users.yml b/addons/account/test/account_test_users.yml index 3b0fd72f0bf..b257feedff8 100644 --- a/addons/account/test/account_test_users.yml +++ b/addons/account/test/account_test_users.yml @@ -8,7 +8,7 @@ password: acc email: accountuser@yourcompany.com - - I added groups for Accountant which needed. + I added groups for Accountant. - !record {model: res.users, id: res_users_account_user}: groups_id: @@ -24,7 +24,7 @@ password: fm email: accountmanager@yourcompany.com - - I added groups for Financial Manager which needed. + I added groups for Financial Manager. - !record {model: res.users, id: res_users_account_manager}: groups_id: diff --git a/addons/account_voucher/test/account_voucher_users.yml b/addons/account_voucher/test/account_voucher_users.yml index feb19c0e3fb..c96645f0190 100644 --- a/addons/account_voucher/test/account_voucher_users.yml +++ b/addons/account_voucher/test/account_voucher_users.yml @@ -8,7 +8,7 @@ password: acc email: accountant@yourcompany.com - - I added groups to Accountant for account voucher which needed. + I added groups to Accountant for account voucher. - !record {model: res.users, id: res_users_account_voucher_user}: groups_id: @@ -24,7 +24,7 @@ password: fmv email: finmanager@yourcompany.com - - I added groups to Financial Manager for account voucher which needed. + I added groups to Financial Manager for account voucher. - !record {model: res.users, id: res_users_account_voucher_manager}: groups_id: diff --git a/addons/crm/test/crm_access_group_users.yml b/addons/crm/test/crm_access_group_users.yml index 158a11b5881..50ee9ed5367 100644 --- a/addons/crm/test/crm_access_group_users.yml +++ b/addons/crm/test/crm_access_group_users.yml @@ -1,8 +1,5 @@ - Create a user as 'Salesmanager' -- - !context - default_groups_ref: ['base.group_sale_manager'] - !record {model: res.users, id: crm_res_users_salesmanager}: company_id: base.main_company @@ -11,10 +8,13 @@ password: csm email: crmmanager@yourcompany.com - - Create a user as 'Salesman' + I added groups for Salesmanager. - - !context - default_groups_ref: ['base.group_sale_salesman_all_leads'] + !record {model: res.users, id: crm_res_users_salesmanager}: + groups_id: + - base.group_sale_manager +- + Create a user as 'Salesman' - !record {model: res.users, id: crm_res_users_salesman}: company_id: base.main_company @@ -22,3 +22,9 @@ login: csu password: csu email: crmuser@yourcompany.com +- + I added groups for Salesman. +- + !record {model: res.users, id: crm_res_users_salesman}: + groups_id: + - base.group_sale_salesman_all_leads diff --git a/addons/event/test/ui/event_users.yml b/addons/event/test/ui/event_users.yml index 92c8316a5d9..b6927dbdaa6 100644 --- a/addons/event/test/ui/event_users.yml +++ b/addons/event/test/ui/event_users.yml @@ -1,8 +1,5 @@ - Create a user as 'Event manager' -- - !context - default_groups_ref: [event.group_event_manager] - !record {model: res.users, id: res_users_eventmanager}: company_id: base.main_company @@ -11,10 +8,13 @@ password: em email: eventmanager@yourcompany.com - - Create a user as 'Event user' + I added groups for Event manager. - - !context - default_groups_ref: [event.group_event_user] + !record {model: res.users, id: res_users_eventmanager}: + groups_id: + - event.group_event_manager +- + Create a user as 'Event user' - !record {model: res.users, id: res_users_eventuser}: company_id: base.main_company @@ -22,3 +22,9 @@ login: eu password: eu email: eventuser@yourcompany.com +- + I added groups for Event manager. +- + !record {model: res.users, id: res_users_eventuser}: + groups_id: + - event.group_event_user From 5f629a2f0bb5a582d366097927eae36321959b95 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 12:57:22 +0530 Subject: [PATCH 67/88] [IMP]improve string bzr revid: sgo@tinyerp.com-20130507072722-jf0912rfbakddo36 --- addons/event/test/ui/event_users.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/event/test/ui/event_users.yml b/addons/event/test/ui/event_users.yml index b6927dbdaa6..cda4ebda750 100644 --- a/addons/event/test/ui/event_users.yml +++ b/addons/event/test/ui/event_users.yml @@ -23,7 +23,7 @@ password: eu email: eventuser@yourcompany.com - - I added groups for Event manager. + I added groups for Event user. - !record {model: res.users, id: res_users_eventuser}: groups_id: From fbfd8a4b423c232269c6abfafede527bd26ee7e3 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 14:13:16 +0530 Subject: [PATCH 68/88] [IMP]improve string and add groups in groups_id in sale and sale stock bzr revid: sgo@tinyerp.com-20130507084316-v1tiw294n8imfj1v --- addons/crm/test/crm_access_group_users.yml | 12 +++--- addons/sale/test/create_sale_users.yml | 18 ++++++--- addons/sale_stock/test/sale_stock_users.yml | 43 +++++++++++++-------- 3 files changed, 45 insertions(+), 28 deletions(-) diff --git a/addons/crm/test/crm_access_group_users.yml b/addons/crm/test/crm_access_group_users.yml index 50ee9ed5367..c9080ee530e 100644 --- a/addons/crm/test/crm_access_group_users.yml +++ b/addons/crm/test/crm_access_group_users.yml @@ -1,29 +1,29 @@ - - Create a user as 'Salesmanager' + Create a user as 'Crm Salesmanager' - !record {model: res.users, id: crm_res_users_salesmanager}: company_id: base.main_company - name: Sales manager + name: Crm Sales manager login: csm password: csm email: crmmanager@yourcompany.com - - I added groups for Salesmanager. + I added groups for Crm Salesmanager. - !record {model: res.users, id: crm_res_users_salesmanager}: groups_id: - base.group_sale_manager - - Create a user as 'Salesman' + Create a user as 'Crm Salesman' - !record {model: res.users, id: crm_res_users_salesman}: company_id: base.main_company - name: Salesman + name: Crm Salesman login: csu password: csu email: crmuser@yourcompany.com - - I added groups for Salesman. + I added groups for Crm Salesman. - !record {model: res.users, id: crm_res_users_salesman}: groups_id: diff --git a/addons/sale/test/create_sale_users.yml b/addons/sale/test/create_sale_users.yml index ed575073f5d..e86fbc8ebfe 100644 --- a/addons/sale/test/create_sale_users.yml +++ b/addons/sale/test/create_sale_users.yml @@ -1,8 +1,5 @@ - Create a user as 'Salesmanager' -- - !context - default_groups_ref: ['base.group_sale_manager'] - !record {model: res.users, id: res_users_salesmanager}: company_id: base.main_company @@ -11,10 +8,13 @@ password: sm email: salesmanager@yourcompany.com - - Create a user as 'Salesman' + I added groups for Salesmanager. - - !context - default_groups_ref: ['base.group_sale_salesman_all_leads'] + !record {model: res.users, id: res_users_salesmanager}: + groups_id: + - base.group_sale_manager +- + Create a user as 'Salesman' - !record {model: res.users, id: res_users_salesman}: company_id: base.main_company @@ -22,3 +22,9 @@ login: su password: su email: salesman@yourcompany.com +- + I added groups for Salesman. +- + !record {model: res.users, id: res_users_salesman}: + groups_id: + - base.group_sale_salesman_all_leads diff --git a/addons/sale_stock/test/sale_stock_users.yml b/addons/sale_stock/test/sale_stock_users.yml index c1ebd54392c..594cbe42240 100644 --- a/addons/sale_stock/test/sale_stock_users.yml +++ b/addons/sale_stock/test/sale_stock_users.yml @@ -1,32 +1,35 @@ - - Create a user as 'Salesmanager' -- - !context - default_groups_ref: ['base.group_sale_manager'] + Create a user as 'Stock Salesmanager' - !record {model: res.users, id: res_sale_stock_salesmanager}: company_id: base.main_company - name: Sales manager + name: Stock Sales manager login: ssm password: ssm email: ss_salesmanager@yourcompany.com - - Create a user as 'Salesman' + I added groups for Salesmanager. - - !context - default_groups_ref: ['base.group_sale_salesman_all_leads'] + !record {model: res.users, id: res_sale_stock_salesmanager}: + groups_id: + - base.group_sale_manager +- + Create a user as 'Stock Salesman' - !record {model: res.users, id: res_sale_stock_salesman}: company_id: base.main_company - name: Salesman + name: Stock Salesman login: ssu password: ssu email: ss_salesman@yourcompany.com - - Create a user as 'Stock User' + I added groups for Stock Salesman. - - !context - default_groups_ref: ['stock.group_stock_user'] + !record {model: res.users, id: res_sale_stock_salesman}: + groups_id: + - base.group_sale_salesman_all_leads +- + Create a user as 'Stock User' - !record {model: res.users, id: res_stock_user}: company_id: base.main_company @@ -34,12 +37,14 @@ login: sau password: sau email: stock_user@yourcompany.com - +- + I added groups for Stock User. +- + !record {model: res.users, id: res_stock_user}: + groups_id: + - stock.group_stock_user - Create a user as 'Stock Manager' -- - !context - default_groups_ref: ['stock.group_stock_manager'] - !record {model: res.users, id: res_stock_manager}: company_id: base.main_company @@ -48,3 +53,9 @@ password: sam email: admin@portal.example.com email: stock_manager@yourcompany.com +- + I added groups for Stock Manager. +- + !record {model: res.users, id: res_stock_manager}: + groups_id: + - stock.group_stock_manager From 76451bef7680e6d309b2c95722587f7c667e1f1a Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 14:19:01 +0530 Subject: [PATCH 69/88] [IMP]add groups in groups_id in purchase and purchase_requisition bzr revid: sgo@tinyerp.com-20130507084901-c4n3scfvt7vrs0gg --- addons/purchase/test/ui/purchase_users.yml | 18 +++++++++++------ .../test/purchase_requisition_users.yml | 20 ++++++++++++------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/addons/purchase/test/ui/purchase_users.yml b/addons/purchase/test/ui/purchase_users.yml index 9dd5e9c0195..bfff922bf83 100644 --- a/addons/purchase/test/ui/purchase_users.yml +++ b/addons/purchase/test/ui/purchase_users.yml @@ -1,8 +1,5 @@ - Create a user as 'Purchase manager' -- - !context - default_groups_ref: ['purchase.group_purchase_manager'] - !record {model: res.users, id: res_users_purchase_manager}: company_id: base.main_company @@ -11,10 +8,13 @@ password: pm email: purchasemanager@yourcompany.com - - Create a user as 'Purchase user' + I added groups for Purchase manager. - - !context - default_groups_ref: ['purchase.group_purchase_user'] + !record {model: res.users, id: res_users_purchase_manager}: + groups_id: + - purchase.group_purchase_manager +- + Create a user as 'Purchase user' - !record {model: res.users, id: res_users_purchase_user}: company_id: base.main_company @@ -22,3 +22,9 @@ login: pu password: pu email: purchaseuser@yourcompany.com +- + I added groups for Purchase user. +- + !record {model: res.users, id: res_users_purchase_user}: + groups_id: + - purchase.group_purchase_user diff --git a/addons/purchase_requisition/test/purchase_requisition_users.yml b/addons/purchase_requisition/test/purchase_requisition_users.yml index 41bc7cd318e..5b5e6d5e8cb 100644 --- a/addons/purchase_requisition/test/purchase_requisition_users.yml +++ b/addons/purchase_requisition/test/purchase_requisition_users.yml @@ -1,8 +1,5 @@ - - Create a user as 'Purchase Reqisition Manager' -- - !context - default_groups_ref: ['purchase_requisition.group_purchase_requisition_manager'] + Create a user as 'Purchase Requisition Manager' - !record {model: res.users, id: res_users_purchase_requisition_manager}: company_id: base.main_company @@ -11,10 +8,13 @@ password: prm email: requisition_manager@yourcompany.com - - Create a user as 'Purchase Reqisition User' + I added groups for Purchase Requisition Manager. - - !context - default_groups_ref: ['purchase_requisition.group_purchase_requisition_user'] + !record {model: res.users, id: res_users_purchase_requisition_manager}: + groups_id: + - purchase_requisition.group_purchase_requisition_manager +- + Create a user as 'Purchase Requisition User' - !record {model: res.users, id: res_users_purchase_requisition_user}: company_id: base.main_company @@ -22,3 +22,9 @@ login: pru password: pru email: requisition_user@yourcompany.com +- + I added groups for Purchase Requisition User. +- + !record {model: res.users, id: res_users_purchase_requisition_user}: + groups_id: + - purchase_requisition.group_purchase_requisition_user \ No newline at end of file From df013f64025f72f0770abcf67d76518a2ae2c6b6 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 14:32:04 +0530 Subject: [PATCH 70/88] [IMP]add groups in groups_id for hr, hr_attandance and recruitment bzr revid: sgo@tinyerp.com-20130507090204-13gkyryyn3lxtz8z --- addons/hr/test/hr_users.yml | 27 ++++++++++++------- .../hr_attendance/test/attendance_process.yml | 9 ++++--- .../test/recruitment_process.yml | 13 +++++---- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/addons/hr/test/hr_users.yml b/addons/hr/test/hr_users.yml index 265482ca457..115924d5c1c 100644 --- a/addons/hr/test/hr_users.yml +++ b/addons/hr/test/hr_users.yml @@ -1,8 +1,5 @@ - Create a user as 'HR Manager' -- - !context - default_groups_ref: [base.group_hr_manager] - !record {model: res.users, id: res_users_hr_manager}: company_id: base.main_company @@ -10,10 +7,13 @@ login: hrm password: hrm - - Create a user as 'HR Officer' + I added groups for HR Manager. - - !context - default_groups_ref: [base.group_hr_user] + !record {model: res.users, id: res_users_hr_manager}: + groups_id: + - base.group_hr_manager +- + Create a user as 'HR Officer' - !record {model: res.users, id: res_users_hr_officer}: company_id: base.main_company @@ -21,13 +21,22 @@ login: hro password: hro - - Create a user as 'Employee' + I added groups for HR Officer. - - !context - default_groups_ref: [base.group_user] + !record {model: res.users, id: res_users_hr_officer}: + groups_id: + - base.group_hr_user +- + Create a user as 'Employee' - !record {model: res.users, id: res_users_employee}: company_id: base.main_company name: Employee login: emp password: emp +- + I added groups for Employee. +- + !record {model: res.users, id: res_users_employee}: + groups_id: + - base.group_user diff --git a/addons/hr_attendance/test/attendance_process.yml b/addons/hr_attendance/test/attendance_process.yml index 383cf209bd4..814f0ee9b8a 100644 --- a/addons/hr_attendance/test/attendance_process.yml +++ b/addons/hr_attendance/test/attendance_process.yml @@ -1,14 +1,17 @@ - Create a user as 'HR Attendance Officer' -- - !context - default_groups_ref: [base.group_hr_user] - !record {model: res.users, id: res_users_attendance_officer}: company_id: base.main_company name: HR Officer login: ao password: ao +- + I added groups for HR Attendance Officer. +- + !record {model: res.users, id: res_users_attendance_officer}: + groups_id: + - base.group_hr_user - Give the access rights of Hr Officer to test attendance process. - diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index 2b7c534c270..8cf924b5d05 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -1,15 +1,18 @@ - Create a user as 'HR Recruitment Officer' - - !context - default_groups_ref: [base.group_hr_user] -- - !record {model: res.users, id: res_users_hr_officer}: + !record {model: res.users, id: res_users_hr_recruitment_officer}: company_id: base.main_company - name: HR Officer + name: HR Recruitment Officer login: hrro password: hrro email: hrofcr@yourcompany.com +- + I added groups for HR Recruitment Officer. +- + !record {model: res.users, id: res_users_hr_recruitment_officer}: + groups_id: + - base.group_hr_user - In Order to test process of Recruitment so giving HR officer's rights, - From a28d4d7cad0a55c4c4f1d97ca17035a2e01c8d07 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Tue, 7 May 2013 14:39:44 +0530 Subject: [PATCH 71/88] [IMP] add group_id in project and project_issue for assign groups bzr revid: fka@tinyerp.com-20130507090944-m8oqqxx7wekyh09c --- addons/project/test/project_users.yml | 18 ++++++++++++------ addons/project_issue/test/issue_users.yml | 18 ++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/addons/project/test/project_users.yml b/addons/project/test/project_users.yml index 8ae3c23dca1..f61d2042b6b 100644 --- a/addons/project/test/project_users.yml +++ b/addons/project/test/project_users.yml @@ -1,8 +1,5 @@ - Create a user as 'Project manager' -- - !context - default_groups_ref: ['project.group_project_manager'] - !record {model: res.users, id: res_users_project_manager}: company_id: base.main_company @@ -11,10 +8,13 @@ password: prm email: projectmanager@yourcompany.com - - Create a user as 'Project user' + I added groups for Project manager. - - !context - default_groups_ref: ['project.group_project_user'] + !record {model: res.users, id: res_users_project_manager}: + groups_id: + - project.group_project_manager +- + Create a user as 'Project user' - !record {model: res.users, id: res_users_project_user}: company_id: base.main_company @@ -22,3 +22,9 @@ login: pru password: pru email: projectuser@yourcompany.com +- + I added groups for Project user. +- + !record {model: res.users, id: res_users_project_user}: + groups_id: + - project.group_project_user \ No newline at end of file diff --git a/addons/project_issue/test/issue_users.yml b/addons/project_issue/test/issue_users.yml index 402478b1c54..c40d142684a 100644 --- a/addons/project_issue/test/issue_users.yml +++ b/addons/project_issue/test/issue_users.yml @@ -1,8 +1,5 @@ - Create a user as 'Project manager' -- - !context - default_groups_ref: ['project.group_project_manager'] - !record {model: res.users, id: res_users_project_issue_manager}: company_id: base.main_company @@ -11,10 +8,13 @@ password: prim email: issuemanager@yourcompany.com - - Create a user as 'Project user' + I added groups for Project manager. - - !context - default_groups_ref: ['project.group_project_user'] + !record {model: res.users, id: res_users_project_issue_manager}: + groups_id: + - project.group_project_manager +- + Create a user as 'Project user' - !record {model: res.users, id: res_users_project_issue_user}: company_id: base.main_company @@ -22,3 +22,9 @@ login: priu password: priu email: issueuser@yourcompany.com +- + I added groups for Project user. +- + !record {model: res.users, id: res_users_project_issue_user}: + groups_id: + - project.group_project_user \ No newline at end of file From de7fdad10fe952cb26c4213e3fc0e3c2437dda77 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 14:40:56 +0530 Subject: [PATCH 72/88] [IMP]add groups in groups_id for hr timesheet bzr revid: sgo@tinyerp.com-20130507091056-ume659zsu3q2fgig --- .../hr_timesheet/test/hr_timesheet_users.yml | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/addons/hr_timesheet/test/hr_timesheet_users.yml b/addons/hr_timesheet/test/hr_timesheet_users.yml index 4a557bff44f..8b8b799e503 100644 --- a/addons/hr_timesheet/test/hr_timesheet_users.yml +++ b/addons/hr_timesheet/test/hr_timesheet_users.yml @@ -1,33 +1,45 @@ - - Create a user as 'HR Manager' -- - !context - default_groups_ref: [base.group_hr_manager] + Create a user as 'HR timesheet Manager' - !record {model: res.users, id: res_hr_timesheet_manager}: company_id: base.main_company - name: HR manager + name: HR timesheet manager login: hrtm password: hrtm - - Create a user as 'HR Officer' + I added groups for HR timesheet Manager. +- + !record {model: res.users, id: res_hr_timesheet_manager}: + groups_id: + - base.group_hr_manager +- + Create a user as 'HR timesheet Officer' - !context default_groups_ref: [base.group_hr_user] - !record {model: res.users, id: res_hr_timesheet_officer}: company_id: base.main_company - name: HR Officer + name: HR timesheet Officer login: hrto password: hrto - - Create a user as 'Employee' + I added groups for HR timesheet Officer. - - !context - default_groups_ref: [base.group_user] + !record {model: res.users, id: res_hr_timesheet_officer}: + groups_id: + - base.group_hr_user +- + Create a user as 'Timesheet Employee' - !record {model: res.users, id: res_hr_timesheet_employee}: company_id: base.main_company - name: Employee + name: Timesheet Employee login: empt password: empt +- + I added groups for Timesheet Employee. +- + !record {model: res.users, id: res_hr_timesheet_employee}: + groups_id: + - base.group_user From f0ecb9c56a6b4eb850fc67256c5b54ba9a263ee2 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 14:43:12 +0530 Subject: [PATCH 73/88] [IMP]add groups in groups_id for stock bzr revid: sgo@tinyerp.com-20130507091312-gnrhyr0osq56ddb1 --- addons/stock/test/stock_users.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/addons/stock/test/stock_users.yml b/addons/stock/test/stock_users.yml index b8fe0783ca1..d0c09dc745d 100644 --- a/addons/stock/test/stock_users.yml +++ b/addons/stock/test/stock_users.yml @@ -1,8 +1,5 @@ - Create a user as 'Stock Manager' -- - !context - default_groups_ref: ['stock.group_stock_manager'] - !record {model: res.users, id: res_users_stock_manager}: company_id: base.main_company @@ -11,10 +8,13 @@ password: sam email: stockmanager@yourcompany.com - - Create a user as 'Stock User' + I added groups for Stock Manager. - - !context - default_groups_ref: ['stock.group_stock_user'] + !record {model: res.users, id: res_users_stock_manager}: + groups_id: + - stock.group_stock_manager +- + Create a user as 'Stock User' - !record {model: res.users, id: res_users_stock_user}: company_id: base.main_company @@ -22,3 +22,9 @@ login: sau password: sau email: stockuser@yourcompany.com +- + I added groups for Stock User. +- + !record {model: res.users, id: res_users_stock_user}: + groups_id: + - stock.group_stock_user From 693e52e928d76c13d3c814e2b91615fcffbc593c Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 15:04:13 +0530 Subject: [PATCH 74/88] [IMP]improve code bzr revid: sgo@tinyerp.com-20130507093413-42qiuvslavp0w4n1 --- addons/hr_recruitment/test/recruitment_process.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index 8cf924b5d05..1fa59328ef4 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -17,7 +17,7 @@ In Order to test process of Recruitment so giving HR officer's rights, - !context - uid: 'res_users_hr_officer' + uid: 'res_users_hr_recruitment_officer' - An applicant is interested in the job position. So he sends a resume by email. - From 2126f36ad127802dba5d46f4b04431e3eb7a8a9f Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Tue, 7 May 2013 15:08:48 +0530 Subject: [PATCH 75/88] [IMP] add group_id in MRP,mrp_repair and mrp_operations for assign groups bzr revid: fka@tinyerp.com-20130507093848-lrpqfao6kumlgepy --- addons/mrp/test/mrp_users.yml | 18 ++++++++++++------ .../test/workcenter_operations.yml | 9 ++++++--- addons/mrp_repair/test/mrp_repair_users.yml | 18 ++++++++++++------ 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/addons/mrp/test/mrp_users.yml b/addons/mrp/test/mrp_users.yml index 965a809eddc..b01f4f975bd 100644 --- a/addons/mrp/test/mrp_users.yml +++ b/addons/mrp/test/mrp_users.yml @@ -1,8 +1,5 @@ - Create a user as 'MRP Manager' -- - !context - default_groups_ref: [mrp.group_mrp_manager] - !record {model: res.users, id: res_users_mrp_manager}: company_id: base.main_company @@ -11,10 +8,13 @@ password: mam email: mrp_manager@yourcompany.com - - Create a user as 'MRP User' + I added groups for MRP Manager. - - !context - default_groups_ref: [mrp.group_mrp_user] + !record {model: res.users, id: res_users_mrp_manager}: + groups_id: + - mrp.group_mrp_manager +- + Create a user as 'MRP User' - !record {model: res.users, id: res_users_mrp_user}: company_id: base.main_company @@ -22,3 +22,9 @@ login: mau password: mau email: mrp_user@yourcompany.com +- + I added groups for MRP User. +- + !record {model: res.users, id: res_users_mrp_user}: + groups_id: + - mrp.group_mrp_user \ No newline at end of file diff --git a/addons/mrp_operations/test/workcenter_operations.yml b/addons/mrp_operations/test/workcenter_operations.yml index 3fc5b332d18..588ad639659 100644 --- a/addons/mrp_operations/test/workcenter_operations.yml +++ b/addons/mrp_operations/test/workcenter_operations.yml @@ -1,8 +1,5 @@ - Create a user as 'MRP User' -- - !context - default_groups_ref: [mrp.group_mrp_user] - !record {model: res.users, id: res_mrp_operation_user}: company_id: base.main_company @@ -10,6 +7,12 @@ login: maou password: maou email: mrp_operation_user@yourcompany.com +- + I added groups for MRP User. +- + !record {model: res.users, id: res_mrp_operation_user}: + groups_id: + - mrp.group_mrp_user - In order to test mrp_operations with OpenERP, I refer created production order of PC Assemble SC349 with routing - Manual Component's Assembly to test complete production process with respect of workcenter with giving access rights of MRP User. diff --git a/addons/mrp_repair/test/mrp_repair_users.yml b/addons/mrp_repair/test/mrp_repair_users.yml index f7ee95314e2..d5762e69b27 100644 --- a/addons/mrp_repair/test/mrp_repair_users.yml +++ b/addons/mrp_repair/test/mrp_repair_users.yml @@ -1,8 +1,5 @@ - Create a user as 'MRP Repair Manager' -- - !context - default_groups_ref: [mrp.group_mrp_manager] - !record {model: res.users, id: res_mrp_repair_manager}: company_id: base.main_company @@ -11,10 +8,13 @@ password: marm email: mrp_repair_manager@yourcompany.com - - Create a user as 'MRP Repair User' + I added groups for MRP Repair Manager. - - !context - default_groups_ref: [mrp.group_mrp_user] + !record {model: res.users, id: res_mrp_repair_manager}: + groups_id: + - mrp.group_mrp_manager +- + Create a user as 'MRP Repair User' - !record {model: res.users, id: res_mrp_repair_user}: company_id: base.main_company @@ -22,3 +22,9 @@ login: maru password: maru email: mrp_repair_user@yourcompany.com +- + I added groups for MRP Repair User. +- + !record {model: res.users, id: res_mrp_repair_user}: + groups_id: + - mrp.group_mrp_user \ No newline at end of file From 5d267f4b41654b98afabf2551574b46768f8d553 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 15:51:00 +0530 Subject: [PATCH 76/88] [IMP]improve code remove unused code bzr revid: sgo@tinyerp.com-20130507102100-7x01f5hglnw37jwb --- addons/hr_timesheet/test/hr_timesheet_users.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/addons/hr_timesheet/test/hr_timesheet_users.yml b/addons/hr_timesheet/test/hr_timesheet_users.yml index 8b8b799e503..cb59f77df69 100644 --- a/addons/hr_timesheet/test/hr_timesheet_users.yml +++ b/addons/hr_timesheet/test/hr_timesheet_users.yml @@ -14,9 +14,6 @@ - base.group_hr_manager - Create a user as 'HR timesheet Officer' -- - !context - default_groups_ref: [base.group_hr_user] - !record {model: res.users, id: res_hr_timesheet_officer}: company_id: base.main_company From c9271122b24b96198ff62485809d08f0f005cbfc Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 16:46:57 +0530 Subject: [PATCH 77/88] [IMP]remove access rights of account user and improve code bzr revid: sgo@tinyerp.com-20130507111657-gg47ca2206q3knd7 --- addons/account/security/ir.model.access.csv | 3 --- addons/account/test/account_customer_invoice.yml | 15 +++++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv index d6ba955aabc..d1f0bbab6b5 100644 --- a/addons/account/security/ir.model.access.csv +++ b/addons/account/security/ir.model.access.csv @@ -37,7 +37,6 @@ access_account_payment_term_manager,account.payment.term,model_account_payment_t access_account_payment_term_line_manager,account.payment.term.line,model_account_payment_term_line,account.group_account_manager,1,1,1,1 access_account_tax_manager,account.tax,model_account_tax,account.group_account_manager,1,1,1,1 access_account_journal_manager,account.journal,model_account_journal,account.group_account_manager,1,1,1,1 -access_account_journal_user,account.journal,model_account_journal,account.group_account_user,1,1,1,0 access_account_journal_invoice,account.journal invoice,model_account_journal,account.group_account_invoice,1,0,0,0 access_account_period_manager,account.period,model_account_period,account.group_account_manager,1,1,1,1 access_account_period_invoice,account.period invoice,model_account_period,account.group_account_invoice,1,0,0,0 @@ -72,7 +71,6 @@ access_report_account_type_sales,report.account_type.sales,model_report_account_ access_report_account_sales,report.account.sales,model_report_account_sales,account.group_account_manager,1,1,1,1 access_account_invoice_report,account.invoice.report,model_account_invoice_report,account.group_account_manager,1,1,1,1 access_res_partner_group_account_manager,res_partner group_account_manager,model_res_partner,account.group_account_manager,1,0,0,0 -access_res_partner_group_account_user,res_partner group_account_user,model_res_partner,account.group_account_user,1,1,1,0 access_account_invoice_accountant,account.invoice accountant,model_account_invoice,account.group_account_user,1,0,0,0 access_account_tax_code_accountant,account.tax.code accountant,model_account_tax_code,account.group_account_user,1,1,1,1 access_account_move_line_manager,account.move.line manager,model_account_move_line,account.group_account_manager,1,0,0,0 @@ -100,4 +98,3 @@ access_account_sequence_fiscal_year_sale_manager,account.sequence.fiscalyear.sal access_account_treasury_report_manager,account.treasury.report.manager,model_account_treasury_report,account.group_account_manager,1,0,0,0 access_account_financial_report,account.financial.report,model_account_financial_report,account.group_account_user,1,1,1,1 access_account_financial_report_invoice,account.financial.report invoice,model_account_financial_report,account.group_account_invoice,1,0,0,0 -access_res_partner_bank,res.partner.bank,model_res_partner_bank,account.group_account_user,1,1,1,0 diff --git a/addons/account/test/account_customer_invoice.yml b/addons/account/test/account_customer_invoice.yml index a41ca9bbfe4..d0b445fcff5 100644 --- a/addons/account/test/account_customer_invoice.yml +++ b/addons/account/test/account_customer_invoice.yml @@ -1,12 +1,10 @@ -- - Test with that user which have rights to make Invoicing and payment and who is accountant. -- - !context - uid: 'res_users_account_user' - In order to test account invoice I create a new customer invoice - - I will create bank detail + I will create bank detail with using manager access rights because account manager can only create bank details. +- + !context + uid: 'res_users_account_manager' - !record {model: res.partner.bank, id: res_partner_bank_0}: state: bank @@ -16,6 +14,11 @@ footer: True bank: base.res_bank_1 bank_name: Reserve +- + Test with that user which have rights to make Invoicing and payment and who is accountant. +- + !context + uid: 'res_users_account_user' - I create a customer invoice - From c9688c9d5d503df98e58f15632a075247837f2cf Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 17:04:19 +0530 Subject: [PATCH 78/88] [IMP] improve code bzr revid: sgo@tinyerp.com-20130507113419-hvk6cc9u3fxbpjl5 --- addons/account/test/account_test_users.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/test/account_test_users.yml b/addons/account/test/account_test_users.yml index b257feedff8..143e8bb5473 100644 --- a/addons/account/test/account_test_users.yml +++ b/addons/account/test/account_test_users.yml @@ -28,4 +28,5 @@ - !record {model: res.users, id: res_users_account_manager}: groups_id: - - account.group_account_manager \ No newline at end of file + - account.group_account_manager + - base.group_partner_manager \ No newline at end of file From bdc2be1aa4a6d348e30acab83ed975e18f494cf3 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Tue, 7 May 2013 18:11:54 +0530 Subject: [PATCH 79/88] [IMP]remove access rights of crm user and improve code bzr revid: sgo@tinyerp.com-20130507124154-4mrcpbocuafv4ny7 --- addons/crm/security/ir.model.access.csv | 1 - addons/crm/test/crm_access_group_users.yml | 1 + addons/crm/test/crm_lead_message.yml | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm/security/ir.model.access.csv b/addons/crm/security/ir.model.access.csv index 1589b50c016..b09c201df2b 100644 --- a/addons/crm/security/ir.model.access.csv +++ b/addons/crm/security/ir.model.access.csv @@ -35,6 +35,5 @@ access_crm_lead_partner_manager,crm.lead.partner.manager,model_crm_lead,base.gro access_crm_phonecall_partner_manager,crm.phonecall.partner.manager,model_crm_phonecall,base.group_partner_manager,1,1,1,1 access_crm_payment_mode_user,crm.payment.mode,model_crm_payment_mode,base.group_sale_salesman,1,0,0,0 access_crm_payment_mode,crm.payment.mode,model_crm_payment_mode,base.group_sale_manager,1,1,1,1 -access_ir_property_salesman,ir_property_salesman,base.model_ir_property,base.group_sale_salesman,1,1,1,0 access_base_partner_merge_line_manager,base_partner_merge_line.manager,model_base_partner_merge_line,base.group_system,1,1,1,1 access_base_partner_merge_manager,base_partner_merge.manager,model_base_partner_merge_automatic_wizard,base.group_system,1,1,1,1 diff --git a/addons/crm/test/crm_access_group_users.yml b/addons/crm/test/crm_access_group_users.yml index c9080ee530e..51cf52c0abc 100644 --- a/addons/crm/test/crm_access_group_users.yml +++ b/addons/crm/test/crm_access_group_users.yml @@ -28,3 +28,4 @@ !record {model: res.users, id: crm_res_users_salesman}: groups_id: - base.group_sale_salesman_all_leads + - base.group_partner_manager diff --git a/addons/crm/test/crm_lead_message.yml b/addons/crm/test/crm_lead_message.yml index f2463bab255..fcfe658a8f5 100644 --- a/addons/crm/test/crm_lead_message.yml +++ b/addons/crm/test/crm_lead_message.yml @@ -1,5 +1,5 @@ - - Give the access rights of Salesman to communicat with customer. + Give the access rights of Salesman to communicate with customer. - !context uid: 'crm_res_users_salesman' From c697009dea09da447564095d4b0a7df0b6c6bfdc Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 14 May 2013 15:26:29 +0200 Subject: [PATCH 80/88] [IMP]mrp: avoid adding account rights to users and create lines with superuser_id bzr revid: mat@openerp.com-20130514132629-91qrc32j04a1t5he --- addons/mrp/mrp.py | 9 ++++++--- addons/mrp/security/ir.model.access.csv | 1 - addons/mrp/test/mrp_users.yml | 1 + addons/mrp/test/order_process.yml | 8 +++++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 7fb40ce12af..f3b89a86d65 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -27,7 +27,7 @@ from openerp.osv import fields, osv from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DATETIME_FORMATS_MAP from openerp.tools import float_compare from openerp.tools.translate import _ -from openerp import tools +from openerp import tools, SUPERUSER_ID #---------------------------------------------------------- # Work Centers @@ -803,7 +803,10 @@ class mrp_production(osv.osv): account = wc.costs_hour_account_id.id if value and account: amount += value - analytic_line_obj.create(cr, uid, { + # we user SUPERUSER_ID as we do not garantee an mrp user + # has access to account analytic lines but still should be + # able to produce orders + analytic_line_obj.create(cr, SUPERUSER_ID, { 'name': wc_line.name + ' (H)', 'amount': value, 'account_id': account, @@ -819,7 +822,7 @@ class mrp_production(osv.osv): account = wc.costs_cycle_account_id.id if value and account: amount += value - analytic_line_obj.create(cr, uid, { + analytic_line_obj.create(cr, SUPERUSER_ID, { 'name': wc_line.name+' (C)', 'amount': value, 'account_id': account, diff --git a/addons/mrp/security/ir.model.access.csv b/addons/mrp/security/ir.model.access.csv index 2d0a478c33d..7a94b1a660c 100644 --- a/addons/mrp/security/ir.model.access.csv +++ b/addons/mrp/security/ir.model.access.csv @@ -1,5 +1,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_account_analytic_line_user,account.analytic.line,account.model_account_analytic_line,group_mrp_user,1,1,1,0 access_mrp_workcenter,mrp.workcenter,model_mrp_workcenter,mrp.group_mrp_user,1,0,0,0 access_mrp_routing,mrp.routing,model_mrp_routing,mrp.group_mrp_user,1,0,0,0 access_mrp_routing_workcenter,mrp.routing.workcenter,model_mrp_routing_workcenter,mrp.group_mrp_user,1,0,0,0 diff --git a/addons/mrp/test/mrp_users.yml b/addons/mrp/test/mrp_users.yml index b01f4f975bd..05c4889cf28 100644 --- a/addons/mrp/test/mrp_users.yml +++ b/addons/mrp/test/mrp_users.yml @@ -13,6 +13,7 @@ !record {model: res.users, id: res_users_mrp_manager}: groups_id: - mrp.group_mrp_manager + - account.group_account_user - Create a user as 'MRP User' - diff --git a/addons/mrp/test/order_process.yml b/addons/mrp/test/order_process.yml index 4d45b1d0968..ba4e1b79d66 100644 --- a/addons/mrp/test/order_process.yml +++ b/addons/mrp/test/order_process.yml @@ -183,7 +183,10 @@ order = self.browse(cr, uid, ref("mrp_production_test1")) assert order.state == 'done', "Production order should be closed." - - I check Total Costs at End of Production. + I check Total Costs at End of Production as a manager. +- + !context + uid: 'res_users_mrp_manager' - !python {model: mrp.production}: | order = self.browse(cr, uid, ref("mrp_production_test1")) @@ -217,6 +220,9 @@ assert line.product_uom_id.id == wc.product_id.uom_id.id, "UOM is not correspond." - I print a "BOM Structure". +- + !context + uid: 'res_users_mrp_user' - !python {model: mrp.production}: | import os From 143b485baf8adb7936d7784e314ccd405d1b8c14 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 14 May 2013 15:42:27 +0200 Subject: [PATCH 81/88] [IMP]resource: avoid better permissions on calendar_leaves bzr revid: mat@openerp.com-20130514134227-xnvyzjikwph8bp5k --- addons/project/security/ir.model.access.csv | 1 - addons/resource/__openerp__.py | 1 + addons/resource/security/ir.model.access.csv | 1 + addons/resource/security/resource_security.xml | 16 ++++++++++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 addons/resource/security/resource_security.xml diff --git a/addons/project/security/ir.model.access.csv b/addons/project/security/ir.model.access.csv index 1428f445e43..a76faa0fcce 100644 --- a/addons/project/security/ir.model.access.csv +++ b/addons/project/security/ir.model.access.csv @@ -19,7 +19,6 @@ access_project_task_history,project.task.history project,project.model_project_t access_project_task_history_cumulative,project.task.history project,project.model_project_task_history_cumulative,project.group_project_manager,1,0,0,0 access_project_task_history_cumulative,project.task.history project,project.model_project_task_history_cumulative,project.group_project_user,1,0,0,0 access_resource_calendar,project.resource_calendar manager,resource.model_resource_calendar,project.group_project_manager,1,0,0,0 -access_resource_calendar_leaves,project.resource_calendar_leaves manager,resource.model_resource_calendar_leaves,project.group_project_manager,1,0,0,0 access_project_category,project.project_category,model_project_category,,1,0,0,0 access_project_category_manager,project.project_category,model_project_category,project.group_project_manager,1,1,1,1 access_mail_alias,mail.alias,mail.model_mail_alias,project.group_project_manager,1,1,1,1 diff --git a/addons/resource/__openerp__.py b/addons/resource/__openerp__.py index b8a9f57c910..806e02e8c2b 100644 --- a/addons/resource/__openerp__.py +++ b/addons/resource/__openerp__.py @@ -38,6 +38,7 @@ associated to every resource. It also manages the leaves of every resource. 'depends': ['process'], 'data': [ 'security/ir.model.access.csv', + 'security/resource_security.xml', 'resource_view.xml', ], 'demo': ['resource_demo.xml'], diff --git a/addons/resource/security/ir.model.access.csv b/addons/resource/security/ir.model.access.csv index 533ad419274..058626831c6 100644 --- a/addons/resource/security/ir.model.access.csv +++ b/addons/resource/security/ir.model.access.csv @@ -3,4 +3,5 @@ access_resource_calendar,resource.calendar,model_resource_calendar,base.group_sy access_resource_calendar_attendance,resource.calendar.attendance,model_resource_calendar_attendance,base.group_system,1,1,1,1 access_resource_resource,resource.resource,model_resource_resource,base.group_system,1,0,0,0 access_resource_resource_all,resource.resource all,model_resource_resource,,1,0,0,0 +access_resource_calendar_leaves_all,resource.calendar.leaves,model_resource_calendar_leaves,,1,0,0,0 access_resource_calendar_leaves,resource.calendar.leaves,model_resource_calendar_leaves,base.group_system,1,1,1,1 diff --git a/addons/resource/security/resource_security.xml b/addons/resource/security/resource_security.xml new file mode 100644 index 00000000000..77d9a11751a --- /dev/null +++ b/addons/resource/security/resource_security.xml @@ -0,0 +1,16 @@ + + + + + + Resource: see own leaves + + + ['|', + ('resource_id', '=', False), + ('resource_id.user_id', '=', user.id), + ] + + + + From ff73b066ed6adee1cd00b70241a17394d55f7436 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Wed, 26 Jun 2013 17:29:47 +0530 Subject: [PATCH 82/88] [IMP]only manager can cancel lead so give access rights of manager for test bzr revid: sgo@tinyerp.com-20130626115947-idn10u0vtvkrvtb8 --- addons/crm/test/crm_lead_cancel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/test/crm_lead_cancel.yml b/addons/crm/test/crm_lead_cancel.yml index 13c3c18ed26..4d9b2e82925 100644 --- a/addons/crm/test/crm_lead_cancel.yml +++ b/addons/crm/test/crm_lead_cancel.yml @@ -2,7 +2,7 @@ I set a new sale team (with Marketing at parent) and I cancel unqualified lead giving access rights of salesman. - !context - uid: 'crm_res_users_salesman' + uid: 'crm_res_users_salesmanager' - !python {model: crm.lead}: | section_id = self.pool.get('crm.case.section').create(cr, uid, {'name': "Phone Marketing", 'parent_id': ref("crm.crm_case_section_2")}) From 7ec16a69c4e13b9b3223bfc752d699addf6f0b9c Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Mon, 1 Jul 2013 16:12:29 +0530 Subject: [PATCH 83/88] [IMP]only manager can create issue bzr revid: sgo@tinyerp.com-20130701104229-2xq8pyxkbymhdtfh --- addons/project_issue/test/issue_demo.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/project_issue/test/issue_demo.yml b/addons/project_issue/test/issue_demo.yml index b7342b435ab..f84c716baeb 100644 --- a/addons/project_issue/test/issue_demo.yml +++ b/addons/project_issue/test/issue_demo.yml @@ -1,9 +1,14 @@ - - Test the whole create project issue with project user. + Test the whole create project issue with project manager. - !context - uid: 'res_users_project_issue_user' + uid: 'res_users_project_issue_manager' +- + !record {model: project.issue, id: project_task_1, view: False}: + task_id: 'project.project_task_17' + name: 'Error in account module' - !record {model: project.issue, id: project01, view: False}: project_id: 'project.project_project_2' name: 'OpenERP Integration' + From 9349ba848497b9c5b7ded809a4db6b1e3b26b6a6 Mon Sep 17 00:00:00 2001 From: "sgo@tinyerp.com" <> Date: Mon, 1 Jul 2013 17:16:25 +0530 Subject: [PATCH 84/88] [IMP]define context to yml function bzr revid: sgo@tinyerp.com-20130701114625-vshpugzujnvgdf5x --- addons/sale_stock/test/cancel_order_sale_stock.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/sale_stock/test/cancel_order_sale_stock.yml b/addons/sale_stock/test/cancel_order_sale_stock.yml index 0278bd52713..29581b944bf 100644 --- a/addons/sale_stock/test/cancel_order_sale_stock.yml +++ b/addons/sale_stock/test/cancel_order_sale_stock.yml @@ -10,6 +10,7 @@ I send delivery in two shipments, so I am doing a partial delivery order. - !python {model: stock.picking}: | + context={} delivery_orders = self.search(cr, uid, [('sale_id','=',ref("sale.sale_order_8"))]) first_picking = self.browse(cr, uid, delivery_orders[-1], context=context) if first_picking.force_assign(cr, uid, first_picking): From c312cac0fa40c6bddd7785f29c6feaadd1ff384d Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 11 Sep 2013 14:11:32 +0200 Subject: [PATCH 85/88] [IMP] remove merged conflict bzr revid: mat@openerp.com-20130911121132-47g2d267ld4b2cyl --- addons/project_issue/test/issue_process.yml | 46 --------------------- 1 file changed, 46 deletions(-) diff --git a/addons/project_issue/test/issue_process.yml b/addons/project_issue/test/issue_process.yml index 08e576d86dd..61ebe2e646c 100644 --- a/addons/project_issue/test/issue_process.yml +++ b/addons/project_issue/test/issue_process.yml @@ -1,32 +1,4 @@ - -<<<<<<< TREE - Project user can subscribe issue, so let's check data with giving the access rights of user. -- - !context - uid: 'res_users_project_issue_user' -- - In order to test process of issue tracking in OpenERP, I Open the Issue. -- - !python {model: project.issue}: | - self.case_open(cr, uid, [ref("crm_case_buginaccountsmodule0")]) -- - I check state of Issue after opened it. -- - !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in open state}: - - state == 'open' -- - Now I put Issue in pending due to need more information. -- - !python {model: project.issue}: | - self.case_pending(cr, uid, [ref("crm_case_buginaccountsmodule0")]) -- - I check state after put in pending. -- - !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in pending state}: - - state == 'pending' -- -======= ->>>>>>> MERGE-SOURCE I send mail to get more details. TODO revert mail.mail to mail.compose.message (conversion to customer should be automatic). - !python {model: mail.mail }: | @@ -48,21 +20,3 @@ - !python {model: project.issue}: | self.convert_issue_task(cr, uid, [ref("crm_case_buginaccountsmodule0")]) -<<<<<<< TREE -- - After resolving Issue Project user can close issue, so let's check data with giving the access rights of user. -- - !context - uid: 'res_users_project_issue_user' -- - I close Issue after resolving it -- - !python {model: project.issue}: | - self.case_close(cr, uid, [ref("crm_case_buginaccountsmodule0")]) -- - I Check state of Issue after closed. -- - !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in done state}: - - state == 'done' -======= ->>>>>>> MERGE-SOURCE From 5e051e9484d8e44da9742d623326c1e09b21aec3 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 11 Sep 2013 16:25:49 +0200 Subject: [PATCH 86/88] [FIX] resource: better access rights bzr revid: mat@openerp.com-20130911142549-cpzg8588ol31b8k1 --- addons/hr_holidays/security/ir_rule.xml | 7 +++++++ addons/resource/security/ir.model.access.csv | 2 +- addons/resource/security/resource_security.xml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/addons/hr_holidays/security/ir_rule.xml b/addons/hr_holidays/security/ir_rule.xml index e2c0ffb1a6f..1ff12f41244 100644 --- a/addons/hr_holidays/security/ir_rule.xml +++ b/addons/hr_holidays/security/ir_rule.xml @@ -15,5 +15,12 @@ + + Leaves Officer + + [(1,'=',1)] + + + diff --git a/addons/resource/security/ir.model.access.csv b/addons/resource/security/ir.model.access.csv index 058626831c6..bf8504e2f46 100644 --- a/addons/resource/security/ir.model.access.csv +++ b/addons/resource/security/ir.model.access.csv @@ -3,5 +3,5 @@ access_resource_calendar,resource.calendar,model_resource_calendar,base.group_sy access_resource_calendar_attendance,resource.calendar.attendance,model_resource_calendar_attendance,base.group_system,1,1,1,1 access_resource_resource,resource.resource,model_resource_resource,base.group_system,1,0,0,0 access_resource_resource_all,resource.resource all,model_resource_resource,,1,0,0,0 -access_resource_calendar_leaves_all,resource.calendar.leaves,model_resource_calendar_leaves,,1,0,0,0 +access_resource_calendar_leaves_user,resource.calendar.leaves,model_resource_calendar_leaves,base.group_user,1,0,0,0 access_resource_calendar_leaves,resource.calendar.leaves,model_resource_calendar_leaves,base.group_system,1,1,1,1 diff --git a/addons/resource/security/resource_security.xml b/addons/resource/security/resource_security.xml index 77d9a11751a..43bfa6c3a4b 100644 --- a/addons/resource/security/resource_security.xml +++ b/addons/resource/security/resource_security.xml @@ -5,7 +5,7 @@ Resource: see own leaves - + ['|', ('resource_id', '=', False), ('resource_id.user_id', '=', user.id), From f5d8d2a451f719b98440203deed26a6ace41e1b4 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Wed, 11 Sep 2013 17:31:50 +0200 Subject: [PATCH 87/88] [FIX] crm: better test bzr revid: mat@openerp.com-20130911153150-uje35usg4jj8710l --- addons/crm/test/crm_lead_onchange.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/crm/test/crm_lead_onchange.yml b/addons/crm/test/crm_lead_onchange.yml index 6e11c7c54c3..ca6dd88d085 100644 --- a/addons/crm/test/crm_lead_onchange.yml +++ b/addons/crm/test/crm_lead_onchange.yml @@ -24,6 +24,7 @@ !record {model: crm.phonecall, id: crm_phonecall_5}: name: 'Bad time' partner_id: base.res_partner_5 +- Sales manager set the next stage to "New" for the lead. - !python {model: crm.lead}: | From bed4a740d48916569b9e120079eacf42b7b4006c Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 12 Sep 2013 09:06:47 +0200 Subject: [PATCH 88/88] [FIX] crm: removed useless test with state -> stage bzr revid: mat@openerp.com-20130912070647-abvqj0j57nazap6l --- addons/crm/test/crm_lead_onchange.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/addons/crm/test/crm_lead_onchange.yml b/addons/crm/test/crm_lead_onchange.yml index ca6dd88d085..c9ce6210c17 100644 --- a/addons/crm/test/crm_lead_onchange.yml +++ b/addons/crm/test/crm_lead_onchange.yml @@ -1,4 +1,3 @@ - - Sales manager create a lead record to call a partner onchange, stage onchange and mailing opt-in onchange method. - @@ -24,8 +23,3 @@ !record {model: crm.phonecall, id: crm_phonecall_5}: name: 'Bad time' partner_id: base.res_partner_5 -- - Sales manager set the next stage to "New" for the lead. -- - !python {model: crm.lead}: | - self.stage_next(cr, uid, [ref("crm_case_4")], context={'stage_type': 'lead'})