Skip to content

Commit 59a51af

Browse files
committed
[ENH] invoice plane, change advance deduction to always 1 qty
1 parent ad29f3b commit 59a51af

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

Diff for: purchase_invoice_plan/models/purchase.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,11 @@ def compute_advance_payment_line(self, inv_id):
253253
for preline in advance.invoice_line:
254254
ratio = (order.amount_untaxed and
255255
(invoice.amount_untaxed /
256-
order.amount_untaxed) or
257-
1.0)
256+
order.amount_untaxed) or 1.0)
258257
inv_line = preline.copy(
259258
{'invoice_id': inv_id,
260-
'price_unit': -1 *
261-
preline.price_unit})
262-
inv_line.quantity = \
263-
inv_line.quantity * ratio
259+
'price_unit': -preline.price_unit * ratio})
260+
inv_line.quantity = 1.0
264261
invoice.button_compute()
265262
return True
266263

Diff for: sale_invoice_plan/models/sale.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ def _make_invoice(self, order, lines):
296296
order.amount_untaxed) or 1.0)
297297
inv_line = preline.copy(
298298
{'invoice_id': inv_id,
299-
'price_unit': -preline.price_unit})
300-
inv_line.quantity = inv_line.quantity * ratio
299+
'price_unit': -preline.price_unit * ratio})
300+
inv_line.quantity = 1.0
301301
invoice.button_compute()
302302
return inv_id
303303

0 commit comments

Comments
 (0)