~unifield-team/unifield-wm/us-671-homere

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
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
    <data>

        <record id="product_history_consumption_form" model="ir.ui.view">
	    <field name="name">product.history.consumption.form</field>
	    <field name="model">product.history.consumption</field>
	    <field name="type">form</field>
	    <field name="arch" type="xml">
		<form string="Product historical consumption">
		    <group colspan="2" col="2">
			<separator colspan="2" string="Period parameters" />
		    	<field name="date_from" on_change="date_change(date_from, date_to)" />
   		    	<field name="date_to" on_change="date_change(date_from, date_to)" />
		    	<field name="month_ids" nolabel="1" colspan="2">
			    <tree string="Months" hide_new_button="1" noteditable="True" editable="top">
			        <field name="name" />
			    </tree>
		        </field>
		    </group>

		    <group colspan="2" col="2">
			<separator colspan="2" string="Consumption parameters" />
		    	<field name="consumption_type" />
		    	<field name="location_id" attrs="{'invisible': [('consumption_type', '!=', 'rac')], 'required': [('consumption_type', '=', 'rac')]}" />
			<separator colspan="2" string="Product parameters" />
			<field name="nomen_id" />
			<field name="sublist_id" />
			<separator colspan="2" string="Actions" />
			<button name="create_lines" type="object" string="View historical data" icon="gtk-execute" colspan="2" />
		    </group>

		</form>
	    </field>
	</record>

	<menuitem id="menu_product_history_consumption"
		  name="Historical consumption"
		  parent="warehouse_consumption_menu" />

	<record id="action_open_history_consumption_view" model="ir.actions.server">
            <field name="name">History consumption</field>
            <field name="model_id" ref="model_product_history_consumption"/>
            <field name="state">code</field>
            <field name="code">action = obj.open_history_consumption(context=context)</field>
        </record>

        <record id="ir_open_history consumption_view" model="ir.values">
            <field name="key2">tree_but_open</field>
            <field name="model">ir.ui.menu</field>
            <field name="name">Historical consumptions</field>
	    <field name="res_id" ref="menu_product_history_consumption" />
            <field eval="'ir.actions.server,%d'%action_open_history_consumption_view" name="value"/>
            <field eval="True" name="object"/>
        </record>

    </data>	
</openerp>