Skip to content

Commit

Permalink
[FIX] sale_stock: New SO line when validating the related invoice
Browse files Browse the repository at this point in the history
Steps to reproduce the bug:

- Let's consider a storable product P with automatic inventory valuation and re-invoicing policy at cost
- Create a SO with P, generate an invoice I and validate I

Bug:

A new line was added in the SO (related to the anglo saxon move line)

PS: In 12.0, no line was added on the SO when I was validated.

opw:2247915

closes odoo#52873

Signed-off-by: Simon Goffin (sig) <[email protected]>
  • Loading branch information
simongoffin committed Jun 15, 2020
1 parent c99fe9d commit c5cd732
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions addons/sale_stock/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ def _filter_outgoing_sml(ml):
class AccountMoveLine(models.Model):
_inherit = "account.move.line"

def _sale_can_be_reinvoice(self):
self.ensure_one()
return not self.is_anglo_saxon_line and super(AccountMoveLine, self)._sale_can_be_reinvoice()


def _stock_account_get_anglo_saxon_price_unit(self):
self.ensure_one()
price_unit = super(AccountMoveLine, self)._stock_account_get_anglo_saxon_price_unit()
Expand Down

0 comments on commit c5cd732

Please sign in to comment.