summaryrefslogtreecommitdiff
path: root/addons/stock_landed_costs/views/stock_landed_cost_views.xml
blob: 7f0b7beac0970557db711a3737a0d0a823550f72 (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
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
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data>
        <!-- STOCK.LANDED.COST -->
        <record id='view_stock_landed_cost_form' model='ir.ui.view'>
            <field name="name">stock.landed.cost.form</field>
            <field name="model">stock.landed.cost</field>
            <field name="arch" type="xml">
                <form string="Landed Costs">
                    <field name="stock_valuation_layer_ids" invisible="1"/>
                    <header>
                        <button name="button_validate" string="Validate" states="draft" class="oe_highlight" type="object"/>
                        <button name="button_cancel" string="Cancel" states="draft" type="object"/>
                        <field name="state" widget="statusbar" statusbar_visible="draft,done"/>
                    </header>
                    <sheet>
                        <div class="oe_button_box" name="button_box">
                            <button string="Valuation" type="object"
                                name="action_view_stock_valuation_layers"
                                class="oe_stat_button" icon="fa-dollar" groups="stock.group_stock_manager"
                                attrs="{'invisible': ['|' , ('state', 'not in', ['done']), ('stock_valuation_layer_ids', '=', [])]}"/>
                        </div>
                        <div class="oe_title">
                            <label for="name" class="oe_edit_only" string="Landed Cost"/>
                            <h1>
                                <field name="name" placeholder="Landed Cost Name"/>
                            </h1>
                        </div>
                        <group>
                            <group>
                                <field name="date"/>
                                <field name="allowed_picking_ids" invisible="1"/>
                                <field name="target_model" widget="radio" invisible="1"/>
                                <field name="picking_ids" widget="many2many_tags" options="{'no_create_edit': True}" domain="[('id', 'in', allowed_picking_ids)]" attrs="{'invisible': [('target_model', '!=', 'picking')]}"/>
                            </group>
                            <group>
                                <label for="account_journal_id" string="Journal"/>
                                <field name="account_journal_id" nolabel="1"/>
                                <field name="company_id" groups="base.group_multi_company"/>
                                <field name="account_move_id" attrs="{'invisible': [('account_move_id', '=', False)]}"/>
                                <field name="vendor_bill_id"/>
                            </group>
                        </group>
                        <notebook>
                            <page string="Additional Costs" name="additional_costs">
                                <field name="cost_lines">
                                    <form string="Cost Lines">
                                        <group>
                                            <group>
                                                <field name="product_id"
                                                    domain="[('landed_cost_ok', '=', True)]"
                                                    context="{'default_landed_cost_ok': True}"/>
                                                <field name="price_unit"/>
                                                <field name="currency_id" invisible="1"/>
                                            </group>
                                            <group>
                                                <field name="split_method"/>
                                                <field name="account_id" options="{'no_create': True}"/>
                                            </group>
                                        </group>
                                        <label for="name"/>
                                        <field name="name"/>
                                    </form>
                                    <tree string="Cost Lines" editable="bottom">
                                        <field name="product_id"
                                            domain="[('landed_cost_ok', '=', True)]"
                                            context="{'default_landed_cost_ok': True, 'default_type': 'service'}"/>
                                        <field name="name"/>
                                        <field name="account_id" options="{'no_create': True}"/>
                                        <field name="split_method"/>
                                        <field name="price_unit"/>
                                        <field name="currency_id" invisible="1"/>
                                    </tree>
                                </field>
                                <group class="oe_subtotal_footer oe_right">
                                    <field name="currency_id" invisible="1"/>
                                    <field name="amount_total"/>
                                    <button colspan="2" name="compute_landed_cost" string="Compute" type="object" class="oe_right btn-secondary" states='draft'/>
                                </group>
                            </page>
                            <page string="Valuation Adjustments" name="valuation_adjustments">
                                <field name="valuation_adjustment_lines">
                                    <form string="Valuation Adjustments">
                                        <group>
                                            <group>
                                                <field name="product_id"/>
                                                <field name="quantity"/>
                                            </group>
                                            <group>
                                                <field name="currency_id" invisible="1"/>
                                                <field name="former_cost"/>
                                                <field name="additional_landed_cost"/>
                                            </group>
                                        </group>
                                    </form>
                                    <tree string="Valuation Adjustments" editable="bottom" create="0">
                                        <field name="cost_line_id" readonly="1"/>
                                        <field name="product_id" readonly="1"/>
                                        <field name="weight" readonly="1" optional="hide"/>
                                        <field name="volume" readonly="1" optional="hide"/>
                                        <field name="quantity" readonly="1"/>
                                        <field name="currency_id" invisible="1"/>
                                        <field name="former_cost" readonly="1"/>
                                        <field name="final_cost" readonly="1"/>
                                        <field name="additional_landed_cost"/>
                                    </tree>
                                </field>
                            </page>
                        </notebook>
                    </sheet>
                    <div class="oe_chatter">
                        <field name="message_follower_ids"/>
                        <field name="activity_ids"/>
                        <field name="message_ids"/>
                    </div>
                </form>
            </field>
        </record>

        <record id='view_stock_landed_cost_tree' model='ir.ui.view'>
            <field name="name">stock.landed.cost.tree</field>
            <field name="model">stock.landed.cost</field>
            <field name="arch" type="xml">
                <tree string="Landed Costs">
                    <field name="name" decoration-bf="1"/>
                    <field name="date"/>
                    <field name="company_id" groups="base.group_multi_company"/>
                    <field name="state" widget="badge" decoration-success="state == 'done'" decoration-info="state == 'draft'"/>
                    <field name="activity_exception_decoration" widget="activity_exception"/>
                </tree>
            </field>
        </record>

        <record id='view_stock_landed_cost_tree2' model='ir.ui.view'>
            <field name="name">stock.landed.cost.tree</field>
            <field name="model">stock.landed.cost</field>
            <field name="priority">1000</field>
            <field name="arch" type="xml">
                <tree string="Landed Costs">
                    <field name="name"/>
                    <field name="date"/>
                    <field name="currency_id" invisible="1"/>
                    <field name="amount_total" widget="monetary"/>
                    <field name="state"/>
                    <field name="company_id" groups="base.group_multi_company"/>
                </tree>
            </field>
        </record>

        <record id='stock_landed_cost_view_kanban' model='ir.ui.view'>
            <field name="name">stock.landed.cost.kanban</field>
            <field name="model">stock.landed.cost</field>
            <field name="arch" type="xml">
                <kanban class="o_kanban_mobile">
                    <field name="name"/>
                    <field name="date"/>
                    <field name="state"/>
                    <field name="account_journal_id"/>
                    <templates>
                        <t t-name="kanban-box">
                            <div class="oe_kanban_global_click">
                                <div class="row mb4">
                                    <strong class="col-6">
                                        <span t-esc="record.name.value"/>
                                    </strong>
                                    <div class="col-6">
                                        <span class="float-right badge badge-secondary">
                                            <field name="state"/>
                                        </span>
                                    </div>
                                    <div class="col-6">
                                        <i class="fa fa-clock-o" title="Date" role="img" aria-label="Date"/><span t-esc="record.date.value"/>
                                    </div>
                                    <div class="col-6 text-right">
                                        <field name="account_journal_id"/>
                                    </div>
                                </div>
                            </div>
                        </t>
                    </templates>
                </kanban>
            </field>
        </record>

        <record id="view_stock_landed_cost_search" model="ir.ui.view">
            <field name="name">stock.landed.cost.search</field>
            <field name="model">stock.landed.cost</field>
            <field name="arch" type="xml">
                <search string="Landed Costs">
                    <field name="name" string="Name"/>
                    <field name="picking_ids" string="Picking"/>
                    <separator/>
                    <filter string="Draft" name="draft" domain="[('state', '=', 'draft')]"/>
                    <filter string="Done" name="done" domain="[('state', '=', 'done')]"/>
                    <separator/>
                    <filter string="Date" name="date" date="date"/>
                    <separator/>
                    <filter invisible="1" string="Late Activities" name="activities_overdue"
                        domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
                        help="Show all records which has next action date is before today"/>
                    <filter invisible="1" string="Today Activities" name="activities_today"
                        domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
                    <filter invisible="1" string="Future Activities" name="activities_upcoming_all"
                        domain="[('my_activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))]"/>
                    <group expand="0" string="Group By">
                        <filter string="Status" name="status" context="{'group_by': 'state'}"/>
                        <filter string="Date" name="group_by_month" context="{'group_by': 'date'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record id='action_stock_landed_cost' model='ir.actions.act_window'>
            <field name="name">Landed Costs</field>
            <field name="res_model">stock.landed.cost</field>
            <field name="view_mode">tree,form,kanban</field>
            <field name="context">{}</field>
            <field name="help" type="html">
                <p class="o_view_nocontent_smiling_face">
                    Create a new landed cost
                </p>
            </field>
        </record>

        <menuitem action="action_stock_landed_cost" name="Landed Costs" parent="stock.menu_stock_warehouse_mgmt" id="menu_stock_landed_cost" sequence="115"/>
    </data>
</odoo>