Steps to reproduce: 1. Activate landed costs 2. Create a product that in the purchase tab has active 'Is a landed cost' 3. Add this product to a purchase order 4. Confirm the PO and create the bill is Landed costs checkbox is not enabled when this product is being invoiced. Any time you add this product to an invoice manually it will have it on. They want that same behavior when the invoice line comes from Purchase Order opw-2332763 X-original-commit: d8f5ed417deb82151abf7a25ad16ce0720e90780
10 lines
311 B
Python
10 lines
311 B
Python
from odoo import api,models
|
|
|
|
class PurchaseOrderLine(models.Model):
|
|
_inherit = 'purchase.order.line'
|
|
|
|
def _prepare_account_move_line(self, move=False):
|
|
res = super()._prepare_account_move_line(move)
|
|
res.update({'is_landed_costs_line': self.product_id.landed_cost_ok})
|
|
return res
|