diff --git a/addons/purchase/invoice.py b/addons/purchase/invoice.py index 6b8b278edda..91472da8653 100644 --- a/addons/purchase/invoice.py +++ b/addons/purchase/invoice.py @@ -113,6 +113,15 @@ class AccountInvoice(models.Model): res.extend(self._anglo_saxon_purchase_move_lines(i_line, res)) return res + @api.model + def _anglo_saxon_sale_move_lines(self, i_line): + for sale_line in i_line.sale_line_ids: + for proc in sale_line.procurement_ids: + if proc.purchase_line_id: + #if the invoice line is related to sale order lines having one of its procurement_ids with a purchase_line_id set, it means that it is a confirmed dropship and in that case we mustn't create the cost of sale line (because the product won't enter the stock) + return [] + return super(AccountInvoice, self)._anglo_saxon_sale_move_lines(i_line) + @api.model def _anglo_saxon_purchase_move_lines(self, i_line, res): """Return the additional move lines for purchase invoices and refunds.