summaryrefslogtreecommitdiff
path: root/addons/stock/views/product_strategy_views.xml
blob: 02fa6d0a096e0dd1fd13ae1b10c72b7f1801a256 (plain)
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
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="stock_putaway_list" model="ir.ui.view">
        <field name="name">stock.putaway.rule.tree</field>
        <field name="model">stock.putaway.rule</field>
        <field name="arch" type="xml">
            <tree string="Putaway Rules" editable="bottom" sample='1'>
                <field name="sequence" widget="handle"
                       invisible="context.get('invisible_handle', False)"/>
                <field name="product_id"
                       attrs="{'readonly': [('category_id', '!=', False)], 'required': [('category_id', '=', False)]}"
                       options="{'no_create': True, 'no_open': True}"
                       readonly="context.get('single_product', False)"
                       force_save="1"/>
                <field name="category_id"
                       attrs="{'readonly': [('product_id', '!=', False)], 'required': [('product_id', '=', False)]}"
                       options="{'no_create': True, 'no_open': True}"
                       readonly="context.get('fixed_category', False)"
                       force_save="1"/>
                <field name="location_in_id"
                       options="{'no_create': True}"
                       readonly="context.get('fixed_location', False)"/>
                <field name="location_out_id" attrs="{'readonly': [('location_in_id', '=', False)]}"
                       options="{'no_create': True}"/>
                <field name="company_id" groups="stock.group_stock_multi_locations" force_save="1" readonly="context.get('fixed_location', False)" options="{'no_create': True}"/>
            </tree>
        </field>
    </record>

    <record id="view_removal" model="ir.ui.view">
        <field name="name">product.removal.form</field>
        <field name="model">product.removal</field>
        <field name="arch" type="xml">
            <form string="Removal">
                <group col="4">
                    <field name="name"/>
                    <field name="method"/>
                </group>
           </form>
        </field>
    </record>

    <record id="action_putaway_tree" model="ir.actions.act_window">
        <field name="name">Putaways Rules</field>
        <field name="res_model">stock.putaway.rule</field>
        <field name="type">ir.actions.act_window</field>
        <field name="view_mode">tree</field>
        <field name="view_id" ref="stock_putaway_list"/>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                No putaway rule found. Let's create one!
            </p><p>
                Create new putaway rules to dispatch automatically specific products to their appropriate destination location upon receptions.
            </p>
        </field>
    </record>

    <record id="view_putaway_search" model="ir.ui.view">
        <field name="name">stock.putaway.rule.search</field>
        <field name="model">stock.putaway.rule</field>
        <field name="arch" type="xml">
            <search string="Putaway Rules">
                <field name="product_id"/>
                <field name="category_id"/>
                <field name="location_in_id"/>
                <field name="location_out_id"/>
                <group expand='0' string='Filters'>
                    <filter name="filter_to_rules_on_product"
                            string="Rules on Products"
                            domain="[('product_id', '!=', False)]"/>
                    <filter name="filter_to_rules_on_category"
                            string="Rules on Categories"
                            domain="[('category_id' ,'!=', False)]"/>
                </group>
                <group expand="0" string="Group By">
                        <filter string="Location: When arrives to" name="location_in" context="{'group_by':'location_in_id'}"/>
                        <filter string="Location: Store to" name="location_out" context="{'group_by':'location_out_id'}"/>
                    </group>
            </search>
        </field>
    </record>

    <record model="ir.actions.act_window" id="category_open_putaway"> <!-- Putaway rules from category -->
        <field name="name">Putaway Rules</field>
        <field name="res_model">stock.putaway.rule</field>
        <field name="context">{
            'search_default_category_id': [active_id],
            'fixed_category': True,
        }</field>
    </record>
    <record model="ir.actions.act_window" id="location_open_putaway"> <!-- Putaway rules from location -->
        <field name="name">Putaway Rules</field>
        <field name="res_model">stock.putaway.rule</field>
        <field name="context">{'fixed_location': True}</field>
        <field name="domain">['|', ('location_out_id', '=', active_id), ('location_in_id', '=', active_id)]</field>
    </record>

    <menuitem id="menu_putaway" name="Putaway Rules" parent="stock.menu_warehouse_config"
        action="action_putaway_tree" sequence="5" groups="stock.group_stock_multi_locations"/>
</odoo>