Files
odoo_source/addons/purchase_mrp/models/account_move.py
T
Arnold Moyaux 35d6c58f86 [REF] purchase_stock, stock_account: remove price difference account
Invoice a different amount than on the purchase order will not
use the price difference account anymore. Instead it will create
a layer with the difference. It means the stock valuation will be
base on real quantity invoiced rather than the purchase order.

Since the price different account does not exists:
- Invoice correction is only done on `account.move.line` linked to a
  `purchase.order.line`. It means that additional lines won't be
 corrected and will debit the stock_input instead (that should be empty
 manually)

Part-of: odoo/odoo#99411
2022-09-12 13:49:16 +02:00

15 lines
482 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class AccountMoveLine(models.Model):
_inherit = "account.move.line"
def _get_stock_valuation_layers(self, move):
""" Do not handle the invoice correction for kit. It has to be done
manually """
layers = super()._get_stock_valuation_layers(move)
return layers.filtered(lambda svl: svl.product_id == self.product_id)