Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
8f44f38b
Commit
8f44f38b
authored
8 years ago
by
Josse Colpaert
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] mrp: "produce" wizard should set MO to "in progress" state
parent
31b3073d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
addons/mrp/wizard/mrp_product_produce.py
+4
-0
4 additions, 0 deletions
addons/mrp/wizard/mrp_product_produce.py
addons/sale_mrp/tests/test_sale_mrp_flow.py
+2
-2
2 additions, 2 deletions
addons/sale_mrp/tests/test_sale_mrp_flow.py
with
6 additions
and
2 deletions
addons/mrp/wizard/mrp_product_produce.py
+
4
−
0
View file @
8f44f38b
...
...
@@ -74,6 +74,8 @@ class MrpProductProduce(models.TransientModel):
# Nothing to do for lots since values are created using default data (stock.move.lots)
moves
=
self
.
production_id
.
move_raw_ids
quantity
=
self
.
product_qty
if
float_compare
(
quantity
,
0
,
precision_rounding
=
self
.
product_uom_id
.
rounding
)
<=
0
:
raise
UserError
(
_
(
'
You should at least produce some quantity
'
))
for
move
in
moves
.
filtered
(
lambda
x
:
x
.
product_id
.
tracking
==
'
none
'
and
x
.
state
not
in
(
'
done
'
,
'
cancel
'
)):
if
move
.
unit_factor
:
move
.
quantity_done_store
+=
quantity
*
move
.
unit_factor
...
...
@@ -84,6 +86,8 @@ class MrpProductProduce(models.TransientModel):
elif
move
.
unit_factor
:
move
.
quantity_done_store
+=
quantity
*
move
.
unit_factor
self
.
check_finished_move_lots
()
if
self
.
production_id
.
state
==
'
confirmed
'
:
self
.
production_id
.
state
=
'
progress
'
return
{
'
type
'
:
'
ir.actions.act_window_close
'
}
@api.multi
...
...
This diff is collapsed.
Click to expand it.
addons/sale_mrp/tests/test_sale_mrp_flow.py
+
2
−
2
View file @
8f44f38b
...
...
@@ -280,7 +280,7 @@ class TestSaleMrpFlow(common.TransactionCase):
mnf_product_d
.
post_inventory
()
# Check state of manufacturing order.
self
.
assertEqual
(
mnf_product_d
.
state
,
'
confirmed
'
,
'
Manufacturing order should still be in
confirmed
state.
'
)
self
.
assertEqual
(
mnf_product_d
.
state
,
'
progress
'
,
'
Manufacturing order should still be in
progress
state.
'
)
# Check available quantity of product D.
self
.
assertEqual
(
product_d
.
qty_available
,
20
,
'
Wrong quantity available of product D.
'
)
...
...
@@ -332,7 +332,7 @@ class TestSaleMrpFlow(common.TransactionCase):
mnf_product_a
.
post_inventory
()
# Check state of manufacturing order product A.
self
.
assertEqual
(
mnf_product_a
.
state
,
'
confirmed
'
,
'
Manufacturing order should still be in
confirmed
state.
'
)
self
.
assertEqual
(
mnf_product_a
.
state
,
'
progress
'
,
'
Manufacturing order should still be in
the progress
state.
'
)
# Check product A avaialble quantity should be 120.
self
.
assertEqual
(
product_a
.
qty_available
,
120
,
'
Wrong quantity available of product A.
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment