Skip to content

Commit

Permalink
!fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronHForgeFlow committed Dec 11, 2018
1 parent c51b109 commit 2987191
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion sale_procurement_group_by_requested_date/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

0 comments on commit 2987191

Please sign in to comment.