forked from OCA/stock-logistics-workflow
-
Notifications
You must be signed in to change notification settings - Fork 1
/
stock_view.xml
166 lines (153 loc) · 7.86 KB
/
stock_view.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- In the form view of Incoming/Outgoing products, make the tree view of move lines editable and set the parameters that are only present in the form view to the fields of the tree view-->
<record id="view_stock_move_tree_editable" model="ir.ui.view">
<field name="name">view_stock_move_tree_editable</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_picking_tree" />
<field name="arch" type="xml">
<xpath expr="/tree[@string='Stock Moves']" position="attributes">
<attribute name="editable">bottom</attribute>
</xpath>
<xpath expr="//field[@name='product_id']" position="attributes">
<attribute name="on_change">onchange_product_id(product_id,location_id,location_dest_id, False)</attribute>
</xpath>
<!-- we need to have the "name" field in the tree view, because it is a required field that is set by the on_change on product_id... otherwise we get an error message when adding a new move line via the editable tree view -->
<xpath expr="//field[@name='product_id']" position="after">
<field name="name" invisible="1"/>
</xpath>
<!-- For the field product_qty, the on_change is already in the original tree view -->
<xpath expr="//field[@name='prodlot_id']" position="attributes">
<attribute name="context">{'location_id':location_id, 'product_id':product_id}</attribute>
<attribute name="domain">[('product_id','=?',product_id)]</attribute>
<attribute name="on_change">onchange_lot_id(prodlot_id, product_qty, location_id, product_id, product_uom)</attribute>
</xpath>
<!-- I want to have the field location_id visible and placed before dest_location_id -->
<xpath expr="//field[@name='location_id']" position="replace">
</xpath>
<xpath expr="//field[@name='location_dest_id']" position="before">
<field name="product_packaging" groups="product.group_stock_packaging" domain="[('product_id','=',product_id)]" invisible="context.get('picking_type') != 'out' or False"/>
<field name="location_id" groups="stock.group_locations"/>
</xpath>
<xpath expr="//button[@name='%(stock.track_line)d']" position="replace">
<button name="split_move" string="Manual Split"
groups="stock.group_production_lot"
states="draft,waiting,confirmed,assigned"
type="object" icon="gtk-justify-fill" />
</xpath>
<!-- In the form view of Incoming shipments, add the "new_prodlot_code" field -->
<xpath expr="//field[@name='prodlot_id']" position="before">
<field name="new_prodlot_code" groups="stock.group_production_lot" invisible="context.get('picking_type') != 'in' or False" />
</xpath>
<!-- In the form view of Incoming shipments, add the "new_tracking_code" field -->
<xpath expr="//field[@name='tracking_id']" position="before">
<field name="new_tracking_code" groups="stock.group_tracking_lot" invisible="context.get('picking_type') != 'in' or False" />
</xpath>
</field>
</record>
<record id="view_move_form_manual_split" model="ir.ui.view">
<field name="name">view.stock.move.form.manual_split</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_form" />
<field name="priority">24</field> <!-- inherit after product_hardware_revision -->
<field name="arch" type="xml">
<xpath expr="//button[@string='Split']" position="after">
<button name="split_move" string="Manual split"
states="draft,waiting,confirmed,assigned"
type="object" icon="gtk-justify-fill" />
</xpath>
</field>
</record>
<!-- Add "last_location_id" on prod lot view -->
<record id="view_production_lot_form_unique_production_number" model="ir.ui.view">
<field name="name">view_production_lot_form_unique_production_number</field>
<field name="model">stock.production.lot</field>
<field name="inherit_id" ref="stock.view_production_lot_form"/>
<field name="arch" type="xml">
<field name="stock_available" position="after">
<field name="last_location_id"/>
</field>
</field>
</record>
<act_window
domain="[('last_location_id', '=', active_id)]"
id="act_prodlot_location_open"
name="Prodlots"
res_model="stock.production.lot"
src_model="stock.location"/>
<record id="ir_act_prodlot_location_open" model="ir.values">
<field name="key2">tree_but_open</field>
<field name="model">stock.location</field>
<field name="name">Prodlots</field>
<field eval="'ir.actions.act_window,%d'%act_prodlot_location_open" name="value"/>
</record>
<!-- Wizard to help users input production lots in batch -->
<!-- TODO Nan-TIc : port to v6
<record id="view_stock_picking_prodlot_selection" model="ir.ui.view">
<field name="name">stock.picking.prodlot.selection</field>
<field name="model">stock.picking.prodlot.selection</field>
<field name="arch" type="xml">
<form string="Select Production Lots">
<field name="product_id" colspan="4"/>
<field name="first_lot"/>
<field name="last_lot"/>
<button type="object" name="action_cancel" string="Cancel" icon="gtk-cancel" special="cancel" colspan="2"/>
<button type="object" name="action_accept" string="Accept" icon="gtk-ok" colspan="2"/>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_prodlot_selection">
<field name="name">Select Production Lots</field>
<field name="res_model">stock.picking.prodlot.selection</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record id="view_picking_form" model="ir.ui.view">
<field name="name">stock.picking.form.prodlot.selection</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/group/label[@colspan='6']" position="replace">
<label colspan="5"/>
<button type="action" name="%(action_prodlot_selection)d" string="Spread Production Lots" states="draft,confirmed,assigned"/>
</xpath>
</field>
</record>
<record id="view_picking_in_form" model="ir.ui.view">
<field name="name">stock.picking.in.form.prodlot.selection</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_in_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/group/label[@colspan='5']" position="replace">
<label colspan="4"/>
<button type="action" name="%(action_prodlot_selection)d" string="Spread Production Lots" states="draft,confirmed,assigned"/>
</xpath>
</field>
</record>
<record id="view_picking_out_form" model="ir.ui.view">
<field name="name">stock.picking.out.form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_out_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/group/label[@colspan='6']" position="replace">
<label colspan="5"/>
<button type="action" name="%(action_prodlot_selection)d" string="Spread Production Lots" states="draft,confirmed,assigned"/>
</xpath>
</field>
</record>
<record id="view_picking_delivery_form" model="ir.ui.view">
<field name="name">stock.picking.delivery.form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_delivery_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/group/label[@colspan='6']" position="replace">
<label colspan="5"/>
<button type="action" name="%(action_prodlot_selection)d" string="Spread Production Lots" states="draft,confirmed,assigned"/>
</xpath>
</field>
</record>
-->
</data>
</openerp>