[IMP] point_of_sale: distinguish discounted lines

After closing a POS session, the pos order lines are grouped by product.
Instead, distinguish products with a different discount notice to have different lines for such products in the generated account.move for better traceability.
This commit is contained in:
Stéphane Bidoul
2014-11-04 10:07:42 +01:00
committed by Martin Trigaux
parent 1e753e6173
commit a1fa667be5
+7 -2
View File
@@ -1073,7 +1073,7 @@ class pos_order(osv.osv):
})
if data_type == 'product':
key = ('product', values['partner_id'], values['product_id'], values['debit'] > 0)
key = ('product', values['partner_id'], (values['product_id'], values['name']), values['debit'] > 0)
elif data_type == 'tax':
key = ('tax', values['partner_id'], values['tax_code_id'], values['debit'] > 0)
elif data_type == 'counter_part':
@@ -1146,9 +1146,14 @@ class pos_order(osv.osv):
if tax_code_id:
break
name = line.product_id.name
if line.notice:
# add discount reason in move
name = name + ' (' + line.notice + ')'
# Create a move for the line
insert_data('product', {
'name': line.product_id.name,
'name': name,
'quantity': line.qty,
'product_id': line.product_id.id,
'account_id': income_account,