Skip to content

Commit

Permalink
!fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronHForgeFlow committed Dec 4, 2018
1 parent 8e9f443 commit a821f99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
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 a821f99

Please sign in to comment.