Add 'staging' state to stock move
issue4362 review5811002
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Add 'staging' state to stock move
|
||||
* Apply stock_assign of compute_quantity_query only on outgoing moves
|
||||
* Add domain on location's parent and childs
|
||||
* Do not filter out inactive products from stock computation
|
||||
|
||||
@@ -82,6 +82,11 @@ A move can be in one of this states:
|
||||
Assigned move can be cancelled. To revert a move in state Done, an
|
||||
opposite move must be created.
|
||||
|
||||
* Staging
|
||||
|
||||
A phantom state used to create in advance move that should not be taken for
|
||||
stock computation.
|
||||
|
||||
|
||||
Product Quantities
|
||||
++++++++++++++++++
|
||||
|
||||
@@ -195,6 +195,7 @@ class Move(Workflow, ModelSQL, ModelView):
|
||||
},
|
||||
depends=['state'])
|
||||
state = fields.Selection([
|
||||
('staging', 'Staging'),
|
||||
('draft', 'Draft'),
|
||||
('assigned', 'Assigned'),
|
||||
('done', 'Done'),
|
||||
@@ -266,6 +267,7 @@ class Move(Workflow, ModelSQL, ModelView):
|
||||
'no_origin': 'The stock move "%s" has no origin.',
|
||||
})
|
||||
cls._transitions |= set((
|
||||
('staging', 'draft'),
|
||||
('draft', 'assigned'),
|
||||
('draft', 'done'),
|
||||
('draft', 'cancel'),
|
||||
@@ -640,7 +642,8 @@ class Move(Workflow, ModelSQL, ModelView):
|
||||
|
||||
vlist = [x.copy() for x in vlist]
|
||||
for vals in vlist:
|
||||
assert vals.get('state', 'draft') == 'draft'
|
||||
assert vals.get('state', cls.default_state()
|
||||
) in ['draft', 'staging']
|
||||
|
||||
product = Product(vals['product'])
|
||||
uom = Uom(vals['uom'])
|
||||
|
||||
@@ -1080,6 +1080,7 @@ class ShipmentOut(Workflow, ModelSQL, ModelView):
|
||||
company=move.company,
|
||||
currency=move.currency,
|
||||
unit_price=move.unit_price,
|
||||
state='staging' if move.state == 'staging' else 'draft',
|
||||
)
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user