Add help text

issue6401
review34861002
This commit is contained in:
David Harper committed 2018-12-04 12:25:45 +01:00
1 parent 194cf8f97b
commit 93f3022413
7 files changed
+258 -132

No files matched your search

+19 -7
View File
@@ -17,7 +17,9 @@ shipment_internal_transit = fields.Many2One(
'stock.location', "Internal Shipment Transit", required=True,
domain=[
('type', '=', 'storage'),
])
],
help="The default location used for stock that is in transit between "
"warehouses.")
def default_func(field_name):
@@ -51,42 +53,52 @@ class Configuration(
('company', 'in',
[Eval('context', {}).get('company', -1), None]),
('code', '=', 'stock.shipment.in'),
]))
],
help="Used to generate the number given to supplier shipments."))
shipment_in_return_sequence = fields.MultiValue(fields.Many2One(
'ir.sequence', "Supplier Return Shipment Sequence", required=True,
domain=[
('company', 'in',
[Eval('context', {}).get('company', -1), None]),
('code', '=', 'stock.shipment.in.return'),
]))
],
help="Used to generate the number given to supplier return "
"shipments."))
shipment_out_sequence = fields.MultiValue(fields.Many2One(
'ir.sequence', "Customer Shipment Sequence", required=True,
domain=[
('company', 'in',
[Eval('context', {}).get('company', -1), None]),
('code', '=', 'stock.shipment.out'),
]))
],
help="Used to generate the number given to customer "
"shipments."))
shipment_out_return_sequence = fields.MultiValue(fields.Many2One(
'ir.sequence', "Customer Return Shipment Sequence", required=True,
domain=[
('company', 'in',
[Eval('context', {}).get('company', -1), None]),
('code', '=', 'stock.shipment.out.return'),
]))
],
help="Used to generate the number given to customer return "
"shipments."))
shipment_internal_sequence = fields.MultiValue(fields.Many2One(
'ir.sequence', "Internal Shipment Sequence", required=True,
domain=[
('company', 'in',
[Eval('context', {}).get('company', -1), None]),
('code', '=', 'stock.shipment.internal'),
]))
],
help="Used to generate the number given to internal "
"shipments."))
inventory_sequence = fields.MultiValue(fields.Many2One(
'ir.sequence', "Inventory Sequence", required=True,
domain=[
('company', 'in',
[Eval('context', {}).get('company', -1), None]),
('code', '=', 'stock.inventory'),
]))
],
help="Used to generate the number given to inventories."))
shipment_internal_transit = fields.MultiValue(shipment_internal_transit)
@classmethod
+29 -14
View File
@@ -26,20 +26,25 @@ class Inventory(Workflow, ModelSQL, ModelView):
'Stock Inventory'
__name__ = 'stock.inventory'
_rec_name = 'number'
number = fields.Char('Number', readonly=True)
number = fields.Char('Number', readonly=True,
help="The main identifier for the inventory.")
location = fields.Many2One(
'stock.location', 'Location', required=True,
domain=[('type', '=', 'storage')], states={
'readonly': (Eval('state') != 'draft') | Eval('lines', [0]),
},
depends=['state'])
depends=['state'],
help="The location inventoried.")
date = fields.Date('Date', required=True, states={
'readonly': (Eval('state') != 'draft') | Eval('lines', [0]),
},
depends=['state'])
depends=['state'],
help="The date of the stock count.")
lost_found = fields.Many2One(
'stock.location', 'Lost and Found', required=True,
domain=[('type', '=', 'lost_found')], states=STATES, depends=DEPENDS)
domain=[('type', '=', 'lost_found')], states=STATES, depends=DEPENDS,
help="Used for the balancing entries needed when the stock is "
"corrected.")
lines = fields.One2Many(
'stock.inventory.line', 'inventory', 'Lines',
states={
@@ -57,9 +62,11 @@ class Inventory(Workflow, ModelSQL, ModelView):
states={
'readonly': (Eval('state') != 'draft') | Eval('lines', [0]),
},
depends=['state'])
depends=['state'],
help="The company the inventory is associated with.")
state = fields.Selection(
INVENTORY_STATES, 'State', readonly=True, select=True)
INVENTORY_STATES, 'State', readonly=True, select=True,
help="The current state of the inventory.")
@classmethod
def __setup__(cls):
@@ -290,7 +297,8 @@ class InventoryLine(ModelSQL, ModelView):
('type', '=', 'goods'),
('consumable', '=', False),
], states=_states, depends=_depends)
uom = fields.Function(fields.Many2One('product.uom', 'UOM'), 'get_uom')
uom = fields.Function(fields.Many2One('product.uom', 'UOM',
help="The unit in which the quantity is specified."), 'get_uom')
unit_digits = fields.Function(fields.Integer('Unit Digits'),
'get_unit_digits')
expected_quantity = fields.Float('Expected Quantity', required=True,
@@ -298,17 +306,20 @@ class InventoryLine(ModelSQL, ModelView):
states={
'invisible': Eval('id', -1) < 0,
},
depends=['unit_digits'])
depends=['unit_digits'],
help="The quantity the system calculated should be in the location.")
quantity = fields.Float('Quantity',
digits=(16, Eval('unit_digits', 2)),
states=_states, depends=['unit_digits'] + _depends)
states=_states, depends=['unit_digits'] + _depends,
help="The actual quantity found in the location.")
moves = fields.One2Many('stock.move', 'origin', 'Moves', readonly=True)
inventory = fields.Many2One('stock.inventory', 'Inventory', required=True,
ondelete='CASCADE',
states={
'readonly': _states['readonly'] & Bool(Eval('inventory')),
},
depends=_depends)
depends=_depends,
help="The inventory the line belongs to.")
inventory_state = fields.Function(
fields.Selection(INVENTORY_STATES, 'Inventory State'),
'on_change_with_inventory_state')
@@ -574,7 +585,8 @@ class CountSearch(ModelView):
('consumable', '=', False),
],
[])],
depends=['search_model'])
depends=['search_model'],
help="The item that's counted.")
search_model = fields.Function(fields.Selection(
'get_search_models', "Search Model"),
'on_change_with_search_model')
@@ -600,14 +612,17 @@ class CountQuantity(ModelView):
line = fields.Many2One(
'stock.inventory.line', "Line", readonly=True, required=True)
product = fields.Many2One('product.product', "Product", readonly=True)
uom = fields.Many2One('product.uom', "UOM", readonly=True)
uom = fields.Many2One('product.uom', "UOM", readonly=True,
help="The unit in which the quantities are specified.")
quantity_resulting = fields.Float(
"Resulting Quantity", digits=(16, Eval('unit_digits', 2)),
readonly=True, depends=['unit_digits'])
readonly=True, depends=['unit_digits'],
help="The total amount of the line counted so far.")
quantity_added = fields.Float(
"Added Quantity", digits=(16, Eval('unit_digits', 2)), required=True,
depends=['unit_digits'])
depends=['unit_digits'],
help="The quantity to add to the existing count.")
unit_digits = fields.Integer("Unit Digits", readonly=True)
+32 -20
View File
@@ -29,7 +29,8 @@ class Location(DeactivableMixin, tree(), ModelSQL, ModelView):
name = fields.Char("Name", size=None, required=True, states=STATES,
depends=DEPENDS, translate=True)
code = fields.Char("Code", size=None, states=STATES, depends=DEPENDS,
select=True)
select=True,
help="The internal identifier used for the location.")
address = fields.Many2One("party.address", "Address",
states={
'invisible': Eval('type') != 'warehouse',
@@ -51,13 +52,16 @@ class Location(DeactivableMixin, tree(), ModelSQL, ModelView):
states={
'invisible': Eval('type') == 'warehouse',
},
depends=['type'])
depends=['type'],
help="Used to add structure above the location.")
left = fields.Integer('Left', required=True, select=True)
right = fields.Integer('Right', required=True, select=True)
childs = fields.One2Many("stock.location", "parent", "Children")
childs = fields.One2Many("stock.location", "parent", "Children",
help="Used to add structure below the location.")
flat_childs = fields.Boolean(
"Flat Children",
help="Check to restrict to one level of children.")
help="Check to enforce a single level of children with no "
"grandchildren.")
warehouse = fields.Function(fields.Many2One('stock.location', 'Warehouse'),
'get_warehouse')
input_location = fields.Many2One(
@@ -73,7 +77,8 @@ class Location(DeactivableMixin, tree(), ModelSQL, ModelView):
('parent', '=', None),
],
],
depends=['type', 'active', 'id'])
depends=['type', 'active', 'id'],
help="Where incoming stock is received.")
output_location = fields.Many2One(
"stock.location", "Output", states={
'invisible': Eval('type') != 'warehouse',
@@ -85,7 +90,8 @@ class Location(DeactivableMixin, tree(), ModelSQL, ModelView):
['OR',
('parent', 'child_of', [Eval('id')]),
('parent', '=', None)]],
depends=['type', 'active', 'id'])
depends=['type', 'active', 'id'],
help="Where outgoing stock is sent from.")
storage_location = fields.Many2One(
"stock.location", "Storage", states={
'invisible': Eval('type') != 'warehouse',
@@ -97,7 +103,8 @@ class Location(DeactivableMixin, tree(), ModelSQL, ModelView):
['OR',
('parent', 'child_of', [Eval('id')]),
('parent', '=', None)]],
depends=['type', 'active', 'id'])
depends=['type', 'active', 'id'],
help="The top level location where stock is stored.")
picking_location = fields.Many2One(
'stock.location', 'Picking', states={
'invisible': Eval('type') != 'warehouse',
@@ -108,13 +115,18 @@ class Location(DeactivableMixin, tree(), ModelSQL, ModelView):
('parent', 'child_of', [Eval('storage_location', -1)]),
],
depends=['type', 'active', 'storage_location'],
help='If empty the Storage is used')
help="Where stock is picked from.\n"
"Leave empty to use the storage location.")
quantity = fields.Function(
fields.Float('Quantity'), 'get_quantity', searcher='search_quantity')
fields.Float('Quantity',
help="The amount of stock in the location."),
'get_quantity', searcher='search_quantity')
forecast_quantity = fields.Function(
fields.Float('Forecast Quantity'), 'get_quantity',
searcher='search_quantity')
cost_value = fields.Function(fields.Numeric('Cost Value'),
fields.Float('Forecast Quantity',
help="The amount of stock expected to be in the location."),
'get_quantity', searcher='search_quantity')
cost_value = fields.Function(fields.Numeric('Cost Value',
help="The value of the stock in the location."),
'get_cost_value')
@classmethod
@@ -512,11 +524,10 @@ class Location(DeactivableMixin, tree(), ModelSQL, ModelView):
supplier_location = fields.Many2One(
'stock.location', "Supplier Location", domain=[('type', '=', 'supplier')],
help='The default source location when receiving products from the party.')
help="The default source location for stock received from the party.")
customer_location = fields.Many2One(
'stock.location', "Customer Location", domain=[('type', '=', 'customer')],
help='The default destination location when sending products to the party.'
)
help="The default destination location for stock sent to the party.")
class Party(metaclass=PoolMeta):
@@ -593,10 +604,10 @@ class ProductsByLocationsContext(ModelView):
'Products by Locations'
__name__ = 'stock.products_by_locations.context'
forecast_date = fields.Date(
'At Date', help=('Allow to compute expected '
'stock quantities for this date.\n'
'* An empty value is an infinite date in the future.\n'
'* A date in the past will provide historical values.'))
'At Date',
help="The date for which the stock quantity is calculated.\n"
"* An empty value calculates as far ahead as possible.\n"
"* A date in the past will provide historical values.")
stock_date_end = fields.Function(fields.Date('At Date'),
'on_change_with_stock_date_end')
@@ -626,7 +637,8 @@ class LocationLeadTime(sequence_ordered(), ModelSQL, ModelView, MatchMixin):
domain=[
('type', '=', 'warehouse'),
])
lead_time = fields.TimeDelta('Lead Time')
lead_time = fields.TimeDelta('Lead Time',
help="The time it takes to move stock between the warehouses.")
@classmethod
def get_lead_time(cls, pattern):
+24 -12
View File
@@ -161,7 +161,8 @@ class Move(Workflow, ModelSQL, ModelView):
('default_uom_category', '=', Eval('product_uom_category')),
())
],
depends=DEPENDS + ['product_uom_category'])
depends=DEPENDS + ['product_uom_category'],
help="The product that the move is associated with.")
product_uom_category = fields.Function(
fields.Many2One('product.uom.category', 'Product Uom Category'),
'on_change_with_product_uom_category')
@@ -169,46 +170,55 @@ class Move(Workflow, ModelSQL, ModelView):
domain=[
('category', '=', Eval('product_uom_category')),
],
depends=['state', 'product_uom_category'])
depends=['state', 'product_uom_category'],
help="The unit in which the quantity is specified.")
unit_digits = fields.Function(fields.Integer('Unit Digits'),
'on_change_with_unit_digits')
quantity = fields.Float("Quantity", required=True,
digits=(16, Eval('unit_digits', 2)), states=STATES,
depends=['state', 'unit_digits'])
depends=['state', 'unit_digits'],
help="The amount of stock moved.")
internal_quantity = fields.Float('Internal Quantity', readonly=True,
required=True)
from_location = fields.Many2One("stock.location", "From Location",
select=True, required=True, states=STATES,
depends=DEPENDS + LOCATION_DEPENDS, domain=LOCATION_DOMAIN)
depends=DEPENDS + LOCATION_DEPENDS, domain=LOCATION_DOMAIN,
help="Where the stock is moved from.")
to_location = fields.Many2One("stock.location", "To Location", select=True,
required=True, states=STATES,
depends=DEPENDS + LOCATION_DEPENDS, domain=LOCATION_DOMAIN)
depends=DEPENDS + LOCATION_DEPENDS, domain=LOCATION_DOMAIN,
help="Where the stock is moved to.")
shipment = fields.Reference('Shipment', selection='get_shipment',
readonly=True, select=True)
readonly=True, select=True,
help="Used to group several stock moves together.")
origin = fields.Reference('Origin', selection='get_origin', select=True,
states={
'readonly': Eval('state') != 'draft',
},
depends=['state'])
depends=['state'],
help="The source of the stock move.")
planned_date = fields.Date("Planned Date", states={
'readonly': (Eval('state').in_(['cancel', 'assigned', 'done'])
| Eval('shipment'))
}, depends=['state', 'shipment'],
select=True)
select=True,
help="When the stock is expected to be moved.")
effective_date = fields.Date("Effective Date", select=True,
states={
'required': Eval('state') == 'done',
'readonly': (Eval('state').in_(['cancel', 'done'])
| Eval('shipment')),
},
depends=['state', 'shipment'])
depends=['state', 'shipment'],
help="When the stock was actually moved.")
state = fields.Selection([
('staging', 'Staging'),
('draft', 'Draft'),
('assigned', 'Assigned'),
('done', 'Done'),
('cancel', 'Canceled'),
], 'State', select=True, readonly=True)
], 'State', select=True, readonly=True,
help="The current state of the stock move.")
company = fields.Many2One('company.company', 'Company', required=True,
states={
'readonly': Eval('state') != 'draft',
@@ -217,7 +227,8 @@ class Move(Workflow, ModelSQL, ModelView):
('id', If(Eval('context', {}).contains('company'), '=', '!='),
Eval('context', {}).get('company', -1)),
],
depends=['state'])
depends=['state'],
help="The company the stock move is associated with.")
unit_price = fields.Numeric('Unit Price', digits=price_digits,
states={
'invisible': ~Eval('unit_price_required'),
@@ -233,7 +244,8 @@ class Move(Workflow, ModelSQL, ModelView):
'required': Bool(Eval('unit_price_required')),
'readonly': Eval('state') != 'draft',
},
depends=['unit_price_required', 'state'])
depends=['unit_price_required', 'state'],
help="The currency in which the unit price is specified.")
unit_price_required = fields.Function(
fields.Boolean('Unit Price Required'),
'on_change_with_unit_price_required')
+6 -3
View File
@@ -18,18 +18,21 @@ class Period(Workflow, ModelSQL, ModelView):
__name__ = 'stock.period'
date = fields.Date('Date', required=True, states={
'readonly': Eval('state') == 'closed',
}, depends=['state'])
}, 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)),
])
],
help="The company the stock period is associated with.")
caches = fields.One2Many('stock.period.cache', 'period', 'Caches',
readonly=True)
state = fields.Selection([
('draft', 'Draft'),
('closed', 'Closed'),
], 'State', select=True, readonly=True)
], 'State', select=True, readonly=True,
help="The current state of the stock period.")
@classmethod
def __setup__(cls):
+22 -14
View File
@@ -65,10 +65,14 @@ def check_no_move(func):
class Template(metaclass=PoolMeta):
__name__ = "product.template"
quantity = fields.Function(fields.Float('Quantity'), 'sum_product')
forecast_quantity = fields.Function(fields.Float('Forecast Quantity'),
'sum_product')
cost_value = fields.Function(fields.Numeric('Cost Value'),
quantity = fields.Function(fields.Float('Quantity',
help="The amount of stock in the location."),
'sum_product')
forecast_quantity = fields.Function(fields.Float('Forecast Quantity',
help="The amount of stock expected to be in the location."),
'sum_product')
cost_value = fields.Function(fields.Numeric('Cost Value',
help="The value of the stock in the location."),
'sum_product')
def sum_product(self, name):
@@ -113,11 +117,14 @@ class Template(metaclass=PoolMeta):
class Product(StockMixin, object, metaclass=PoolMeta):
__name__ = "product.product"
quantity = fields.Function(fields.Float('Quantity'), 'get_quantity',
searcher='search_quantity')
forecast_quantity = fields.Function(fields.Float('Forecast Quantity'),
'get_quantity', searcher='search_quantity')
cost_value = fields.Function(fields.Numeric('Cost Value'),
quantity = fields.Function(fields.Float('Quantity',
help="The amount of stock in the location."),
'get_quantity', searcher='search_quantity')
forecast_quantity = fields.Function(fields.Float('Forecast Quantity',
help="The amount of stock expected to be in the location."),
'get_quantity', searcher='search_quantity')
cost_value = fields.Function(fields.Numeric('Cost Value',
help="The value of the stock in the location."),
'get_cost_value')
@classmethod
@@ -293,10 +300,10 @@ class ProductByLocationContext(ModelView):
'Product by Location'
__name__ = 'product.by_location.context'
forecast_date = fields.Date(
'At Date', help=('Allow to compute expected '
'stock quantities for this date.\n'
'* An empty value is an infinite date in the future.\n'
'* A date in the past will provide historical values.'))
'At Date',
help="The date for which the stock quantity is calculated.\n"
"* An empty value calculates as far ahead as possible.\n"
"* A date in the past will provide historical values.")
stock_date_end = fields.Function(fields.Date('At Date'),
'on_change_with_stock_date_end')
@@ -414,7 +421,8 @@ class ProductQuantitiesByWarehouseContext(ModelView):
warehouse = fields.Many2One('stock.location', 'Warehouse', required=True,
domain=[
('type', '=', 'warehouse'),
])
],
help="The warehouse for which the quantities will be calculated.")
@staticmethod
def default_warehouse():
+126 -62
View File
@@ -66,10 +66,12 @@ class ShipmentIn(Workflow, ModelSQL, ModelView):
states={
'readonly': Eval('state').in_(['cancel', 'done']),
},
depends=['state'])
depends=['state'],
help="When the stock was actually received.")
planned_date = fields.Date('Planned Date', states={
'readonly': Eval('state') != 'draft',
}, depends=['state'])
}, depends=['state'],
help="When the stock is expected to be received.")
company = fields.Many2One('company.company', 'Company', required=True,
states={
'readonly': Eval('state') != 'draft',
@@ -78,18 +80,21 @@ class ShipmentIn(Workflow, ModelSQL, ModelView):
('id', If(Eval('context', {}).contains('company'), '=', '!='),
Eval('context', {}).get('company', -1)),
],
depends=['state'])
depends=['state'],
help="The company the shipment is associated with.")
reference = fields.Char("Reference", size=None, select=True,
states={
'readonly': Eval('state') != 'draft',
}, depends=['state'])
}, depends=['state'],
help="The supplier's identifier for the shipment.")
supplier = fields.Many2One('party.party', 'Supplier',
states={
'readonly': (((Eval('state') != 'draft')
| Eval('incoming_moves', [0]))
& Eval('supplier')),
}, required=True,
depends=['state', 'supplier'])
depends=['state', 'supplier'],
help="The party that supplied the stock.")
supplier_location = fields.Function(fields.Many2One('stock.location',
'Supplier Location'),
'on_change_with_supplier_location')
@@ -97,13 +102,15 @@ class ShipmentIn(Workflow, ModelSQL, ModelView):
states={
'readonly': Eval('state') != 'draft',
}, domain=[('party', '=', Eval('supplier'))],
depends=['state', 'supplier'])
depends=['state', 'supplier'],
help="The address at which the supplier can be contacted.")
warehouse = fields.Many2One('stock.location', "Warehouse",
required=True, domain=[('type', '=', 'warehouse')],
states={
'readonly': (Eval('state').in_(['cancel', 'done'])
| Eval('incoming_moves', [0]) | Eval('inventory_moves', [0])),
}, depends=['state'])
}, depends=['state'],
help="Where the stock is received.")
warehouse_input = fields.Function(fields.Many2One('stock.location',
'Warehouse Input'),
'on_change_with_warehouse_input')
@@ -134,7 +141,8 @@ class ShipmentIn(Workflow, ModelSQL, ModelView):
| ~Eval('warehouse') | ~Eval('supplier')),
},
depends=['state', 'warehouse', 'supplier_location',
'warehouse_input', 'warehouse_storage', 'company']),
'warehouse_input', 'warehouse_storage', 'company'],
help="The moves that bring the stock into the warehouse."),
'get_incoming_moves', setter='set_incoming_moves')
inventory_moves = fields.Function(fields.One2Many('stock.move', 'shipment',
'Inventory Moves',
@@ -152,13 +160,15 @@ class ShipmentIn(Workflow, ModelSQL, ModelView):
Eval('warehouse_input') == Eval('warehouse_storage')),
},
depends=['state', 'warehouse', 'warehouse_input',
'warehouse_storage', 'company']),
'warehouse_storage', 'company'],
help="The moves that put the stock away into the storage area."),
'get_inventory_moves', setter='set_inventory_moves')
moves = fields.One2Many('stock.move', 'shipment', 'Moves',
domain=[('company', '=', Eval('company'))], readonly=True,
depends=['company'])
origins = fields.Function(fields.Char('Origins'), 'get_origins')
number = fields.Char('Number', size=None, select=True, readonly=True)
number = fields.Char('Number', size=None, select=True, readonly=True,
help="The main identifier for the shipment.")
received_by = employee_field("Received By")
done_by = employee_field("Done By")
state = fields.Selection([
@@ -166,7 +176,8 @@ class ShipmentIn(Workflow, ModelSQL, ModelView):
('done', 'Done'),
('cancel', 'Canceled'),
('received', 'Received'),
], 'State', readonly=True)
], 'State', readonly=True,
help="The current state of the shipment.")
@classmethod
def __setup__(cls):
@@ -474,11 +485,13 @@ class ShipmentInReturn(Workflow, ModelSQL, ModelView):
states={
'readonly': Eval('state').in_(['cancel', 'done']),
},
depends=['state'])
depends=['state'],
help="When the stock was actually returned.")
planned_date = fields.Date('Planned Date',
states={
'readonly': Eval('state') != 'draft',
}, depends=['state'])
}, depends=['state'],
help="When the stock is expected to be returned.")
company = fields.Many2One('company.company', 'Company', required=True,
states={
'readonly': Eval('state') != 'draft',
@@ -487,19 +500,23 @@ class ShipmentInReturn(Workflow, ModelSQL, ModelView):
('id', If(Eval('context', {}).contains('company'), '=', '!='),
Eval('context', {}).get('company', -1)),
],
depends=['state'])
number = fields.Char('Number', size=None, select=True, readonly=True)
depends=['state'],
help="The company the shipment is associated with.")
number = fields.Char('Number', size=None, select=True, readonly=True,
help="The main identifier for the shipment.")
reference = fields.Char("Reference", size=None, select=True,
states={
'readonly': Eval('state') != 'draft',
}, depends=['state'])
}, depends=['state'],
help="The supplier's identifier for the shipment.")
supplier = fields.Many2One('party.party', 'Supplier',
states={
'readonly': (((Eval('state') != 'draft')
| Eval('moves', [0]))
& Eval('supplier', 0)),
}, required=True,
depends=['state', 'supplier'])
depends=['state', 'supplier'],
help="The party that supplied the stock.")
delivery_address = fields.Many2One('party.address', 'Delivery Address',
states={
'readonly': Eval('state') != 'draft',
@@ -507,17 +524,20 @@ class ShipmentInReturn(Workflow, ModelSQL, ModelView):
domain=[
('party', '=', Eval('supplier'))
],
depends=['state', 'supplier'])
depends=['state', 'supplier'],
help="Where the stock is sent to.")
from_location = fields.Many2One('stock.location', "From Location",
required=True, states={
'readonly': (Eval('state') != 'draft') | Eval('moves', [0]),
}, domain=[('type', 'in', ['storage', 'view'])],
depends=['state'])
depends=['state'],
help="Where the stock is moved from.")
to_location = fields.Many2One('stock.location', "To Location",
required=True, states={
'readonly': (Eval('state') != 'draft') | Eval('moves', [0]),
}, domain=[('type', '=', 'supplier')],
depends=['state'])
depends=['state'],
help="Where the stock is moved to.")
moves = fields.One2Many('stock.move', 'shipment', 'Moves',
states={
'readonly': (((Eval('state') != 'draft') | ~Eval('from_location'))
@@ -537,7 +557,8 @@ class ShipmentInReturn(Workflow, ModelSQL, ModelView):
[])),
('company', '=', Eval('company')),
],
depends=['state', 'from_location', 'to_location', 'company'])
depends=['state', 'from_location', 'to_location', 'company'],
help="The moves that return the stock to the supplier.")
origins = fields.Function(fields.Char('Origins'), 'get_origins')
assigned_by = employee_field("Assigned By")
done_by = employee_field("Done By")
@@ -547,7 +568,8 @@ class ShipmentInReturn(Workflow, ModelSQL, ModelView):
('assigned', 'Assigned'),
('waiting', 'Waiting'),
('done', 'Done'),
], 'State', readonly=True)
], 'State', readonly=True,
help="The current state of the shipment.")
@classmethod
def __setup__(cls):
@@ -791,11 +813,13 @@ class ShipmentOut(Workflow, ModelSQL, ModelView):
states={
'readonly': Eval('state').in_(['cancel', 'done']),
},
depends=['state'])
depends=['state'],
help="When the stock was actually sent.")
planned_date = fields.Date('Planned Date',
states={
'readonly': Eval('state') != 'draft',
}, depends=['state'])
}, depends=['state'],
help="When the stock is expected to be sent.")
company = fields.Many2One('company.company', 'Company', required=True,
states={
'readonly': Eval('state') != 'draft',
@@ -804,13 +828,15 @@ class ShipmentOut(Workflow, ModelSQL, ModelView):
('id', If(Eval('context', {}).contains('company'), '=', '!='),
Eval('context', {}).get('company', -1)),
],
depends=['state'])
depends=['state'],
help="The company the shipment is associated with.")
customer = fields.Many2One('party.party', 'Customer', required=True,
states={
'readonly': ((Eval('state') != 'draft')
| Eval('outgoing_moves', [0])),
},
depends=['state'])
depends=['state'],
help="The party that purchased the stock.")
customer_location = fields.Function(fields.Many2One('stock.location',
'Customer Location'), 'on_change_with_customer_location')
delivery_address = fields.Many2One('party.address',
@@ -818,17 +844,20 @@ class ShipmentOut(Workflow, ModelSQL, ModelView):
states={
'readonly': Eval('state') != 'draft',
}, domain=[('party', '=', Eval('customer'))],
depends=['state', 'customer'])
depends=['state', 'customer'],
help="Where the stock is sent to.")
reference = fields.Char("Reference", size=None, select=True,
states={
'readonly': Eval('state') != 'draft',
}, depends=['state'])
}, depends=['state'],
help="The customer's identifier for the shipment.")
warehouse = fields.Many2One('stock.location', "Warehouse", required=True,
states={
'readonly': ((Eval('state') != 'draft')
| Eval('outgoing_moves', [0]) | Eval('inventory_moves', [0])),
}, domain=[('type', '=', 'warehouse')],
depends=['state'])
depends=['state'],
help="Where the stock is sent from.")
warehouse_storage = fields.Function(fields.Many2One('stock.location',
'Warehouse Storage'), 'on_change_with_warehouse_storage')
warehouse_output = fields.Function(fields.Many2One('stock.location',
@@ -846,7 +875,8 @@ class ShipmentOut(Workflow, ModelSQL, ModelView):
| ~Eval('warehouse') | ~Eval('customer')),
},
depends=['state', 'warehouse', 'customer', 'warehouse_output',
'customer_location', 'company']),
'customer_location', 'company'],
help="The moves that send the stock to the customer."),
'get_outgoing_moves', setter='set_outgoing_moves')
inventory_moves = fields.Function(fields.One2Many('stock.move', 'shipment',
'Inventory Moves',
@@ -865,13 +895,15 @@ class ShipmentOut(Workflow, ModelSQL, ModelView):
Eval('warehouse_storage') == Eval('warehouse_output')),
},
depends=['state', 'warehouse', 'warehouse_storage',
'warehouse_output', 'company']),
'warehouse_output', 'company'],
help="The moves that pick the stock from the storage area."),
'get_inventory_moves', setter='set_inventory_moves')
moves = fields.One2Many('stock.move', 'shipment', 'Moves',
domain=[('company', '=', Eval('company'))], depends=['company'],
readonly=True)
origins = fields.Function(fields.Char('Origins'), 'get_origins')
number = fields.Char('Number', size=None, select=True, readonly=True)
number = fields.Char('Number', size=None, select=True, readonly=True,
help="The main identifier for the shipment.")
assigned_by = employee_field("Assigned By")
packed_by = employee_field("Packed By")
done_by = employee_field("Done By")
@@ -882,7 +914,8 @@ class ShipmentOut(Workflow, ModelSQL, ModelView):
('assigned', 'Assigned'),
('packed', 'Packed'),
('waiting', 'Waiting'),
], 'State', readonly=True)
], 'State', readonly=True,
help="The current state of the shipment.")
@classmethod
def __setup__(cls):
@@ -1355,11 +1388,13 @@ class ShipmentOutReturn(Workflow, ModelSQL, ModelView):
states={
'readonly': Eval('state').in_(['cancel', 'done']),
},
depends=['state'])
depends=['state'],
help="When the stock was returned.")
planned_date = fields.Date('Planned Date',
states={
'readonly': Eval('state') != 'draft',
}, depends=['state'])
}, depends=['state'],
help="When the stock is expected to be returned.")
company = fields.Many2One('company.company', 'Company', required=True,
states={
'readonly': Eval('state') != 'draft',
@@ -1368,13 +1403,15 @@ class ShipmentOutReturn(Workflow, ModelSQL, ModelView):
('id', If(Eval('context', {}).contains('company'), '=', '!='),
Eval('context', {}).get('company', -1)),
],
depends=['state'])
depends=['state'],
help="The company the shipment is associated with.")
customer = fields.Many2One('party.party', 'Customer', required=True,
states={
'readonly': ((Eval('state') != 'draft')
| Eval('incoming_moves', [0])),
},
depends=['state'])
depends=['state'],
help="The party that purchased the stock.")
customer_location = fields.Function(fields.Many2One('stock.location',
'Customer Location'), 'on_change_with_customer_location')
delivery_address = fields.Many2One('party.address',
@@ -1382,17 +1419,20 @@ class ShipmentOutReturn(Workflow, ModelSQL, ModelView):
states={
'readonly': Eval('state') != 'draft',
}, domain=[('party', '=', Eval('customer'))],
depends=['state', 'customer'])
depends=['state', 'customer'],
help="The address the customer can be contacted at.")
reference = fields.Char("Reference", size=None, select=True,
states={
'readonly': Eval('state') != 'draft',
}, depends=['state'])
}, depends=['state'],
help="The customer's identifier for the shipment.")
warehouse = fields.Many2One('stock.location', "Warehouse", required=True,
states={
'readonly': ((Eval('state') != 'draft')
| Eval('incoming_moves', [0]) | Eval('inventory_moves', [0])),
}, domain=[('type', '=', 'warehouse')],
depends=['state'])
depends=['state'],
help="Where the stock is returned.")
warehouse_storage = fields.Function(fields.Many2One('stock.location',
'Warehouse Storage'), 'on_change_with_warehouse_storage')
warehouse_input = fields.Function(fields.Many2One('stock.location',
@@ -1412,7 +1452,8 @@ class ShipmentOutReturn(Workflow, ModelSQL, ModelView):
| ~Eval('warehouse') | ~Eval('customer')),
},
depends=['state', 'warehouse', 'customer', 'customer_location',
'warehouse_input', 'warehouse_storage', 'company']),
'warehouse_input', 'warehouse_storage', 'company'],
help="The moves that bring the stock into the warehouse."),
'get_incoming_moves', setter='set_incoming_moves')
inventory_moves = fields.Function(fields.One2Many('stock.move', 'shipment',
'Inventory Moves',
@@ -1430,13 +1471,15 @@ class ShipmentOutReturn(Workflow, ModelSQL, ModelView):
Eval('warehouse_input') == Eval('warehouse_storage')),
},
depends=['state', 'warehouse', 'warehouse_input',
'warehouse_storage', 'warehouse_input', 'company']),
'warehouse_storage', 'warehouse_input', 'company'],
help="The moves that put the stock away into the storage area."),
'get_inventory_moves', setter='set_inventory_moves')
moves = fields.One2Many('stock.move', 'shipment', 'Moves',
domain=[('company', '=', Eval('company'))], depends=['company'],
readonly=True)
origins = fields.Function(fields.Char('Origins'), 'get_origins')
number = fields.Char('Number', size=None, select=True, readonly=True)
number = fields.Char('Number', size=None, select=True, readonly=True,
help="The main identifier for the shipment.")
received_by = employee_field("Received By")
done_by = employee_field("Done By")
state = fields.Selection([
@@ -1444,7 +1487,8 @@ class ShipmentOutReturn(Workflow, ModelSQL, ModelView):
('done', 'Done'),
('cancel', 'Canceled'),
('received', 'Received'),
], 'State', readonly=True)
], 'State', readonly=True,
help="The current state of the shipment.")
@classmethod
def __setup__(cls):
@@ -1736,7 +1780,8 @@ class AssignShipmentOutAssignFailed(ModelView):
'Assign Customer Shipment'
__name__ = 'stock.shipment.out.assign.failed'
inventory_moves = fields.Many2Many('stock.move', None, None,
'Inventory Moves', readonly=True)
'Inventory Moves', readonly=True,
help="The inventory moves that were not assigned.")
@staticmethod
def default_inventory_moves():
@@ -1788,22 +1833,26 @@ class ShipmentInternal(Workflow, ModelSQL, ModelView):
states={
'readonly': Eval('state').in_(['cancel', 'done']),
},
depends=['state'])
depends=['state'],
help="When the shipment was actually completed.")
planned_date = fields.Date('Planned Date',
states={
'readonly': ~Eval('state').in_(['request', 'draft']),
}, depends=['state'])
}, depends=['state'],
help="When the shipment is expected to be completed.")
effective_start_date = fields.Date('Effective Start Date',
states={
'readonly': Eval('state').in_(['cancel', 'shipped', 'done']),
},
depends=['state'])
depends=['state'],
help="When the stock was actually sent.")
planned_start_date = fields.Date('Planned Start Date',
states={
'readonly': ~Eval('state').in_(['request', 'draft']),
'required': Bool(Eval('planned_date')),
},
depends=['state'])
depends=['state'],
help="When the stock is expected to be sent.")
company = fields.Many2One('company.company', 'Company', required=True,
states={
'readonly': ~Eval('state').in_(['request', 'draft']),
@@ -1812,12 +1861,15 @@ class ShipmentInternal(Workflow, ModelSQL, ModelView):
('id', If(Eval('context', {}).contains('company'), '=', '!='),
Eval('context', {}).get('company', -1)),
],
depends=['state'])
number = fields.Char('Number', size=None, select=True, readonly=True)
depends=['state'],
help="The company the shipment is associated with.")
number = fields.Char('Number', size=None, select=True, readonly=True,
help="The main identifier for the shipment.")
reference = fields.Char("Reference", size=None, select=True,
states={
'readonly': ~Eval('state').in_(['request', 'draft']),
}, depends=['state'])
}, depends=['state'],
help="The external identifiers for the shipment.")
from_location = fields.Many2One('stock.location', "From Location",
required=True, states={
'readonly': (~Eval('state').in_(['request', 'draft'])
@@ -1825,16 +1877,21 @@ class ShipmentInternal(Workflow, ModelSQL, ModelView):
},
domain=[
('type', 'in', ['view', 'storage', 'lost_found']),
], depends=['state'])
], depends=['state'],
help="Where the stock is moved from.")
to_location = fields.Many2One('stock.location', "To Location",
required=True, states={
'readonly': (~Eval('state').in_(['request', 'draft'])
| Eval('moves', [0])),
}, domain=[
('type', 'in', ['view', 'storage', 'lost_found']),
], depends=['state'])
], depends=['state'],
help="Where the stock is moved to.")
transit_location = fields.Function(fields.Many2One('stock.location',
'Transit Location'), 'on_change_with_transit_location')
'Transit Location',
help="Where the stock is located while it is in transit between "
"the warehouses."),
'on_change_with_transit_location')
moves = fields.One2Many('stock.move', 'shipment', 'Moves',
states={
'readonly': (Eval('state').in_(['cancel', 'assigned', 'done'])
@@ -1872,7 +1929,8 @@ class ShipmentInternal(Workflow, ModelSQL, ModelView):
('company', '=', Eval('company')),
],
depends=['state', 'from_location', 'to_location', 'transit_location',
'company'])
'company'],
help="The moves that perform the shipment.")
outgoing_moves = fields.Function(fields.One2Many('stock.move', 'shipment',
'Outgoing Moves',
domain=[
@@ -1893,7 +1951,8 @@ class ShipmentInternal(Workflow, ModelSQL, ModelView):
| Eval('state').in_(['request', 'draft'])),
},
depends=['from_location', 'to_location', 'transit_location',
'state']),
'state'],
help="The moves that send the stock out."),
'get_outgoing_moves', setter='set_moves')
incoming_moves = fields.Function(fields.One2Many('stock.move', 'shipment',
'Incoming Moves',
@@ -1914,7 +1973,8 @@ class ShipmentInternal(Workflow, ModelSQL, ModelView):
| Eval('state').in_(['request', 'draft'])),
},
depends=['from_location', 'to_location', 'transit_location',
'state']),
'state'],
help="The moves that receive the stock in."),
'get_incoming_moves', setter='set_moves')
assigned_by = employee_field("Received By")
shipped_by = employee_field("Shipped By")
@@ -1927,7 +1987,8 @@ class ShipmentInternal(Workflow, ModelSQL, ModelView):
('assigned', 'Assigned'),
('shipped', 'Shipped'),
('done', 'Done'),
], 'State', readonly=True)
], 'State', readonly=True,
help="The current state of the shipment.")
@classmethod
def __setup__(cls):
@@ -2311,14 +2372,16 @@ class ShipmentInternal(Workflow, ModelSQL, ModelView):
class Address(metaclass=PoolMeta):
__name__ = 'party.address'
delivery = fields.Boolean('Delivery')
delivery = fields.Boolean('Delivery',
help="Check to send deliveries to the address.")
class AssignShipmentInternalAssignFailed(ModelView):
'Assign Shipment Internal'
__name__ = 'stock.shipment.internal.assign.failed'
moves = fields.Many2Many('stock.move', None, None, 'Moves',
readonly=True)
readonly=True,
help="The moves that were not assigned.")
@staticmethod
def default_moves():
@@ -2366,7 +2429,8 @@ class AssignShipmentInReturnAssignFailed(ModelView):
'Assign Supplier Return Shipment'
__name__ = 'stock.shipment.in.return.assign.failed'
moves = fields.Many2Many('stock.move', None, None, 'Moves',
readonly=True)
readonly=True,
help="The moves that were not assigned.")
@staticmethod
def default_moves():