From 29871917146b4904280d7055c7a940872641117e Mon Sep 17 00:00:00 2001 From: aheficent Date: Tue, 4 Dec 2018 17:53:01 +0100 Subject: [PATCH] !fixup --- .../__manifest__.py | 2 +- .../models/sale_order.py | 1 - ...est_sale_procurement_group_by_requested_date.py | 14 ++++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/sale_procurement_group_by_requested_date/__manifest__.py b/sale_procurement_group_by_requested_date/__manifest__.py index 3857b97c723c..d51b60d2acfa 100644 --- a/sale_procurement_group_by_requested_date/__manifest__.py +++ b/sale_procurement_group_by_requested_date/__manifest__.py @@ -8,7 +8,7 @@ "summary": "Groups pickings based on requested date of order line", "version": "10.0.1.0.0", "category": "Sales Management", - "website": "http://www.eficent.com", + 'website': "https://github.com/OCA/sale-workflow", "author": "Eficent , " "SerpentCS," "Odoo Community Association (OCA)", diff --git a/sale_procurement_group_by_requested_date/models/sale_order.py b/sale_procurement_group_by_requested_date/models/sale_order.py index f7e1846762de..cc5790bc3c54 100644 --- a/sale_procurement_group_by_requested_date/models/sale_order.py +++ b/sale_procurement_group_by_requested_date/models/sale_order.py @@ -28,7 +28,6 @@ class SaleOrderLine(models.Model): def _prepare_order_line_procurement(self, group_id=False): values = super(SaleOrderLine, self).\ _prepare_order_line_procurement(group_id=group_id) - self.ensure_one() if self.requested_date: req_datetime = fields.Datetime.from_string(self.requested_date) req_date = fields.Date.to_string(req_datetime) diff --git a/sale_procurement_group_by_requested_date/tests/test_sale_procurement_group_by_requested_date.py b/sale_procurement_group_by_requested_date/tests/test_sale_procurement_group_by_requested_date.py index d29405357ec8..c304100c1381 100644 --- a/sale_procurement_group_by_requested_date/tests/test_sale_procurement_group_by_requested_date.py +++ b/sale_procurement_group_by_requested_date/tests/test_sale_procurement_group_by_requested_date.py @@ -17,6 +17,8 @@ def setUp(self): """ super(TestSaleMultiPickingByRequestedDate, self).setUp() sale_obj = self.env['sale.order'] + self.proc_obj = self.env['procurement.order'] + self.proc_group_obj = self.env['procurement.group'] order_line = self.env['sale.order.line'] Product = self.env['product.product'] p1 = Product.create({'name': 'p1', 'type': 'product'}).id @@ -83,32 +85,32 @@ def test_number_of_groups(self): self.sale1.action_confirm() req_date = fields.Date.to_string(self.dt1) g_name = self.sale1.name + '/' + req_date - groups = self.env['procurement.group'].search([('name', '=', g_name)]) + groups = self.proc_group_obj.search([('name', '=', g_name)]) for group in groups: if group.name == g_name: - procurements = self.env['procurement.order'].search([ + procurements = self.proc_obj.search([ ('group_id', '=', group.id)]) self.assertEqual(len(procurements), 2) self.assertEqual(len(groups), 1) req_date2 = fields.Date.to_string(self.dt2) g_name = self.sale1.name + '/' + req_date2 - groups = self.env['procurement.group'].search([('name', '=', g_name)]) + groups = self.proc_group_obj.search([('name', '=', g_name)]) for group in groups: if group.name == g_name: - procurements = self.env['procurement.order'].search([ + procurements = self.proc_obj.search([ ('group_id', '=', group.id)]) self.assertEqual(len(procurements), 2) self.assertEqual(len(groups), 1) self.sale2.action_confirm() g_name = self.sale2.name + '/' + req_date - groups = self.env['procurement.group'].search([('name', '=', g_name)]) + groups = self.proc_group_obj.search([('name', '=', g_name)]) for group in groups: if group.name == g_name: - procurements = self.env['procurement.order'].search([ + procurements = self.proc_obj.search([ ('group_id', '=', group.id)]) self.assertEqual(len(procurements), 4) self.assertEqual(len(groups), 1)