~akretion-team/openerp-connector-magento/connector-magento-fix-product-view-dbl

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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <record id="view_magento_backend_form" model="ir.ui.view">
            <field name="name">magento.backend.form</field>
            <field name="model">magento.backend</field>
            <field name="arch" type="xml">
                <form string="Magento Backend" version="7.0">
                    <header>
                      <button name="synchronize_metadata"
                        type="object"
                        class="oe_highlight"
                        string="Synchronize Metadata"/>
                    </header>
                    <sheet>
                        <label for="name" class="oe_edit_only"/>
                        <h1>
                            <field name="name" class="oe_inline" />
                        </h1>
                        <group name="magento" string="Magento Configuration">
                            <group colspan="4" col="4">
                                <field name="version" colspan="4"/>
                                <field name="location" placeholder="e.g. http://my.magento.com"
                                    colspan="4"/>
                                <field name="username" colspan="2"/>
                                <field name="password" colspan="2"/>
                            </group>
                        </group>
                        <group name="main_configuration" string="Main Configuration">
                            <field name="warehouse_id"/>
                        </group>
                        <notebook>
                            <page name="import" string="Imports">
                                <p class="oe_grey oe_inline">
                                    By clicking on the buttons,
                                    you will initiate the synchronizations
                                    with Magento.
                                    Note that the import or exports
                                    won't be done directly,
                                    they will create 'Jobs'
                                    executed as soon as possible.
                                </p>
                                <p class="oe_grey oe_inline">
                                    Once imported,
                                    some types of records,
                                    like the products or categories,
                                    need a manual review.
                                    You will find the list
                                    of the new records to review
                                    in the menu 'Connectors > Checkpoint'.
                                </p>
                                <group>
                                    <label string="Import all customer groups" class="oe_inline"/>
                                    <div>
                                        <button name="import_customer_groups"
                                            type="object"
                                            class="oe_highlight"
                                            string="Import in background"/>
                                    </div>
                                </group>
                                <group>
                                    <label string="Import partners from all websites" class="oe_inline"/>
                                    <button name="import_partners"
                                        type="object"
                                        class="oe_highlight"
                                        string="Import in background"/>
                                </group>
                                <group>
                                    <div>
                                        <label string="Import products categories since" class="oe_inline"/>
                                        <field name="import_categories_from_date"
                                            class="oe_inline"
                                            nolabel="1"/>
                                    </div>
                                    <button name="import_product_categories"
                                        type="object"
                                        class="oe_highlight"
                                        string="Import in background"/>
                                </group>
                                <group>
                                    <div>
                                        <label string="Import products since" class="oe_inline"/>
                                        <field name="import_products_from_date"
                                            class="oe_inline"
                                            nolabel="1"/>
                                    </div>
                                    <button name="import_product_product"
                                        type="object"
                                        class="oe_highlight"
                                        string="Import in background"/>
                                </group>
                                <group>
                                    <label string="Import sales orders from all store views" class="oe_inline"/>
                                    <button name="import_sale_orders"
                                        type="object"
                                        class="oe_highlight"
                                        string="Import in background"/>
                                </group>
                                <group>
                                    <label string="Update all the products stock quantities" class="oe_inline"/>
                                    <button name="update_product_stock_qty"
                                        type="object"
                                        class="oe_highlight"
                                        string="Update"/>
                                </group>

                            </page>

                            <page name="advanced_configuration" string="Advanced Configuration">
                                <group>
                                    <field name="default_lang_id" widget="selection"/>
                                    <field name="default_category_id"/>
                                    <field name="sale_prefix" placeholder="mag-" />
                                    <field name="product_stock_field_id" widget="selection"
                                        domain="[('model', 'in', ['product.product', 'product.template']), ('ttype', '=', 'float')]"/>
                                </group>
                            </page>

                            <page name="website" string="Websites">
                                <group string="Websites">
                                    <field name="website_ids" nolabel="1"/>
                                </group>
                            </page>

                        </notebook>
                    </sheet>
                </form>
            </field>
        </record>

        <record id="view_magento_backend_tree" model="ir.ui.view">
            <field name="name">magento.backend.tree</field>
            <field name="model">magento.backend</field>
            <field name="arch" type="xml">
                <tree string="Magento Backend" version="7.0">
                    <field name="name"/>
                    <field name="location"/>
                </tree>
            </field>
        </record>

        <record id="action_magento_backend" model="ir.actions.act_window">
            <field name="name">Magento Backends</field>
            <field name="res_model">magento.backend</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="view_magento_backend_tree"/>
        </record>


        <record id="view_magento_website_form" model="ir.ui.view">
            <field name="name">magento.website.form</field>
            <field name="model">magento.website</field>
            <field name="arch" type="xml">
                <form string="Magento Website" create="false"
                        delete="false" version="7.0">
                    <sheet>
                        <h1>
                            <field name="name" class="oe_inline"/>
                        </h1>
                        <group string="Informations">
                            <field name="magento_id" invisible="1"/>
                            <field name="backend_id" readonly="1"/>
                            <field name="code"/>
                            <field name="sort_order"/>
                        </group>
                        <group string="Options" name="options">
                        </group>
                        <notebook>
                            <page name="import" string="Imports">
                                <group>
                                    <div>
                                        <label string="Import partners since" class="oe_inline"/>
                                        <field name="import_partners_from_date"
                                            class="oe_inline"
                                            nolabel="1"/>
                                    </div>
                                    <button name="import_partners"
                                        type="object"
                                        class="oe_highlight"
                                        string="Import in background"/>
                                </group>
                            </page>

                            <page name="store" string="Stores">
                                <group string="Stores">
                                    <field name="store_ids" nolabel="1"/>
                                </group>
                            </page>

                        </notebook>
                    </sheet>
                </form>
            </field>
        </record>

        <record id="view_magento_website_tree" model="ir.ui.view">
            <field name="name">magento.website.tree</field>
            <field name="model">magento.website</field>
            <field name="arch" type="xml">
                <tree string="Magento Website" create="false"
                        delete="false" version="7.0">
                    <field name="name"/>
                    <field name="backend_id"/>
                    <field name="code"/>
                    <field name="sort_order"/>
                </tree>
            </field>
        </record>

        <record id="action_magento_website" model="ir.actions.act_window">
            <field name="name">Magento Websites</field>
            <field name="res_model">magento.website</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="view_magento_website_tree"/>
        </record>


        <record id="view_magento_store_form" model="ir.ui.view">
            <field name="name">magento.store.form</field>
            <field name="model">magento.store</field>
            <field name="arch" type="xml">
                <form string="Magento Store" create="false"
                        delete="false" version="7.0">
                    <sheet>
                        <h1>
                            <field name="name" class="oe_inline"/>
                        </h1>
                        <group string="Informations">
                            <field name="website_id"/>
                            <field name="openerp_id"/>
                        </group>
                        <group string="Options">
                            <field name="send_picking_done_mail"/>
                            <field name="send_invoice_paid_mail"/>
                            <field name="create_invoice_on"/>
                        </group>

                        <notebook>
                            <page name="storeview" string="Storeviews">
                                <group string="Storeviews">
                                    <field name="storeview_ids" nolabel="1"/>
                                </group>
                            </page>
                        </notebook>
                    </sheet>
                </form>
            </field>
        </record>

        <record id="view_magento_store_tree" model="ir.ui.view">
            <field name="name">magento.store.tree</field>
            <field name="model">magento.store</field>
            <field name="arch" type="xml">
                <tree string="Magento Store" create="false"
                        delete="false" version="7.0">
                    <field name="name"/>
                    <field name="website_id"/>
                    <field name="openerp_id"/>
                </tree>
            </field>
        </record>

        <record id="action_magento_store" model="ir.actions.act_window">
            <field name="name">Magento Stores</field>
            <field name="res_model">magento.store</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="view_magento_store_tree"/>
        </record>


        <record id="view_magento_storeview_form" model="ir.ui.view">
            <field name="name">magento.storeview.form</field>
            <field name="model">magento.storeview</field>
            <field name="arch" type="xml">
                <form string="Magento Storeview" create="false"
                        delete="false" version="7.0">
                    <sheet>
                        <h1>
                            <field name="name" class="oe_inline"/>
                        </h1>
                        <group string="Informations">
                            <field name="code"/>
                            <field name="store_id"/>
                            <field name="sort_order"/>
                            <field name="enabled"/>
                        </group>
                        <group string="Options">
                            <field name="lang_id" widget="selection"/>
                        </group>
                        <notebook>
                            <page name="import" string="Imports">
                                <group colspan="4">
                                  <div>
                                    <label string="Import Sale Orders since"
                                           class="oe_inline"/>
                                    <field name='import_orders_from_date'
                                           class="oe_inline"
                                           nolabel="1"/>
                                  </div>
                                  <button name="import_sale_orders"
                                          type="object"
                                          class="oe_highlight"
                                          string="Import Sale Orders"/>

                                </group>
                            </page>

                        </notebook>
                    </sheet>
                </form>
            </field>
        </record>

        <record id="view_magento_storeview_tree" model="ir.ui.view">
            <field name="name">magento.storeview.tree</field>
            <field name="model">magento.storeview</field>
            <field name="arch" type="xml">
                <tree string="Magento Storeview" create="false"
                        delete="false" version="7.0">
                    <field name="name"/>
                    <field name="code"/>
                    <field name="enabled"/>
                    <field name="sort_order"/>
                    <field name="store_id"/>
                </tree>
            </field>
        </record>

        <record id="action_magento_storeview" model="ir.actions.act_window">
            <field name="name">Magento Storeviews</field>
            <field name="res_model">magento.storeview</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="view_id" ref="view_magento_storeview_tree"/>
        </record>
    </data>
</openerp>