| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<odoo> |
| 3 |
<data> |
| 4 |
|
| 5 |
<record id='view_stock_landed_cost_form' model='ir.ui.view'> |
| 6 |
<field name="name">stock.landed.cost.form</field> |
| 7 |
<field name="model">stock.landed.cost</field> |
| 8 |
<field name="arch" type="xml"> |
| 9 |
<form string="Landed Costs"> |
| 10 |
<field name="company_id" invisible="1"/> |
| 11 |
<header> |
| 12 |
<button name="button_validate" string="Validate" invisible="state != 'draft'" class="oe_highlight" type="object"/> |
| 13 |
<button name="button_cancel" string="Cancel" invisible="state != 'draft'" type="object"/> |
| 14 |
<field name="state" widget="statusbar" statusbar_visible="draft,done"/> |
| 15 |
</header> |
| 16 |
<sheet> |
| 17 |
<div class="oe_title"> |
| 18 |
<label for="name" string="Landed Cost"/> |
| 19 |
<h1> |
| 20 |
<field name="name"/> |
| 21 |
</h1> |
| 22 |
</div> |
| 23 |
<group> |
| 24 |
<group> |
| 25 |
<field name="date" readonly="state == 'done'"/> |
| 26 |
<field name="target_model" widget="radio" invisible="1" readonly="state == 'done'"/> |
| 27 |
<field name="picking_ids" widget="many2many_tags" |
| 28 |
options="{'no_create_edit': True}" invisible="target_model != 'picking'" readonly="state == 'done'" |
| 29 |
domain="[('company_id', '=', company_id), '|', ('move_ids.is_in', '!=', False), ('move_ids.is_out', '!=', False)]"/> |
| 30 |
</group> |
| 31 |
<group> |
| 32 |
<label for="account_journal_id" string="Journal"/> |
| 33 |
<field name="account_journal_id" nolabel="1" readonly="state == 'done'"/> |
| 34 |
<field name="company_id" groups="base.group_multi_company"/> |
| 35 |
<field name="account_move_id" invisible="not account_move_id"/> |
| 36 |
<field name="vendor_bill_id"/> |
| 37 |
</group> |
| 38 |
</group> |
| 39 |
<notebook> |
| 40 |
<page string="Additional Costs" name="additional_costs"> |
| 41 |
<field name="cost_lines" readonly="state == 'done'"> |
| 42 |
<form string="Cost Lines"> |
| 43 |
<group> |
| 44 |
<group> |
| 45 |
<field name="product_id" |
| 46 |
domain="[('landed_cost_ok', '=', True)]" |
| 47 |
context="{'default_landed_cost_ok': True}"/> |
| 48 |
<field name="price_unit"/> |
| 49 |
<field name="currency_id" invisible="1"/> |
| 50 |
</group> |
| 51 |
<group> |
| 52 |
<field name="split_method"/> |
| 53 |
<field name="account_id" options="{'no_create': True}"/> |
| 54 |
</group> |
| 55 |
</group> |
| 56 |
<label for="name"/> |
| 57 |
<field name="name"/> |
| 58 |
</form> |
| 59 |
<list string="Cost Lines" editable="bottom"> |
| 60 |
<field name="product_id" |
| 61 |
domain="[('landed_cost_ok', '=', True)]" |
| 62 |
context="{'default_landed_cost_ok': True, 'default_type': 'service'}"/> |
| 63 |
<field name="name"/> |
| 64 |
<field name="account_id" options="{'no_create': True}"/> |
| 65 |
<field name="split_method"/> |
| 66 |
<field name="price_unit"/> |
| 67 |
<field name="currency_id" column_invisible="True"/> |
| 68 |
</list> |
| 69 |
</field> |
| 70 |
<group class="oe_subtotal_footer"> |
| 71 |
<field name="currency_id" invisible="1"/> |
| 72 |
<field name="amount_total"/> |
| 73 |
<button colspan="2" name="compute_landed_cost" string="Compute" type="object" class="float-end btn-secondary" invisible="state != 'draft'"/> |
| 74 |
</group> |
| 75 |
</page> |
| 76 |
<page string="Valuation Adjustments" name="valuation_adjustments"> |
| 77 |
<field name="valuation_adjustment_lines" readonly="state == 'done'"> |
| 78 |
<form string="Valuation Adjustments"> |
| 79 |
<group> |
| 80 |
<group> |
| 81 |
<field name="product_id"/> |
| 82 |
<field name="quantity"/> |
| 83 |
</group> |
| 84 |
<group> |
| 85 |
<field name="currency_id" invisible="1"/> |
| 86 |
<field name="former_cost"/> |
| 87 |
<field name="additional_landed_cost"/> |
| 88 |
</group> |
| 89 |
</group> |
| 90 |
</form> |
| 91 |
<list string="Valuation Adjustments" editable="bottom" create="0"> |
| 92 |
<field name="cost_line_id" readonly="1"/> |
| 93 |
<field name="product_id" readonly="1"/> |
| 94 |
<field name="weight" readonly="1" optional="hide"/> |
| 95 |
<field name="volume" readonly="1" optional="hide"/> |
| 96 |
<field name="quantity" readonly="1"/> |
| 97 |
<field name="currency_id" column_invisible="True"/> |
| 98 |
<field name="former_cost" readonly="1"/> |
| 99 |
<field name="final_cost" readonly="1"/> |
| 100 |
<field name="additional_landed_cost"/> |
| 101 |
</list> |
| 102 |
</field> |
| 103 |
</page> |
| 104 |
</notebook> |
| 105 |
</sheet> |
| 106 |
<chatter/> |
| 107 |
</form> |
| 108 |
</field> |
| 109 |
</record> |
| 110 |
|
| 111 |
<record id='view_stock_landed_cost_tree' model='ir.ui.view'> |
| 112 |
<field name="name">stock.landed.cost.list</field> |
| 113 |
<field name="model">stock.landed.cost</field> |
| 114 |
<field name="arch" type="xml"> |
| 115 |
<list string="Landed Costs" decoration-info="state == 'draft'" decoration-muted="state == 'cancel'"> |
| 116 |
<field name="name" decoration-bf="1"/> |
| 117 |
<field name="date" readonly="state == 'done'"/> |
| 118 |
<field name="company_id" groups="base.group_multi_company"/> |
| 119 |
<field name="state" widget="badge" decoration-success="state == 'done'" decoration-info="state == 'draft'"/> |
| 120 |
<field name="activity_exception_decoration" widget="activity_exception"/> |
| 121 |
</list> |
| 122 |
</field> |
| 123 |
</record> |
| 124 |
|
| 125 |
<record id='view_stock_landed_cost_tree2' model='ir.ui.view'> |
| 126 |
<field name="name">stock.landed.cost.list</field> |
| 127 |
<field name="model">stock.landed.cost</field> |
| 128 |
<field name="priority">1000</field> |
| 129 |
<field name="arch" type="xml"> |
| 130 |
<list string="Landed Costs"> |
| 131 |
<field name="name"/> |
| 132 |
<field name="date" readonly="state == 'done'"/> |
| 133 |
<field name="currency_id" column_invisible="True"/> |
| 134 |
<field name="amount_total" widget="monetary"/> |
| 135 |
<field name="state"/> |
| 136 |
<field name="company_id" groups="base.group_multi_company"/> |
| 137 |
</list> |
| 138 |
</field> |
| 139 |
</record> |
| 140 |
|
| 141 |
<record id='stock_landed_cost_view_kanban' model='ir.ui.view'> |
| 142 |
<field name="name">stock.landed.cost.kanban</field> |
| 143 |
<field name="model">stock.landed.cost</field> |
| 144 |
<field name="arch" type="xml"> |
| 145 |
<kanban class="o_kanban_mobile"> |
| 146 |
<templates> |
| 147 |
<t t-name="card"> |
| 148 |
<div class="row mb-1"> |
| 149 |
<field name="name" class="col-6 fw-bolder"/> |
| 150 |
<div class="col-6"> |
| 151 |
<field name="state" class="float-end badge text-bg-secondary"/> |
| 152 |
</div> |
| 153 |
</div> |
| 154 |
<div class="row"> |
| 155 |
<div class="col-6"> |
| 156 |
<i class="fa fa-clock-o" title="Date" role="img" aria-label="Date"/><field name="date"/> |
| 157 |
</div> |
| 158 |
<field name="account_journal_id" class="col-6 text-end" readonly="state == 'done'"/> |
| 159 |
</div> |
| 160 |
</t> |
| 161 |
</templates> |
| 162 |
</kanban> |
| 163 |
</field> |
| 164 |
</record> |
| 165 |
|
| 166 |
<record id="view_stock_landed_cost_search" model="ir.ui.view"> |
| 167 |
<field name="name">stock.landed.cost.search</field> |
| 168 |
<field name="model">stock.landed.cost</field> |
| 169 |
<field name="arch" type="xml"> |
| 170 |
<search string="Landed Costs"> |
| 171 |
<field name="name" string="Name"/> |
| 172 |
<field name="picking_ids" string="Picking"/> |
| 173 |
<separator/> |
| 174 |
<filter string="Draft" name="draft" domain="[('state', '=', 'draft')]"/> |
| 175 |
<filter string="Done" name="done" domain="[('state', '=', 'done')]"/> |
| 176 |
<separator/> |
| 177 |
<filter string="Date" name="date" date="date"/> |
| 178 |
<separator/> |
| 179 |
<filter invisible="1" string="My Activities" name="filter_activities_my" |
| 180 |
domain="[('activity_user_id', '=', uid)]"/> |
| 181 |
<separator invisible="1"/> |
| 182 |
<filter invisible="1" string="Late Activities" name="activities_overdue" |
| 183 |
domain="[('my_activity_date_deadline', '<', 'today')]" |
| 184 |
help="Show all records whose next activity date is past"/> |
| 185 |
<filter invisible="1" string="Today Activities" name="activities_today" |
| 186 |
domain="[('my_activity_date_deadline', '=', 'today')]"/> |
| 187 |
<filter invisible="1" string="Future Activities" name="activities_upcoming_all" |
| 188 |
domain="[('my_activity_date_deadline', '>', 'today')]"/> |
| 189 |
<group> |
| 190 |
<filter string="Status" name="status" context="{'group_by': 'state'}"/> |
| 191 |
<filter string="Date" name="group_by_month" context="{'group_by': 'date'}"/> |
| 192 |
</group> |
| 193 |
</search> |
| 194 |
</field> |
| 195 |
</record> |
| 196 |
|
| 197 |
<record id='action_stock_landed_cost' model='ir.actions.act_window'> |
| 198 |
<field name="name">Landed Costs</field> |
| 199 |
<field name="res_model">stock.landed.cost</field> |
| 200 |
<field name="path">landed-costs</field> |
| 201 |
<field name="view_mode">list,form,kanban</field> |
| 202 |
<field name="context">{}</field> |
| 203 |
<field name="help" type="html"> |
| 204 |
<p class="o_view_nocontent_smiling_face"> |
| 205 |
Create a new landed cost |
| 206 |
</p><p> |
| 207 |
Landed costs allow you to include additional costs (shipment, insurance, customs duties, etc) into the cost of the product. |
| 208 |
</p> |
| 209 |
</field> |
| 210 |
</record> |
| 211 |
|
| 212 |
<menuitem action="action_stock_landed_cost" name="Landed Costs" parent="stock.menu_stock_adjustments" id="menu_stock_landed_cost" sequence="115"/> |
| 213 |
</data> |
| 214 |
</odoo> |