mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
improve usage of planned orders. - The description of the planned order includes the topmost requirement that caused the planned order. This makes it easier to trace, for example, what planned orders has a given sales order generated. The description of the planned order is passed on to the Manufacturing Orders / Purchase Orders / Transfers as the origin, so it can be possible to search for PO's / MO's that were originated as a result of a given sales order, for example.
- The MRP Inventory tree view is improved so as to add a button to allow you to jump to the planned orders.
This commit is contained in:
committed by
JasminSForgeFlow
parent
adcc8821df
commit
726ccec7e8
@@ -6,7 +6,7 @@
|
||||
|
||||
from datetime import date, timedelta
|
||||
|
||||
from odoo import api, fields, models
|
||||
from odoo import _, api, fields, models
|
||||
|
||||
|
||||
class MrpInventory(models.Model):
|
||||
@@ -109,3 +109,18 @@ class MrpInventory(models.Model):
|
||||
if order_release_date < today:
|
||||
order_release_date = today
|
||||
rec.order_release_date = order_release_date
|
||||
|
||||
def action_open_planned_orders(self):
|
||||
planned_order_ids = []
|
||||
for rec in self:
|
||||
planned_order_ids += rec.planned_order_ids.ids
|
||||
|
||||
domain = [("id", "in", planned_order_ids)]
|
||||
|
||||
return {
|
||||
"name": _("Planned Orders"),
|
||||
"type": "ir.actions.act_window",
|
||||
"res_model": "mrp.planned.order",
|
||||
"view_mode": "tree,form",
|
||||
"domain": domain,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user