purchase_rfq_comparison/models/purchase_order.py
2025-10-17 09:19:12 +07:00

21 lines
714 B
Python

from odoo import models, fields, api
class PurchaseOrder(models.Model):
_inherit = 'purchase.order'
# Fields for "To Compare" page
comparison_notes = fields.Text(string='Notes')
garansi = fields.Boolean(string='Garansi')
landed_cost = fields.Boolean(string='Landed Cost')
landed_cost_tag_ids = fields.Many2many(
'purchase.landed.cost.tag',
string='Landed Cost Tags',
help='Select applicable landed cost types'
)
@api.onchange('landed_cost')
def _onchange_landed_cost(self):
"""Clear landed cost tags when landed cost is disabled"""
if not self.landed_cost:
self.landed_cost_tag_ids = [(5, 0, 0)] # Remove all tags