|
6 | 6 | <field name="state">code</field>
|
7 | 7 | <field name="code"><![CDATA[
|
8 | 8 | for record in records:
|
9 |
| - if record.x_studio_standard_rule or not record.x_studio_pos_product_category_ids: |
| 9 | + if record.x_standard_rule or not record.x_pos_product_category_ids: |
10 | 10 | record['push_domain'] = []
|
11 | 11 | else:
|
12 |
| - record['push_domain'] = [ |
13 |
| - ("product_id.pos_categ_ids", "in", record.x_studio_pos_product_category_ids.ids) |
14 |
| - ] |
| 12 | + record['push_domain'] = [("product_id.pos_categ_ids", "in", record.x_pos_product_category_ids.ids)] |
15 | 13 | ]]></field>
|
16 | 14 | </record>
|
17 | 15 | <record id="action_update_automatic_activation_on_product" model="ir.actions.server">
|
18 | 16 | <field name="code"><![CDATA[
|
19 |
| -records.filtered(lambda r: r.product_selectable).write({ |
20 |
| - 'x_studio_automatic_activation_on_product': False |
21 |
| -}) |
22 |
| -records.filtered(lambda r: not r.product_selectable).write({ |
23 |
| - 'x_studio_automatic_activation_on_product': True |
24 |
| -}) |
| 17 | +for route in records: |
| 18 | + route['x_automatic_activation_on_product'] = not route.product_selectable |
25 | 19 | ]]></field>
|
26 | 20 | <field name="model_id" ref="stock.model_stock_route"/>
|
27 | 21 | <field name="state">code</field>
|
28 | 22 | <field name="name">Execute Code</field>
|
29 | 23 | </record>
|
30 |
| - <record id="make_route_on_product_create" model="ir.actions.server"> |
31 |
| - <field name="code"><![CDATA[ |
32 |
| -record.write({'route_ids': [(6, 0, [env.ref('library.stock_route_4').id])]}) |
33 |
| -]]></field> |
34 |
| - <field name="model_id" ref="product.model_product_template"/> |
35 |
| - <field name="state">code</field> |
36 |
| - <field name="name">Execute Code</field> |
37 |
| - </record> |
38 | 24 | <record id="action_update_destination_location_on_picking" model="ir.actions.server">
|
39 | 25 | <field name="code"><![CDATA[
|
40 |
| -for record in records.filtered(lambda r: r.picking_type_id and r.picking_type_id.x_studio_overrule_customer_location): |
41 |
| - record.write({ |
42 |
| - "location_dest_id": record.picking_type_id.default_location_dest_id.id |
43 |
| - }) |
| 26 | +records.filtered('picking_type_id.x_overrule_customer_location').write({"location_dest_id": record.picking_type_id.default_location_dest_id.id}) |
44 | 27 | ]]></field>
|
45 | 28 | <field name="model_id" ref="stock.model_stock_picking"/>
|
46 | 29 | <field name="state">code</field>
|
47 | 30 | <field name="name">Execute Code</field>
|
48 | 31 | </record>
|
| 32 | + <record id="make_route_on_product_create" model="ir.actions.server"> |
| 33 | + <field name="model_id" ref="product.model_product_template"/> |
| 34 | + <field name="state">object_write</field> |
| 35 | + <field name="update_path">route_ids</field> |
| 36 | + <field name="crud_model_id" ref="product.model_product_template"/> |
| 37 | + <field name="update_field_id" ref="stock.field_product_template__route_ids"/> |
| 38 | + <field name="name">Update Product</field> |
| 39 | + <field name="resource_ref" ref="stock_route_4"/> |
| 40 | + </record> |
49 | 41 | </odoo>
|
0 commit comments