Add reference to production record name
issue8891 review278491004
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Add reference to production record name
|
||||
* Add cron task to update production cost
|
||||
* Allocate cost based on list price of each product
|
||||
|
||||
|
||||
+21
-1
@@ -19,7 +19,6 @@ BOM_CHANGES = ['bom', 'product', 'quantity', 'uom', 'warehouse', 'location',
|
||||
class Production(Workflow, ModelSQL, ModelView):
|
||||
"Production"
|
||||
__name__ = 'production'
|
||||
_rec_name = 'number'
|
||||
|
||||
number = fields.Char('Number', select=True, readonly=True)
|
||||
reference = fields.Char('Reference', select=1,
|
||||
@@ -213,6 +212,27 @@ class Production(Workflow, ModelSQL, ModelView):
|
||||
'assign_force': {},
|
||||
})
|
||||
|
||||
def get_rec_name(self, name):
|
||||
items = []
|
||||
if self.number:
|
||||
items.append(self.number)
|
||||
if self.reference:
|
||||
items.append('[%s]' % self.reference)
|
||||
if not items:
|
||||
items.append('(%s)' % self.id)
|
||||
return ' '.join(items)
|
||||
|
||||
@classmethod
|
||||
def search_rec_name(cls, name, clause):
|
||||
if clause[1].startswith('!') or clause[1].startswith('not '):
|
||||
bool_op = 'AND'
|
||||
else:
|
||||
bool_op = 'OR'
|
||||
return [bool_op,
|
||||
('number',) + tuple(clause[1:]),
|
||||
('reference',) + tuple(clause[1:]),
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
table_h = cls.__table_handler__(module_name)
|
||||
|
||||
Reference in New Issue
Block a user