[MERGE] forward port of branch 8.0 up to e883193
[odoo/odoo.git] / addons / stock_landed_costs / stock_landed_costs_view.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <openerp>
3     <data>
4
5        <!-- Stock Landed Cost Form View -->
6         <record id='view_stock_landed_cost_form' model='ir.ui.view'>
7             <field name="name">stock.landed.cost.form</field>
8             <field name="model">stock.landed.cost</field>
9             <field name="arch" type="xml">
10                 <form string="Landed Costs">
11                     <header>
12                         <button name="button_validate" string="Validate" states="draft" class="oe_highlight" type="object"/>
13                         <button name="button_cancel" string="Cancel" states="draft" type="object"/>
14                         <field name="state" widget="statusbar" statusbar_visible="draft,done"/>
15                     </header>
16                     <sheet>
17                         <div class="oe_title">
18                             <label for="name" class="oe_edit_only"/>
19                             <h1>
20                                 <field name="name" class="oe_inline"/>
21                                 </h1>
22                         </div>
23                         <group>
24                             <group>
25                                 <field name="date"/>
26                                 <field name="picking_ids" widget="many2many_tags" domain="[('state', '=', 'done')]"/>
27                             </group>
28                             <group>
29                                 <field name="account_journal_id"/>
30                                 <field name="account_move_id"/>
31                             </group>
32                         </group>
33                         <group>
34                             <separator string="Cost Lines" colspan="4"/>
35                             <group>
36                                 <field name="cost_lines" nolabel="1">
37                                     <form string="Cost Lines">
38                                         <group>
39                                             <group>
40                                                 <field name="product_id"
41                                                     on_change="onchange_product_id(product_id)" domain="[('landed_cost_ok', '=', True)]" context="{'default_landed_cost_ok': True}"/>
42                                                 <field name="price_unit"/>
43                                             </group>
44                                             <group>
45                                                 <field name="split_method"/>
46                                                 <field name="account_id"/>
47                                             </group>
48                                         </group>
49                                         <label for="name"/>
50                                         <field name="name"/>
51                                     </form>
52                                     <tree string="Cost Lines" editable="bottom">
53                                         <field name="product_id" on_change="onchange_product_id(product_id)" domain="[('landed_cost_ok', '=', True)]" context="{'default_landed_cost_ok': True}"/>
54                                         <field name="name"/>
55                                         <field name="account_id"/>
56                                         <field name="split_method"/>
57                                         <field name="price_unit"/>
58                                     </tree>
59                                 </field>
60                             </group>
61                         </group>
62                         <group class="oe_subtotal_footer oe_right">
63                             <field name="amount_total"/>
64                         </group>
65                         <group>
66                             <group>
67                                 <separator string="Valuation Adjustments"/>
68                             </group>
69                             <group>
70                                 <button name="compute_landed_cost" string="Compute" type="object" class="oe_right"/>
71                             </group>
72                         </group>
73                         <group>
74                             <group>
75                                 <field name="valuation_adjustment_lines" nolabel="1">
76                                     <form string="Valuation Adjustments">
77                                         <group>
78                                             <group>
79                                                 <field name="product_id"/>
80                                                 <field name="quantity"/>
81                                             </group>
82                                             <group>
83                                                 <field name="former_cost"/>
84                                                 <field name="additional_landed_cost"/>
85                                             </group>
86                                         </group>
87                                     </form>
88                                     <tree string="Valuation Adjustments" editable="bottom" create="0">
89                                         <field name="cost_line_id" readonly="1"/>
90                                         <field name="product_id" readonly="1"/>
91                                         <field name="weight" readonly="1"/>
92                                         <field name="volume" readonly="1"/>
93                                         <field name="quantity" readonly="1"/>
94                                         <field name="former_cost_per_unit" readonly="1"/>
95                                         <field name="former_cost" readonly="1"/>
96                                         <field name="additional_landed_cost"/>
97                                     </tree>
98                                 </field>
99                             </group>
100                         </group>
101                     </sheet>
102                     <div class="oe_chatter">
103                         <field name="message_follower_ids" widget="mail_followers"/>
104                         <field name="message_ids" widget="mail_thread"/>
105                     </div>
106                 </form>
107             </field>
108         </record>
109
110         <!-- Stock Landed Cost Tree View -->
111         <record id='view_stock_landed_cost_tree' model='ir.ui.view'>
112             <field name="name">stock.landed.cost.tree</field>
113             <field name="model">stock.landed.cost</field>
114             <field name="arch" type="xml">
115                 <tree string="Landed Costs">
116                     <field name="name"/>
117                     <field name="date"/>
118                     <field name="state"/>
119                 </tree>
120             </field>
121         </record>
122
123         <!-- Stock Landed Cost Search View -->
124         <record id="view_stock_landed_cost_search" model="ir.ui.view">
125             <field name="name">stock.landed.cost.search</field>
126             <field name="model">stock.landed.cost</field>
127             <field name="arch" type="xml">
128                 <search string="Landed Costs">
129                     <field name="name" string="Name"/>
130                     <field name="date"/>
131                     <separator/>
132                     <filter string="Draft" name="draft" domain="[('state','=','draft')]"/>
133                     <filter string="Done" name="done" domain="[('state','=','done')]"/>
134                     <group expand="0" string="Group By">
135                         <filter string="Month" context="{'group_by': 'date'}"/>
136                         <filter string="Status" context="{'group_by': 'state'}"/>
137                     </group>
138                 </search>
139             </field>
140         </record>
141
142         <!-- Stock Landed Cost Action -->
143         <record id='action_stock_landed_cost' model='ir.actions.act_window'>
144             <field name="name">Landed Costs</field>
145             <field name="res_model">stock.landed.cost</field>
146             <field name="view_type">form</field>
147             <field name="view_mode">tree,form</field>
148             <field name="context">{}</field>
149             <field name="help" type="html">
150                 <p class="oe_view_nocontent_create">
151                     Click to create a new landed cost.
152                 </p>
153             </field>
154         </record>
155
156         <!-- Stock Landed Cost Menu -->
157         <menuitem name="Landed Costs" parent="stock.menu_stock_root" id="menu_stock_landed_cost_main" sequence="1"/>
158         <menuitem action="action_stock_landed_cost" name="Landed Costs" parent="menu_stock_landed_cost_main" id="menu_stock_landed_cost" sequence="1"/>
159
160         <!-- Stock Landed Cost Type View -->
161         <record id="view_stock_landed_cost_type_form" model="ir.ui.view">
162             <field name="name">stock.landed.cost.type.form</field>
163             <field name="model">product.product</field>
164             <field name="arch" type="xml">
165                 <form string="Landed Costs">
166                     <sheet>
167                         <field name="image_medium" widget="image" class="oe_avatar oe_left"/>
168                         <div class="oe_title">
169                             <div class="oe_edit_only">
170                                 <label for="name" name='label_name' string="Product Name"/>
171                             </div>
172                             <h1>
173                                 <field name="name" class="oe_inline"/>
174                             </h1>
175                             <label for="categ_id" class="oe_edit_only"/>
176                             <h2><field name="categ_id"/></h2>
177                             <div name="options" groups="base.group_user">
178                                 <field name="landed_cost_ok" readonly="1"/>
179                                 <label for="landed_cost_ok"/>
180                                 <field name="active" />
181                                 <label for="active"/>
182                             </div>
183                         </div>
184                         <notebook>
185                             <page string="Information">
186                                 <group>
187                                     <group>
188                                         <field name="split_method"/>
189                                         <field name="standard_price"/>
190                                         <field name="property_account_expense"/>
191                                     </group>
192                                     <group>
193                                         <field name="company_id" groups="base.group_multi_company" widget="selection"/>
194                                         <field name="type"/>
195                                     </group>
196                                 </group>
197                                 <field name="description" placeholder="describe the product characteristics..."/>
198                             </page>
199                         </notebook>
200                     </sheet>
201                     <div class="oe_chatter">
202                         <field name="message_follower_ids" widget="mail_followers"/>
203                         <field name="message_ids" widget="mail_thread"/>
204                     </div>
205                 </form>
206             </field>
207         </record>
208
209         <!-- Stock Landed Cost Type Tree View -->
210         <record id="stock_landed_cost_tree_view" model="ir.ui.view">
211             <field name="name">product.product.tree</field>
212             <field name="model">product.product</field>
213             <field name="arch" type="xml">
214                 <tree string="Products">
215                     <field name="name"/>
216                     <field name="split_method"/>
217                     <field name="standard_price"/>
218                 </tree>
219             </field>
220         </record>
221         <record id="stock_landed_cost_type_action" model="ir.actions.act_window">
222             <field name="name">Products</field>
223             <field name="type">ir.actions.act_window</field>
224             <field name="res_model">product.product</field>
225             <field name="domain">[('landed_cost_ok','=',True)]</field>
226             <field name="view_type">form</field>
227             <field name="view_mode">tree,form</field>
228             <field name="context">{'default_landed_cost_ok': True}</field>
229             <field name="search_view_id" ref="product.product_search_form_view"/>
230             <field name="help" type="html">
231               <p class="oe_view_nocontent_create">
232                 Click to define a new kind of landed cost.
233               </p>
234             </field>
235         </record>
236         
237         <record id="stock_landed_cost_type_action1" model="ir.actions.act_window.view">
238            <field eval="1" name="sequence"/>
239            <field name="view_mode">tree</field>
240            <field name="view_id" ref="stock_landed_cost_tree_view"/>
241            <field name="act_window_id" ref="stock_landed_cost_type_action"/>
242         </record>
243
244         <record id="stock_landed_cost_type_action2" model="ir.actions.act_window.view">
245            <field eval="2" name="sequence"/>
246            <field name="view_mode">form</field>
247            <field name="view_id" ref="view_stock_landed_cost_type_form"/>
248            <field name="act_window_id" ref="stock_landed_cost_type_action"/>
249         </record>
250
251         <menuitem action="stock_landed_cost_type_action" name="Landed Cost Type" parent="stock.menu_warehouse_config" id="menu_stock_landed_cost_type" sequence="5"/>
252
253     </data>
254 </openerp>