Fix company context domain when company is not in context
This commit is contained in:
1 parent
f4d71b8f29
commit
06e2a482bd
2 files changed
+5
-2
No files matched your search
+2
-1
@@ -45,7 +45,8 @@ class OrderPoint(ModelSQL, ModelView):
|
||||
max_quantity = fields.Float('Maximal Quantity', required=True,
|
||||
digits="(16, unit_digits)", depends=['unit_digits'])
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
domain=["('id', '=', context.get('company', 0))"])
|
||||
domain=["('id', 'company' in context and '=' or '!=', " \
|
||||
"context.get('company', 0))"])
|
||||
unit = fields.Function('get_unit', type='many2one', relation='product.uom',
|
||||
string='Unit')
|
||||
unit_digits = fields.Function('get_unit_digits', type='integer',
|
||||
|
||||
+3
-1
@@ -30,7 +30,9 @@ class PurchaseRequest(ModelSQL, ModelView):
|
||||
'get_purchase', type='many2one', relation='purchase.purchase',
|
||||
string='Purchase')
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
readonly=True, domain=["('id', '=', context.get('company', 0))"])
|
||||
readonly=True, domain=[
|
||||
"('id', 'company' in context and '=' or '!=', " \
|
||||
"context.get('company', 0))"])
|
||||
origin = fields.Reference('Origin', selection='origin_get', readonly=True,
|
||||
required=True)
|
||||
state = fields.Function(
|
||||
|
||||
Reference in new issue
Block a user