From 8ffe241beef1610f3e3bda53a8a52b0790ecebe8 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Tue, 19 Sep 2017 13:22:28 +0200 Subject: [PATCH] [FIX] *: incorrect many2many commands Those cases worked by chance until the former commit. --- addons/hr_payroll/tests/common.py | 4 +++- addons/hr_payroll/tests/test_payslip_flow.py | 2 +- .../tests/test_payment_advice_batch.py | 2 +- addons/stock/tests/test_move.py | 10 +++++----- addons/website_crm_partner_assign/security/ir_rule.xml | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/addons/hr_payroll/tests/common.py b/addons/hr_payroll/tests/common.py index 8df3e9f09b1..29e5faa31e3 100644 --- a/addons/hr_payroll/tests/common.py +++ b/addons/hr_payroll/tests/common.py @@ -34,7 +34,9 @@ class TestPayslipBase(TransactionCase): 'name': 'Salary Structure for Software Developer', 'code': 'SD', 'company_id': self.ref('base.main_company'), - 'rule_ids': [(4, [self.hra_rule_id, self.conv_rule_id, self.prof_tax_rule_id, self.pf_rule_id, self.mv_rule_id, self.comm_rule_id])] + 'rule_ids': [(4, self.hra_rule_id), (4, self.conv_rule_id), + (4, self.prof_tax_rule_id), (4, self.pf_rule_id), + (4, self.mv_rule_id), (4, self.comm_rule_id)], }) # I create a contract for "Richard" diff --git a/addons/hr_payroll/tests/test_payslip_flow.py b/addons/hr_payroll/tests/test_payslip_flow.py index 54de80bfbba..d665019de0e 100644 --- a/addons/hr_payroll/tests/test_payslip_flow.py +++ b/addons/hr_payroll/tests/test_payslip_flow.py @@ -56,7 +56,7 @@ class TestPayslipFlow(TestPayslipBase): # I create record for generating the payslip for this Payslip run. payslip_employee = self.env['hr.payslip.employees'].create({ - 'employee_ids': [(4, self.richard_emp.ids)] + 'employee_ids': [(4, self.richard_emp.id)] }) # I generate the payslip by clicking on Generat button wizard. diff --git a/addons/l10n_in_hr_payroll/tests/test_payment_advice_batch.py b/addons/l10n_in_hr_payroll/tests/test_payment_advice_batch.py index 5577c321959..a833ac67631 100644 --- a/addons/l10n_in_hr_payroll/tests/test_payment_advice_batch.py +++ b/addons/l10n_in_hr_payroll/tests/test_payment_advice_batch.py @@ -14,7 +14,7 @@ class TestPaymentAdviceBatch(TestPaymentAdviceBase): # I create record for generating the Payslip for Payslip Batch. payslip_employee = self.PayslipEmployee.create({ - 'employee_ids': [(4, self.rahul_emp.ids)] + 'employee_ids': [(4, self.rahul_emp.id)] }) # I generate the payslip by clicking on Generate button wizard. diff --git a/addons/stock/tests/test_move.py b/addons/stock/tests/test_move.py index a55321448a1..4e0db43fe02 100644 --- a/addons/stock/tests/test_move.py +++ b/addons/stock/tests/test_move.py @@ -1030,7 +1030,7 @@ class StockMove(TransactionCase): }) move_stock_pack_1.write({'move_dest_ids': [(4, move_pack_cust.id, 0)]}) move_stock_pack_2.write({'move_dest_ids': [(4, move_pack_cust.id, 0)]}) - move_pack_cust.write({'move_orig_ids': [(4, [move_stock_pack_1.id, move_stock_pack_2.id], 0)]}) + move_pack_cust.write({'move_orig_ids': [(4, move_stock_pack_1.id, 0), (4, move_stock_pack_2.id, 0)]}) (move_stock_pack_1 + move_stock_pack_2 + move_pack_cust)._action_confirm() @@ -1106,7 +1106,7 @@ class StockMove(TransactionCase): }) move_stock_pack_1.write({'move_dest_ids': [(4, move_pack_cust.id, 0)]}) move_stock_pack_2.write({'move_dest_ids': [(4, move_pack_cust.id, 0)]}) - move_pack_cust.write({'move_orig_ids': [(4, [move_stock_pack_1.id, move_stock_pack_2.id], 0)]}) + move_pack_cust.write({'move_orig_ids': [(4, move_stock_pack_1.id, 0), (4, move_stock_pack_2.id, 0)]}) (move_stock_pack_1 + move_stock_pack_2 + move_pack_cust)._action_confirm() @@ -1165,7 +1165,7 @@ class StockMove(TransactionCase): 'product_uom': self.uom_unit.id, 'product_uom_qty': 1.0, }) - move_stock_pack.write({'move_dest_ids': [(4, move_pack_cust_1.id, move_pack_cust_2.id, 0)]}) + move_stock_pack.write({'move_dest_ids': [(4, move_pack_cust_1.id, 0), (4, move_pack_cust_2.id, 0)]}) move_pack_cust_1.write({'move_orig_ids': [(4, move_stock_pack.id, 0)]}) move_pack_cust_2.write({'move_orig_ids': [(4, move_stock_pack.id, 0)]}) @@ -1214,7 +1214,7 @@ class StockMove(TransactionCase): 'product_uom': self.uom_unit.id, 'product_uom_qty': 3.0, }) - move_stock_stock_1.write({'move_orig_ids': [(4, [move_supp_stock_1.id, move_supp_stock_2.id], 0)]}) + move_stock_stock_1.write({'move_orig_ids': [(4, move_supp_stock_1.id, 0), (4, move_supp_stock_2.id, 0)]}) move_stock_stock_2 = self.env['stock.move'].create({ 'name': 'test_link_assign_6_1', 'location_id': self.stock_location.id, @@ -1223,7 +1223,7 @@ class StockMove(TransactionCase): 'product_uom': self.uom_unit.id, 'product_uom_qty': 3.0, }) - move_stock_stock_2.write({'move_orig_ids': [(4, [move_supp_stock_1.id, move_supp_stock_2.id], 0)]}) + move_stock_stock_2.write({'move_orig_ids': [(4, move_supp_stock_1.id, 0), (4, move_supp_stock_2.id, 0)]}) (move_supp_stock_1 + move_supp_stock_2 + move_stock_stock_1 + move_stock_stock_2)._action_confirm() move_supp_stock_1._action_assign() diff --git a/addons/website_crm_partner_assign/security/ir_rule.xml b/addons/website_crm_partner_assign/security/ir_rule.xml index 23c72c27781..2081edd4419 100644 --- a/addons/website_crm_partner_assign/security/ir_rule.xml +++ b/addons/website_crm_partner_assign/security/ir_rule.xml @@ -4,7 +4,7 @@ Portal Graded Partner: read and write assigned leads - + [('partner_assigned_id','child_of',user.commercial_partner_id.id)] @@ -16,7 +16,7 @@ Portal/Public user: read only website published - + [('website_published','=', True)]