~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
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
    <data>

        <!--
            SUPPLIER CATALOGUE VIEWS
        -->

        <!-- Default supplier catalogue search view -->
        <record id="supplier_catalogue_search_view" model="ir.ui.view">
            <field name="name">supplier.catalogue.search.view</field>
            <field name="model">supplier.catalogue</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Supplier catalogues">
                    <filter name="active" domain="[('active', '=', False)]" string="Inactive" icon="gtk-undo" />
                    <field name="partner_id" />
                    <field name="name" />
                    <field name="period_from" />
                    <field name="period_to" />
                    <field name="currency_id" widget="selection" />
                </search>
            </field>
        </record>


        <!-- Default supplier catalogue form view -->
        <record id="supplier_catalogue_form_view" model="ir.ui.view">
            <field name="name">supplier.catalogue.form.view</field>
            <field name="model">supplier.catalogue</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Supplier catalogue">
                    <field name="name" colspan="4" />
                    <field name="period_from" attrs="{'required': [('is_esc', '=', False)], 'invisible': [('is_esc', '=', True)]}" />
                    <field name="period_to" attrs="{'invisible': [('is_esc', '=', True)]}" />
                    <field name="currency_id" domain="[('partner_currency', '=', partner_id)]" />
                    <field name="partner_id" readonly="1" />
                    <field name="is_esc" invisible="1" />
                    <field name="esc_update_ts" attrs="{'invisible': [('is_esc', '=', False)]}" /> <!-- UTP-746 -->
                    <field name="active" />

                    <newline />

                    <group name="import" string=" Import Lines " colspan="4" col="7" attrs="{'invisible': [('state', '!=', 'draft')]}">
                        <field name="filename_template" invisible="1"/>
                        <field name="file_to_import" filename="filename_template" colspan="2"/>
                        <label> </label>
                        <button name="catalogue_import_lines" type="object" string="Import lines" icon="gtk-execute" colspan="2" />
                        <button name="check_lines_to_fix" string="Check Lines" icon="gtk-dialog-warning" colspan="2" type="object" />
                        <newline />
                        <field name="filename" invisible="1"/>
                        <field name="data" filename="filename" attrs="{'invisible': [('import_error_ok', '=', False)]}"/>
                        <button name="clear_error" string="Clear errors" icon="gtk-clear" colspan="1" type="object" attrs="{'invisible': [('import_error_ok', '=', False)]}" />
                        <field name="import_error_ok" invisible="1"/>
                        <field name="text_error" colspan="4" attrs="{'invisible': [('import_error_ok', '=', False)]}" nolabel="1"/>
                        <newline />
                        <button name="add_multiple_lines" string="Add multiple lines" icon="gtk-add" colspan="4" type="object" />
                        <button name="button_remove_lines" string="Delete Lines" icon="gtk-remove" colspan="3" type="object" />
                    </group>

                    <notebook colspan="4">
                        <page string="Products">
                            <field name="line_ids" mode="tree" colspan="4" nolabel="1" />
                        </page>
                        <page string="Comment">
                            <field name="comment" colspan="4" nolabel="1" />
                        </page>
                    </notebook>

                    <field name="state" readonly="1" />
                    <group colspan="2" col="2">
                        <button type="object" name="button_confirm" icon="gtk-execute" string="Confirm" states="draft" colspan="2" />
                        <button type="object" name="button_draft" icon="gtk-cancel" string="Reset to draft" states="confirmed" colspan="2" />
                    </group>
                </form>
            </field>
        </record>

        <!-- Default supplier catalogue tree view -->
        <record id="supplier_catalogue_tree_view" model="ir.ui.view">
            <field name="name">supplier.catalogue.tree.view</field>
            <field name="model">supplier.catalogue</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Supplier catalogues" hide_new_button="1">
                    <field name="name" />
                    <field name="period_from" />
                    <field name="period_to" />
                    <field name="currency_id" />
                    <field name="partner_id" />
                </tree>
            </field>
        </record>

        <!--
            SUPPLIER CATALOGUE LINES VIEWS
        -->

        <!-- Supplier catalogue line search view -->
        <record id="supplier_catalogue_line_search_view" model="ir.ui.view">
            <field name="name">supplier.catalogue.line.search.view</field>
            <field name="model">supplier.catalogue.line</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Supplier catalogue lines">
                    <filter string="Stockable" icon="terp-accessories-archiver" domain="[('type','=','product')]"/>
                    <filter string="Non-Stockable" icon="terp-accessories-archiver" domain="[('type','=','consu')]"/>
                    <filter string="Service" icon="terp-accessories-archiver" domain="[('type','=','service')]"/>
                    <filter string="Service with Reception" icon="terp-accessories-archiver" domain="[('type','=','service_recep')]"/>
                    <separator orientation="vertical"/>
                    <field name="default_code"/>
                    <field name="name"/>
                    <field name="categ_id" widget="selection" operator="child_of" />
                    <newline/>
                    <filter string="Single Item" icon="terp-accessories-archiver" domain="[('subtype','=','single')]"/>
                    <filter string="Kit/Module" icon="terp-accessories-archiver" domain="[('subtype','=','kit')]"/>
                    <filter string="Asset" icon="terp-accessories-archiver" domain="[('subtype','=','asset')]"/>
                    <newline /> 
                    <group>
                    <field name="min_qty" />
                    <field name="min_order_qty" />
                    <field name="line_uom_id" />
                    <field name="unit_price" />
                    <field name="rounding" />
                    </group>
                    <newline />
                    <group expand="1" string="Nomenclature Filters...">
                        <field name="nomen_manda_0_s"
                            domain="[('parent_id', '=', -1)]"
                             widget="selection"
                            on_change="onChangeSearchNomenclature(0, 'mandatory', nomen_manda_0_s, nomen_manda_1_s, nomen_manda_2_s, nomen_manda_3_s, context)" />
                        <field name="nomen_manda_1_s"
                            domain="[('parent_id', '=', -1)]"
                             widget="selection"
                            on_change="onChangeSearchNomenclature(1, 'mandatory', nomen_manda_0_s, nomen_manda_1_s, nomen_manda_2_s, nomen_manda_3_s, context)" />
                        <field name="nomen_manda_2_s"
                            domain="[('parent_id', '=', -1)]"
                             widget="selection"
                            on_change="onChangeSearchNomenclature(2, 'mandatory', nomen_manda_0_s, nomen_manda_1_s, nomen_manda_2_s, nomen_manda_3_s, context)" />
                        <field name="nomen_manda_3_s"
                            domain="[('parent_id', '=', -1)]"
                             widget="selection"
                            on_change="onChangeSearchNomenclature(3, 'mandatory', nomen_manda_0_s, nomen_manda_1_s, nomen_manda_2_s, nomen_manda_3_s, context)" />
                    </group>
                    <newline />
                    <group expand="0" string="Optional Nomenclature Filters...">
                        <field name="nomen_sub_0_s" domain="[('parent_id', '=', -1)]" widget="selection" />
                        <field name="nomen_sub_1_s" domain="[('parent_id', '=', -1)]" widget="selection" />
                        <field name="nomen_sub_2_s" domain="[('parent_id', '=', -1)]" widget="selection" />
                        <field name="nomen_sub_3_s" domain="[('parent_id', '=', -1)]" widget="selection" />
                        <field name="nomen_sub_4_s" domain="[('parent_id', '=', -1)]" widget="selection" />
                        <field name="nomen_sub_5_s" domain="[('parent_id', '=', -1)]" widget="selection" />
                    </group>
                </search>
            </field>
        </record>

        <!-- Supplier catalogue line form view -->
        <record id="supplier_catalogue_line_form_view" model="ir.ui.view">
            <field name="name">supplier.catalogue.line.form.view</field>
            <field name="model">supplier.catalogue.line</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Supplier catalogue line">
                    <field name="product_id" on_change="product_change(product_id)" />
                    <field name="line_uom_id" />
                    <field name="min_qty" />
                    <field name="unit_price" />
                    <field name="rounding" />
                    <field name="min_order_qty" />
                    <field name="comment" />
                </form>
            </field>
        </record>

        <!-- Supplier catalogue line tree view -->
        <record id="supplier_catalogue_line_tree_view" model="ir.ui.view">
            <field name="name">supplier.catalogue.line.tree.view</field>
            <field name="model">supplier.catalogue.line</field>
            <field name="type">tree</field>
            <field name="priority" eval="16" />
            <field name="arch" type="xml">
                <tree string="Supplier catalogue lines" min_rows="20" editable="top" colors="red: to_correct_ok == True">
                    <field name="line_number" readonly="1"/>
                    <field name="product_id" on_change="product_change(product_id, min_qty, min_order_qty)" />
                    <field name="line_uom_id" on_change="change_uom_qty(line_uom_id, min_qty, min_order_qty)" 
                           domain="[('uom_by_product', '=', product_id)]" />
                    <field name="min_qty" on_change="change_uom_qty(line_uom_id, min_qty, min_order_qty)" />
                    <field name="unit_price" />
                    <field name="rounding" />
                    <field name="min_order_qty" on_change="change_uom_qty(line_uom_id, min_qty, min_order_qty)" />
                    <field name="comment" />
                    <field name="to_correct_ok" invisible="1"/>
                </tree>
            </field>
        </record>

        <!-- Non-editable supplier catalogue line tree view -->
        <record id="non_edit_supplier_catalogue_line_tree_view" model="ir.ui.view">
            <field name="name">non.edit.supplier.catalogue.line.tree.view</field>
            <field name="model">supplier.catalogue.line</field>
            <field name="type">tree</field>
            <field name="priority" eval="99" />
            <field name="arch" type="xml">
                <tree string="Supplier catalogue lines" min_rows="20" 
                    editable="top" noteditable="1" notselectable="0"
                    hide_new_button="1" hide_delete_button="1">
                    <field name="product_id" on_change="product_change(product_id)" />
                    <field name="line_uom_id" />
                    <field name="min_qty" />
                    <field name="unit_price" />
                    <field name="rounding" />
                    <field name="min_order_qty" />
                    <field name="comment" />
                </tree>
            </field>
        </record>

        <!--
            SUPPLIER CATALOGUE ACTIONS
        -->

        <!-- Open the list of all supplier catalogues -->
        <record id="action_supplier_catalogue_list" model="ir.actions.act_window">
            <field name="name">Supplier catalogues</field>
            <field name="res_model">supplier.catalogue</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>

        <!-- Open the list of all supplier catalogue lines -->
        <record id="action_supplier_catalogue_line_list" model="ir.actions.act_window">
            <field name="name">Supplier catalogue lines</field>
            <field name="res_model">supplier.catalogue.line</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
        </record>

        <record id="action_supplier_catalogue_line_non_edit" model="ir.actions.act_window.view">
            <field eval="1" name="sequence"/>
            <field name="view_mode">tree</field>
            <field name="view_id" ref="non_edit_supplier_catalogue_line_tree_view"/>
            <field name="act_window_id" ref="action_supplier_catalogue_line_list"/>
        </record>

        <!--
            SUPPLIER CATALOGUE MENU ENTRIES
        -->

        <!-- Menu in Purchases / Configuration -->
        <menuitem id="menu_supplier_catalogue"
                  action="action_supplier_catalogue_list"
                  sequence="4"
                  parent="purchase.menu_procurement_management" />
        <!-- Menu in Purchases / Configuration -->
        <!-- <menuitem id="menu_supplier_catalogue_line"
                  action="action_supplier_catalogue_line_list"
                  parent="menu_supplier_catalogue" /> -->

        <!--
            SUPPLIER HISTORICAL CATALOGUES
        -->

        <!-- Supplier historical catalogues form view -->
        <record id="supplier_historical_catalogue_form_view" model="ir.ui.view">
            <field name="name">supplier.historical.catalogue.form.view</field>
            <field name="model">supplier.historical.catalogue</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Historical prices parameters">
                    <group colspan="4" col="4">
                        <separator colspan="4" string="Parameters" />
                        <field name="currency_id" widget="selection" />
                        <field name="partner_id" readonly="1" />
                        <field name="from_date" />
                        <field name="to_date" />
                    </group>
                    <group colspan="4" col="4">
                        <separator colspan="4" string="Actions" />
                        <button special="cancel" string="Cancel" icon="gtk-cancel" />
                        <button name="open_historical_prices" type="object" string="Open historical prices" icon="terp-gtk-jump-to-ltr" colspan="3" />
                    </group>
                </form>
            </field>
        </record>

    </data>
</openerp>