Skip to content

Commit

Permalink
[FIX] sale_line_price_properties_based: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
tafaRU committed May 31, 2017
1 parent 5b892bf commit d5f28c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 8 additions & 2 deletions sale_line_price_properties_based/models/sale_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,16 @@ def product_id_change(
# get empty properties dynamic fields
property_group_pool = self.pool['mrp.property.group']
group_to_empty_ids = property_group_pool.search(
cr, uid, [('draw_dynamically', '=', True)], context=context)
cr, uid,
[('draw_dynamically', '=', True)], context=context)
groups = property_group_pool.browse(
cr, uid, group_to_empty_ids, context=context
)
for group in groups:
res['value'][group.field_id.name] = None
if (
group.field_id and
group.field_id.name and
group.field_id.name in res['value']
):
res['value'][group.field_id.name] = None
return res
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ def setUp(self):

length_5 = self.env.ref('sale_properties_easy_creation.length_5')
width_1 = self.env.ref('sale_properties_easy_creation.width_1')

self.sol = self.env['sale.order.line'].create({
'name': '/',
'order_id': self.so.id,
'product_id': product.id,
'property_ids': [(6, False, [length_5.id, width_1.id])]
})
self.sol.property_ids = [length_5.id, width_1.id]

def test_price_property_ids_changed(self):
self.sol.price_property_ids_changed()
Expand Down

0 comments on commit d5f28c3

Please sign in to comment.