mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[MIG] mrp_progress_button: Migration to 14.0
This commit is contained in:
committed by
AaronHForgeFlow
parent
0dd628175c
commit
08623a9e4d
@@ -8,7 +8,7 @@
|
||||
"author": "Akretion, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/manufacture",
|
||||
"category": "Manufacturing",
|
||||
"version": "12.0.1.0.0",
|
||||
"version": "14.0.1.0.0",
|
||||
"license": "AGPL-3",
|
||||
"depends": ["mrp"],
|
||||
"data": ["views/production.xml"],
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from odoo import api, models
|
||||
from odoo import models
|
||||
|
||||
|
||||
class MrpProduction(models.Model):
|
||||
_inherit = "mrp.production"
|
||||
|
||||
@api.multi
|
||||
def action_progress(self):
|
||||
self.write(
|
||||
{
|
||||
|
||||
@@ -56,15 +56,29 @@ class TestProgressButton(TransactionCase):
|
||||
|
||||
def _update_product_qty(self, product, location, quantity):
|
||||
"""Update Product quantity."""
|
||||
product_qty = self.env["stock.change.product.qty"].create(
|
||||
inventory = self.env["stock.inventory"].create(
|
||||
{
|
||||
"name": "Test Inventory",
|
||||
"product_ids": [(6, 0, product.ids)],
|
||||
"state": "confirm",
|
||||
"line_ids": [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
"product_qty": quantity,
|
||||
"location_id": location.id,
|
||||
"product_id": product.id,
|
||||
"new_quantity": quantity,
|
||||
"product_uom_id": product.uom_id.id,
|
||||
},
|
||||
)
|
||||
],
|
||||
}
|
||||
)
|
||||
product_qty.change_product_qty()
|
||||
return product_qty
|
||||
inventory.action_start()
|
||||
inventory.line_ids[0].write({"product_qty": quantity})
|
||||
inventory.action_validate()
|
||||
return quantity
|
||||
|
||||
def test_manufacture_with_forecast_stock(self):
|
||||
"""
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
<field name="model">mrp.production</field>
|
||||
<field name="inherit_id" ref="mrp.mrp_production_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<button name="action_assign" position="after">
|
||||
<button name="action_assign" position="before">
|
||||
<button
|
||||
name="action_progress"
|
||||
attrs="{'invisible': ['|', ('state', '!=', 'confirmed'), ('routing_id', '!=', False)]}"
|
||||
attrs="{'invisible': [('state', '!=', 'confirmed')]}"
|
||||
type="object"
|
||||
string="Mark As Started"
|
||||
class="oe_highlight"
|
||||
|
||||
Reference in New Issue
Block a user