[FIX] delivery: allow carrier with 0.0 as normal price

Before this rev.,
if you define a carrier
 - without advanced price rules
 - with a normal price set to 0.0
 - Free if more than amount unchecked

When you try to invoice a delivery order
(coming from a sales order with as invoicing policy
"on delivery order)
No grid was found, while there was one, with as price 0.0

Closes #1364
This commit is contained in:
Denis Ledoux 2015-06-25 14:50:15 +02:00
parent c3ca61da9e
commit ba46732744
1 changed files with 3 additions and 3 deletions

View File

@ -112,10 +112,10 @@ class delivery_carrier(osv.osv):
# not using advanced pricing per destination: override grid
grid_id = grid_pool.search(cr, uid, [('carrier_id', '=', record.id)], context=context)
if grid_id and not (record.normal_price or record.free_if_more_than):
if grid_id and not (record.normal_price is not False or record.free_if_more_than):
grid_pool.unlink(cr, uid, grid_id, context=context)
if not (record.normal_price or record.free_if_more_than):
if not (record.normal_price is not False or record.free_if_more_than):
continue
if not grid_id:
@ -142,7 +142,7 @@ class delivery_carrier(osv.osv):
'list_price': 0.0,
}
grid_line_pool.create(cr, uid, line_data, context=context)
if record.normal_price:
if record.normal_price is not False:
line_data = {
'grid_id': grid_id and grid_id[0],
'name': _('Default price'),