feat(configurator): A3 - add Express x_fc_* flags to sale.order.line
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Express Orders — Task A3 schema tests
|
||||
from odoo.tests.common import TransactionCase, tagged
|
||||
|
||||
|
||||
@tagged('post_install', '-at_install', 'fp_express')
|
||||
class TestExpressSoLineFields(TransactionCase):
|
||||
def test_new_fields_exist(self):
|
||||
Line = self.env['sale.order.line']
|
||||
self.assertIn('x_fc_customer_line_ref', Line._fields)
|
||||
self.assertIn('x_fc_masking_enabled', Line._fields)
|
||||
self.assertIn('x_fc_bake_instructions', Line._fields)
|
||||
|
||||
def test_masking_default_true(self):
|
||||
partner = self.env['res.partner'].create({'name': 'C'})
|
||||
product = self.env['product.product'].search(
|
||||
[('default_code', '=', 'FP-SERVICE')], limit=1
|
||||
) or self.env['product.product'].create({
|
||||
'name': 'svc', 'type': 'service', 'default_code': 'FP-SERVICE',
|
||||
})
|
||||
so = self.env['sale.order'].create({
|
||||
'partner_id': partner.id,
|
||||
'order_line': [(0, 0, {'product_id': product.id, 'product_uom_qty': 1})],
|
||||
})
|
||||
line = so.order_line[:1]
|
||||
self.assertTrue(line.x_fc_masking_enabled)
|
||||
self.assertFalse(line.x_fc_customer_line_ref)
|
||||
self.assertFalse(line.x_fc_bake_instructions)
|
||||
Reference in New Issue
Block a user