-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] rma_purchase: write-off differences in price between rma line a…
…nd vendor refund
- Loading branch information
1 parent
b712dec
commit 363cfab
Showing
4 changed files
with
194 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
from . import rma_operation | ||
from . import procurement | ||
from . import account_move | ||
from . import account_move_line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from odoo import models | ||
|
||
|
||
class AccountMoveLine(models.Model): | ||
_inherit = "account.move.line" | ||
|
||
def _get_price_diff_account(self): | ||
# force the price difference account to be taken from the price | ||
# different properties as they was in the previous Odoo versions | ||
self.ensure_one() | ||
if self.product_id.cost_method != "standard": | ||
debit_pdiff_account = ( | ||
self.product_id.property_account_creditor_price_difference | ||
or self.product_id.categ_id.property_account_creditor_price_difference_categ | ||
) | ||
debit_pdiff_account = self.move_id.fiscal_position_id.map_account( | ||
debit_pdiff_account | ||
) | ||
return debit_pdiff_account | ||
return super()._get_price_diff_account() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters