feat(configurator): A5 - wizard schema (rename notes, add Express fields, retire manual currency_id)

This commit is contained in:
gsinghpal
2026-05-26 20:58:23 -04:00
parent 08bc2b6a89
commit 92b690aef1
6 changed files with 204 additions and 8 deletions

View File

@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-
# Copyright 2026 Nexa Systems Inc.
# Part of the Fusion Plating product family.
from . import test_express_part_defaults
from . import test_express_line_fields
from . import test_express_so_line_fields
from . import test_express_sale_order_fields
from . import test_express_wizard_fields

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# Express Orders — Task A5 schema tests
from odoo.tests.common import TransactionCase, tagged
@tagged('post_install', '-at_install', 'fp_express')
class TestExpressWizardFields(TransactionCase):
def test_new_fields_exist(self):
Wiz = self.env['fp.direct.order.wizard']
for fname in (
'material_process', 'pricelist_id', 'validity_date',
'internal_notes', 'terms_and_conditions', 'view_source',
):
self.assertIn(fname, Wiz._fields, msg=f'Missing field: {fname}')
def test_old_notes_retired(self):
Wiz = self.env['fp.direct.order.wizard']
# `notes` was renamed to terms_and_conditions in the pre-migration.
self.assertNotIn('notes', Wiz._fields)
def test_view_source_default_express(self):
partner = self.env['res.partner'].create({'name': 'C'})
wiz = self.env['fp.direct.order.wizard'].create({'partner_id': partner.id})
self.assertEqual(wiz.view_source, 'express')
def test_currency_id_is_related_from_pricelist(self):
Wiz = self.env['fp.direct.order.wizard']
currency_field = Wiz._fields.get('currency_id')
self.assertIsNotNone(currency_field)
# Stored related from pricelist_id.currency_id
self.assertEqual(currency_field.related, ('pricelist_id', 'currency_id'))