Allow to search on default UoM of stock lot
Since e49aaf8553e1, default UoM of "Lots by Locations" has a searcher using the default UoM of the stock lot. Closes #12583
This commit is contained in:
1 parent
420e0a48d6
commit
ce75be407a
1 file changed
+6
-1
@@ -90,7 +90,7 @@ class Lot(DeactivableMixin, ModelSQL, ModelView, LotMixin, StockMixin):
|
||||
fields.Many2One(
|
||||
'product.uom', "Default UoM",
|
||||
help="The default Unit of Measure."),
|
||||
'on_change_with_default_uom')
|
||||
'on_change_with_default_uom', searcher='search_default_uom')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
@@ -129,6 +129,11 @@ class Lot(DeactivableMixin, ModelSQL, ModelView, LotMixin, StockMixin):
|
||||
def on_change_with_default_uom(self, name=None):
|
||||
return self.product.default_uom if self.product else None
|
||||
|
||||
@classmethod
|
||||
def search_default_uom(cls, name, clause):
|
||||
nested = clause[0][len(name):]
|
||||
return [('product.' + name + nested, *clause[1:])]
|
||||
|
||||
@classmethod
|
||||
def copy(cls, lots, default=None):
|
||||
default = default.copy() if default else {}
|
||||
|
||||
Reference in new issue
Block a user