~unifield-team/unifield-wm/us-826

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
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
    <data>
    
        <record id="threshold_value_form_view" model="ir.ui.view">
        	<field name="name">threshold.value.form.view</field>
        	<field name="model">threshold.value</field>
        	<field name="type">form</field>
        	<field name="arch" type="xml">
        		<form string="Threshold value">
        			<separator colspan="4" string="General Information" />
        			<field name="name" />
        			<field name="warehouse_id" widget="selection" 
        				on_change="onchange_warehouse_id(warehouse_id)" />
        			<field name="category_id" on_change="category_on_change(category_id)" />
        			<field name="location_id"  />
        			<field name="product_id" on_change="product_on_change(product_id)" 
        				attrs="{'invisible': [('category_id', '!=', False)], 'required': [('category_id', '=', False)]}" />
        			<field name="active" />
        			<field name="uom_id" attrs="{'invisible': [('category_id', '!=', False)]}" />
        			<newline />
        			<group colspan="2" col="2">
        				<separator colspan="2" string="Quantity rules" />
        				<field name="threshold_manual_ok" 
        					on_change="compute_threshold_qty_order(category_id, product_id, location_id, frequency, lead_time, supplier_lt, safety_month, threshold_manual_ok, qty_order_manual_ok)" />
        				<field name="threshold_value"  attrs="{'readonly': [('threshold_manual_ok', '=', False)]}" />
        				<field name="qty_order_manual_ok" 
        					on_change="compute_threshold_qty_order(category_id, product_id, location_id, frequency, lead_time, supplier_lt, safety_month, threshold_manual_ok, qty_order_manual_ok)" />
        				<field name="qty_to_order" attrs="{'readonly': [('qty_order_manual_ok', '=', False)]}" />
        			</group>
        			<group colspan="2" col="2">
        				<separator colspan="2" string="Calculation parameters" />
        				<field name="frequency" attrs="{'readonly': [('threshold_manual_ok', '=', True), ('qty_order_manual_ok', '=', True)]}"
        					on_change="compute_threshold_qty_order(category_id, product_id, location_id, frequency, lead_time, supplier_lt, safety_month, threshold_manual_ok, qty_order_manual_ok)" />
        				<field name="safety_month" attrs="{'readonly': [('threshold_manual_ok', '=', True), ('qty_order_manual_ok', '=', True)]}"
        					on_change="compute_threshold_qty_order(category_id, product_id, location_id, frequency, lead_time, supplier_lt, safety_month, threshold_manual_ok, qty_order_manual_ok)" />
        				<field name="lead_time" attrs="{'readonly': [('supplier_lt', '=', True)], 'readonly': [('threshold_manual_ok', '=', True), ('qty_order_manual_ok', '=', True)]}" 
        					on_change="compute_threshold_qty_order(category_id, product_id, location_id, frequency, lead_time, supplier_lt, safety_month, threshold_manual_ok, qty_order_manual_ok)" />
        				<field name="supplier_lt" attrs="{'readonly': [('threshold_manual_ok', '=', True), ('qty_order_manual_ok', '=', True)]}"
        					on_change="compute_threshold_qty_order(category_id, product_id, location_id, frequency, lead_time, supplier_lt, safety_month, threshold_manual_ok, qty_order_manual_ok)" />
        			</group>
        		</form>
        	</field>
        </record>
        
        <record id="threshold_value_tree_view" model="ir.ui.view">
        	<field name="name">threshold.value.tree.view</field>
        	<field name="model">threshold.value</field>
        	<field name="type">tree</field>
        	<field name="arch" type="xml">
        		<tree string="Threshold value">
        			<field name="name" />
        			<field name="category_id" />
        			<field name="product_id" />
        			<field name="location_id" />
        		</tree>
        	</field>
        </record>
        
        <record id="threshold_value_search_view" model="ir.ui.view">
        	<field name="name">threshold.value.search.view</field>
        	<field name="model">threshold.value</field>
        	<field name="type">search</field>
        	<field name="arch" type="xml">
        		<search string="Threshold values">
        			 <group expand="1" string="Filters...">
        			 	<field name="name" default_focus="1" />
        			 	<field name="product_id" eval="context.get('product_id', False)" />
        			 	<field name="category_id" eval="context.get('category_id', False)" />
        			 	<field name="location_id" eval="context.get('location_id', False)" />
	                </group>
	                <newline/>
	                <group expand="1" string="Group By...">
	                	<filter name="group_product_categ_id" string="Product Category" icon="terp-stock_symbol-selection" context="{'group_by':'product_categ_id'}"/>
	                	<filter name="group_product" string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
	                	<separator orientation="vertical"/>
	                	<filter name="group_location" string="Location" icon="terp-go-home" context="{'group_by':'location_id'}"/>
	                </group>
        		</search>
        	</field>
        </record>
        
        <record id="action_threshold_value" model="ir.actions.act_window">
        	<field name="name">Threshold value</field>
        	<field name="res_model">threshold.value</field>
        	<field name="view_type">form</field>
        	<field name="view_mode">tree,form</field>
        </record>
        
        <menuitem id="menu_threshold_value"
        		  action="action_threshold_value"
        		  parent="procurement.menu_stock_procurement" />
    
    </data>
</openerp>