Skip to content

Commit

Permalink
Better use of the new API
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis de Lattre committed Jan 7, 2015
1 parent d4e60a7 commit 3d10a42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stock_packaging_usability_ul/wizard/stock_select_ul.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
class StockSelectUL(models.TransientModel):
_name = 'stock.select.ul'
_description = 'Select UL'
_rec_name = 'ul_id'

ul_id = fields.Many2one('product.ul', string='Logistic Unit')
# required=False, because we accept that it can be left empty

@api.multi
def validate(self):
assert len(self) == 1, 'Only 1 record'
self.ensure_one()
ul = self[0].ul_id
assert self.env.context.get('pack_function') is not None, \
'missing context key pack_function'
Expand Down

0 comments on commit 3d10a42

Please sign in to comment.