feat(configurator): A5 - wizard schema (rename notes, add Express fields, retire manual currency_id)
This commit is contained in:
@@ -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
|
||||
@@ -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'))
|
||||
Reference in New Issue
Block a user