feat(configurator): fp.additional.charge.type model + config menu + seed

This commit is contained in:
gsinghpal
2026-05-29 21:32:49 -04:00
parent 7efaadc1c1
commit c6022c70f9
8 changed files with 103 additions and 1 deletions

View File

@@ -8,3 +8,4 @@ from . import test_express_so_line_fields
from . import test_express_sale_order_fields
from . import test_express_wizard_fields
from . import test_part_description_history
from . import test_charge_tax_lot

View File

@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# License OPL-1 (Odoo Proprietary License v1.0)
"""Configurable charge + order-level tax + lot pricing (spec 2026-05-29)."""
from odoo.tests.common import TransactionCase, tagged
@tagged('post_install', '-at_install', 'fp_charge_tax_lot')
class TestChargeTaxLot(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.partner = cls.env['res.partner'].create({'name': 'ChargeCust'})
cls.tax13 = cls.env['account.tax'].create({
'name': 'FP Test 13%',
'amount': 13.0,
'amount_type': 'percent',
'type_tax_use': 'sale',
})
# ----- Task 1: charge type model -----
def test_charge_type_quick_create_and_default(self):
ct = self.env['fp.additional.charge.type'].create({
'name': 'Rush Fee', 'default_amount': 75.0,
})
self.assertEqual(ct.name, 'Rush Fee')
self.assertEqual(ct.default_amount, 75.0)
cid, cname = self.env['fp.additional.charge.type'].name_create('Setup')
self.assertTrue(cid)