feat(configurator): wizard charge_type_id + charge_amount + order-level tax_id
This commit is contained in:
@@ -316,6 +316,25 @@ class FpDirectOrderWizard(models.Model):
|
||||
'Carried to the SO and appears as a separate line on the '
|
||||
'customer invoice.',
|
||||
)
|
||||
charge_type_id = fields.Many2one(
|
||||
'fp.additional.charge.type', string='Additional Charge',
|
||||
)
|
||||
charge_amount = fields.Monetary(
|
||||
string='Charge Amount', currency_field='currency_id',
|
||||
)
|
||||
tax_id = fields.Many2one(
|
||||
'account.tax', string='Tax',
|
||||
domain="[('type_tax_use', '=', 'sale')]",
|
||||
default=lambda self: self.env.company.account_sale_tax_id,
|
||||
help='One tax applied to (subtotal + additional charge). Every '
|
||||
'line + the charge line gets this tax on the created order.',
|
||||
)
|
||||
|
||||
@api.onchange('charge_type_id')
|
||||
def _onchange_charge_type_id(self):
|
||||
for rec in self:
|
||||
if rec.charge_type_id and not rec.charge_amount:
|
||||
rec.charge_amount = rec.charge_type_id.default_amount
|
||||
|
||||
# ---- PO status pill (computed, display-only) ----
|
||||
po_status = fields.Selection(
|
||||
|
||||
Reference in New Issue
Block a user