Remove contextual domain on company
issue10302 review338141004
This commit is contained in:
1 parent
0562d880c8
commit
19b99941e1
3 files changed
+15
-36
No files matched your search
@@ -245,14 +245,11 @@ class Move(Workflow, ModelSQL, ModelView):
|
||||
('cancelled', 'Cancelled'),
|
||||
], 'State', select=True, readonly=True,
|
||||
help="The current state of the stock move.")
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
company = fields.Many2One(
|
||||
'company.company', "Company", required=True,
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
},
|
||||
domain=[
|
||||
('id', If(Eval('context', {}).contains('company'), '=', '!='),
|
||||
Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
depends=['state'],
|
||||
help="The company the stock move is associated with.")
|
||||
unit_price = fields.Numeric('Unit Price', digits=price_digits,
|
||||
|
||||
@@ -6,7 +6,7 @@ from sql import Literal, For
|
||||
|
||||
from trytond.i18n import gettext
|
||||
from trytond.model import Workflow, ModelView, ModelSQL, fields
|
||||
from trytond.pyson import Eval, If
|
||||
from trytond.pyson import Eval
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool
|
||||
from trytond.tools import grouped_slice
|
||||
@@ -21,11 +21,8 @@ class Period(Workflow, ModelSQL, ModelView):
|
||||
'readonly': Eval('state') == 'closed',
|
||||
}, depends=['state'],
|
||||
help="When the stock period ends.")
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
domain=[
|
||||
('id', If(Eval('context', {}).contains('company'), '=', '!='),
|
||||
Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
company = fields.Many2One(
|
||||
'company.company', "Company", required=True,
|
||||
help="The company the stock period is associated with.")
|
||||
caches = fields.One2Many('stock.period.cache', 'period', 'Caches',
|
||||
readonly=True)
|
||||
|
||||
+10
-25
@@ -128,14 +128,11 @@ class ShipmentIn(ShipmentMixin, Workflow, ModelSQL, ModelView):
|
||||
'readonly': Eval('state') != 'draft',
|
||||
}, depends=['state'],
|
||||
help="When the stock is expected to be received.")
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
company = fields.Many2One(
|
||||
'company.company', "Company", required=True,
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
},
|
||||
domain=[
|
||||
('id', If(Eval('context', {}).contains('company'), '=', '!='),
|
||||
Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
depends=['state'],
|
||||
help="The company the shipment is associated with.")
|
||||
reference = fields.Char("Reference", size=None, select=True,
|
||||
@@ -576,14 +573,11 @@ class ShipmentInReturn(ShipmentAssignMixin, Workflow, ModelSQL, ModelView):
|
||||
'readonly': Eval('state') != 'draft',
|
||||
}, depends=['state'],
|
||||
help="When the stock is expected to be returned.")
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
company = fields.Many2One(
|
||||
'company.company', "Company", required=True,
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
},
|
||||
domain=[
|
||||
('id', If(Eval('context', {}).contains('company'), '=', '!='),
|
||||
Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
depends=['state'],
|
||||
help="The company the shipment is associated with.")
|
||||
number = fields.Char('Number', size=None, select=True, readonly=True,
|
||||
@@ -944,14 +938,11 @@ class ShipmentOut(ShipmentAssignMixin, Workflow, ModelSQL, ModelView):
|
||||
'readonly': Eval('state') != 'draft',
|
||||
}, depends=['state'],
|
||||
help="When the stock is expected to be sent.")
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
company = fields.Many2One(
|
||||
'company.company', "Company", required=True,
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
},
|
||||
domain=[
|
||||
('id', If(Eval('context', {}).contains('company'), '=', '!='),
|
||||
Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
depends=['state'],
|
||||
help="The company the shipment is associated with.")
|
||||
customer = fields.Many2One('party.party', 'Customer', required=True,
|
||||
@@ -1592,14 +1583,11 @@ class ShipmentOutReturn(ShipmentMixin, Workflow, ModelSQL, ModelView):
|
||||
'readonly': Eval('state') != 'draft',
|
||||
}, depends=['state'],
|
||||
help="When the stock is expected to be returned.")
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
company = fields.Many2One(
|
||||
'company.company', "Company", required=True,
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
},
|
||||
domain=[
|
||||
('id', If(Eval('context', {}).contains('company'), '=', '!='),
|
||||
Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
depends=['state'],
|
||||
help="The company the shipment is associated with.")
|
||||
customer = fields.Many2One('party.party', 'Customer', required=True,
|
||||
@@ -2029,14 +2017,11 @@ class ShipmentInternal(ShipmentAssignMixin, Workflow, ModelSQL, ModelView):
|
||||
},
|
||||
depends=['state'],
|
||||
help="When the stock is expected to be sent.")
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
company = fields.Many2One(
|
||||
'company.company', "Company", required=True,
|
||||
states={
|
||||
'readonly': ~Eval('state').in_(['request', 'draft']),
|
||||
},
|
||||
domain=[
|
||||
('id', If(Eval('context', {}).contains('company'), '=', '!='),
|
||||
Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
depends=['state'],
|
||||
help="The company the shipment is associated with.")
|
||||
number = fields.Char('Number', size=None, select=True, readonly=True,
|
||||
|
||||
Reference in new issue
Block a user