stock_landed_cost_views.xml 13 KB

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