Skip to content

Commit

Permalink
[FIX]stock_picking_customer_ref : use globle variable cls.SaleOrderOb…
Browse files Browse the repository at this point in the history
…j in test, remove attrs from client_order_ref on form view
  • Loading branch information
bizzappdev committed Jan 30, 2019
1 parent ab47af3 commit 616dc4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ class TestStockPickingCustomerRef(common.SavepointCase):
@classmethod
def setUpClass(cls):
super(TestStockPickingCustomerRef, cls).setUpClass()
cls.SaleOrderObj = cls.env['sale.order']

cls.product = cls.env['product.product'].create({
'name': 'Test stuff',
})
cls.partner = cls.env['res.partner'].create({
'name': 'Mr. Odoo',
})
cls.sale_order = cls.env['sale.order'].create({
cls.sale_order = cls.SaleOrderObj.create({
'partner_id': cls.partner.id,
'order_line': [(0, 0, {'product_id': cls.product.id})],
})
Expand All @@ -38,7 +40,7 @@ def test_stock_picking_customer_ref(self):
'Order ref of picking not equal to client order ref in sale')

def test_stock_picking_customer_ref_on_sale_creation(self):
sale_order = self.env['sale.order'].create({
sale_order = self.SaleOrderObj.create({
'partner_id': self.partner.id,
'client_order_ref': 'CREATE123456',
'order_line': [(0, 0, {'product_id': self.product.id})],
Expand Down
4 changes: 1 addition & 3 deletions stock_picking_customer_ref/views/stock_picking_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<field name="group_id" position="after">
<field name="client_order_ref"
attrs="{'invisible':
[('client_order_ref', '=', False)]}" />
<field name="client_order_ref"/>
</field>
</field>
</record>
Expand Down

0 comments on commit 616dc4d

Please sign in to comment.