Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class InventoryLine(ModelSQL, ModelView):
- 'Stock Inventory Line'
- __name__ = 'stock.inventory.line'
- product_code = fields.Function(
- fields.Char('Code',
- order_field='("product_product".code IS NULL) %(order)s, "product_product".code %(order)s'),
- 'get_product_code',
- searcher='search_product_code')
- @classmethod
- def search_product_code(cls, name, clause):
- return [('product.code',) + tuple(clause[1:])]
- def get_product_code(self,name=''):
- return self.product.code
RAW Paste Data