Fix usage of context company
Default value of company should be -1 to get the right cast and an impossible value. Replace False by None as other value in "in" clause. issue3394 review1119002
This commit is contained in:
1 parent
3047f9f333
commit
54cdc49ab6
1 file changed
+12
-11
+12
-11
@@ -17,7 +17,7 @@ class Category:
|
||||
account_stock = fields.Property(fields.Many2One('account.account',
|
||||
'Account Stock', domain=[
|
||||
('kind', '=', 'stock'),
|
||||
('company', '=', Eval('context', {}).get('company', 0)),
|
||||
('company', '=', Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
states={
|
||||
'invisible': (~Eval('context', {}).get('company')
|
||||
@@ -27,7 +27,7 @@ class Category:
|
||||
account_stock_supplier = fields.Property(fields.Many2One('account.account',
|
||||
'Account Stock Supplier', domain=[
|
||||
('kind', '=', 'stock'),
|
||||
('company', '=', Eval('context', {}).get('company', 0)),
|
||||
('company', '=', Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
states={
|
||||
'invisible': (~Eval('context', {}).get('company')
|
||||
@@ -37,7 +37,7 @@ class Category:
|
||||
account_stock_customer = fields.Property(fields.Many2One('account.account',
|
||||
'Account Stock Customer', domain=[
|
||||
('kind', '=', 'stock'),
|
||||
('company', '=', Eval('context', {}).get('company', 0)),
|
||||
('company', '=', Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
states={
|
||||
'invisible': (~Eval('context', {}).get('company')
|
||||
@@ -48,7 +48,7 @@ class Category:
|
||||
fields.Many2One('account.account',
|
||||
'Account Stock Production', domain=[
|
||||
('kind', '=', 'stock'),
|
||||
('company', '=', Eval('context', {}).get('company', 0)),
|
||||
('company', '=', Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
states={
|
||||
'invisible': (~Eval('context', {}).get('company')
|
||||
@@ -58,7 +58,7 @@ class Category:
|
||||
account_stock_lost_found = fields.Property(fields.Many2One(
|
||||
'account.account', 'Account Stock Lost and Found', domain=[
|
||||
('kind', '=', 'stock'),
|
||||
('company', '=', Eval('context', {}).get('company', 0)),
|
||||
('company', '=', Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
states={
|
||||
'invisible': (~Eval('context', {}).get('company')
|
||||
@@ -83,7 +83,7 @@ class Template:
|
||||
'Account Stock',
|
||||
domain=[
|
||||
('kind', '=', 'stock'),
|
||||
('company', '=', Eval('context', {}).get('company', 0)),
|
||||
('company', '=', Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
states={
|
||||
'invisible': (~Eval('context', {}).get('company')
|
||||
@@ -99,7 +99,7 @@ class Template:
|
||||
'Account Stock Supplier',
|
||||
domain=[
|
||||
('kind', '=', 'stock'),
|
||||
('company', '=', Eval('context', {}).get('company', 0)),
|
||||
('company', '=', Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
states={
|
||||
'invisible': (~Eval('context', {}).get('company')
|
||||
@@ -115,7 +115,7 @@ class Template:
|
||||
'Account Stock Customer',
|
||||
domain=[
|
||||
('kind', '=', 'stock'),
|
||||
('company', '=', Eval('context', {}).get('company', 0)),
|
||||
('company', '=', Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
states={
|
||||
'invisible': (~Eval('context', {}).get('company')
|
||||
@@ -132,7 +132,7 @@ class Template:
|
||||
'Account Stock Production',
|
||||
domain=[
|
||||
('kind', '=', 'stock'),
|
||||
('company', '=', Eval('context', {}).get('company', 0)),
|
||||
('company', '=', Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
states={
|
||||
'invisible': (~Eval('context', {}).get('company')
|
||||
@@ -148,7 +148,7 @@ class Template:
|
||||
'account.account', 'Account Stock Lost and Found',
|
||||
domain=[
|
||||
('kind', '=', 'stock'),
|
||||
('company', '=', Eval('context', {}).get('company', 0)),
|
||||
('company', '=', Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
states={
|
||||
'invisible': (~Eval('context', {}).get('company')
|
||||
@@ -201,7 +201,8 @@ class UpdateCostPriceShowMove(ModelView):
|
||||
readonly=True)
|
||||
counterpart = fields.Many2One('account.account', 'Counterpart',
|
||||
domain=[
|
||||
('company', 'in', [Get(Eval('context', {}), 'company'), False]),
|
||||
('company', 'in',
|
||||
[Eval('context', {}).get('company', -1), None]),
|
||||
('id', '!=', Eval('stock_account')),
|
||||
],
|
||||
depends=['stock_account'], required=True)
|
||||
|
||||
Reference in new issue
Block a user