[FIX] sale: no warn onchange pricelist and no line

The popup warning that changing the pricelist will not update the existing order lines should not be diplayed it there is no order line set.

It was the case until 8.0. The change of behavior of on changes has broken this feature: Now, the on change return [(6, 0, [])] for an empy order line list, instead of just [].
This commit is contained in:
Denis Ledoux 2014-07-15 16:30:38 +02:00
parent f98c610310
commit c363451f95
1 changed files with 1 additions and 1 deletions

View File

@ -291,7 +291,7 @@ class sale_order(osv.osv):
value = {
'currency_id': self.pool.get('product.pricelist').browse(cr, uid, pricelist_id, context=context).currency_id.id
}
if not order_lines:
if not order_lines or order_lines == [(6, 0, [])]:
return {'value': value}
warning = {
'title': _('Pricelist Warning!'),