From b51ee12331c0501f284e8eb8d41eb734d38ed51e Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Thu, 29 Jan 2026 17:49:20 +0100 Subject: [PATCH] 29.01.26 --- modules/purchase/purchase.py | 3 +-- modules/purchase_trade/fee.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/purchase/purchase.py b/modules/purchase/purchase.py index 99cc600..a29be71 100755 --- a/modules/purchase/purchase.py +++ b/modules/purchase/purchase.py @@ -1891,8 +1891,6 @@ class Line(sequence_ordered(), ModelSQL, ModelView): self.product.supplier_taxes_deductible_rate_used) invoice_line.invoice_type = 'in' if self.product: - if self.product.type == 'service': - quantity = 1 if self.product.type == 'service' and not self.product.landed_cost: invoice_line.account = self.product.account_stock_in_used else: @@ -1922,6 +1920,7 @@ class Line(sequence_ordered(), ModelSQL, ModelView): invoice_line.lot = l.id if self.product.type == 'service': invoice_line.unit_price = self.unit_price + invoice_line.quantity = 1 invoice_line.product = self.product invoice_line.stock_moves = [] Fee = Pool().get('fee.fee') diff --git a/modules/purchase_trade/fee.py b/modules/purchase_trade/fee.py index 73cdab2..051138f 100755 --- a/modules/purchase_trade/fee.py +++ b/modules/purchase_trade/fee.py @@ -443,23 +443,23 @@ class Fee(ModelSQL,ModelView): if self.p_r == 'pay': move_line.debit = amount move_line.credit = Decimal(0) - move_line.account = self.product.account_stock_used + move_line.account = self.product.account_stock_used if in_out == 'in' else self.product.account_cogs_used if hasattr(move_line, 'second_currency') and move_line.second_currency: move_line.amount_second_currency = amount_converted move_line_.debit = Decimal(0) move_line_.credit = amount - move_line_.account = self.product.account_stock_in_used if in_out == 'in' else self.product.account_cogs_used + move_line_.account = self.product.account_stock_in_used if in_out == 'in' else self.product.account_stock_out_used if hasattr(move_line_, 'second_currency') and move_line_.second_currency: move_line_.amount_second_currency = -amount_converted else: move_line.debit = Decimal(0) move_line.credit = amount - move_line.account = self.product.account_stock_used + move_line.account = self.product.account_stock_used if in_out == 'in' else self.product.account_cogs_used if hasattr(move_line, 'second_currency') and move_line.second_currency: move_line.amount_second_currency = -amount_converted move_line_.debit = amount move_line_.credit = Decimal(0) - move_line_.account = self.product.account_stock_in_used if in_out == 'in' else self.product.account_cogs_used + move_line_.account = self.product.account_stock_in_used if in_out == 'in' else self.product.account_stock_out_used if hasattr(move_line_, 'second_currency') and move_line_.second_currency: move_line_.amount_second_currency = amount_converted