Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IMP meta data ADD Prodcution Lots Traceability tree view
- Loading branch information
Showing
7 changed files
with
158 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 34 additions & 4 deletions
38
mrp_production_traceability/models/stock_production_lot.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2017 Lorenzo Battistini - Agile Business Group | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openerp import models, fields, api | ||
|
||
|
||
class OpenLotsTree(models.TransientModel): | ||
_name = 'stock.production.lot.open.tree' | ||
lot_id = fields.Many2one( | ||
'stock.production.lot', required=True, string="Production lot") | ||
|
||
@api.multi | ||
def open_lots_tree(self): | ||
self.ensure_one() | ||
data_model = self.env['ir.model.data'] | ||
act_model = self.env['ir.actions.act_window'] | ||
id = data_model.get_object_reference( | ||
'mrp_production_traceability', 'action_lot_traceability_tree')[1] | ||
result = act_model.browse(id).read()[0] | ||
result['domain'] = [('id', '=', self.lot_id.id)] | ||
return result |
36 changes: 36 additions & 0 deletions
36
mrp_production_traceability/wizard/open_lots_tree_view.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<openerp> | ||
<data> | ||
|
||
<record id="view_open_lots_tree" model="ir.ui.view"> | ||
<field name="name">stock.production.lot.open.tree.form</field> | ||
<field name="model">stock.production.lot.open.tree</field> | ||
<field name="arch" type="xml"> | ||
<form string="Prodcution Lots Traceability"> | ||
<group> | ||
<field name="lot_id"></field> | ||
</group> | ||
<footer> | ||
<button string="Open Lots Tree" name="open_lots_tree" type="object" class="oe_highlight"/> | ||
or | ||
<button string="Cancel" class="oe_link" special="cancel"/> | ||
</footer> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record id="action_view_open_lots_tree" model="ir.actions.act_window"> | ||
<field name="name">Prodcution Lots Traceability</field> | ||
<field name="res_model">stock.production.lot.open.tree</field> | ||
<field name="view_type">form</field> | ||
<field name="view_mode">form</field> | ||
<field name="view_id" ref="view_open_lots_tree"/> | ||
<field name="target">new</field> | ||
</record> | ||
|
||
<menuitem id="menu_action_view_open_lots_tree" name="Production Lots Tree" | ||
parent="stock.menu_traceability" action="action_view_open_lots_tree" | ||
sequence="4" /> | ||
|
||
</data> | ||
</openerp> |