stock_move_views.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="mrp_subcontracting_stock_move_line_tree_view" model="ir.ui.view">
  4. <field name="name">mrp.subcontracting.stock.move.line.tree.view</field>
  5. <field name="model">stock.move.line</field>
  6. <field name="priority">1000</field>
  7. <field name="arch" type="xml">
  8. <tree editable="bottom">
  9. <field name="company_id" invisible="1"/>
  10. <field name="product_uom_category_id" invisible="1"/>
  11. <field name="owner_id" invisible="1"/>
  12. <field name="tracking" invisible="1"/>
  13. <field name="package_id" invisible="1"/>
  14. <field name="result_package_id" invisible="1"/>
  15. <field name="location_id" invisible="1"/>
  16. <field name="location_dest_id" invisible="1"/>
  17. <field name="state" invisible="1"/>
  18. <!-- Don't put move_id here to avoid that the framework send falsy move_id -->
  19. <field name="id" invisible="1"/>
  20. <field name="product_id" required="1" domain="[('id', 'in', context.get('bom_product_ids'))] if context.get('is_subcontracting_portal') else []"/>
  21. <field name="lot_id" groups="stock.group_production_lot"
  22. attrs="{'invisible': [('tracking', 'not in', ('serial', 'lot'))], 'required': [('tracking', 'in', ('serial', 'lot'))]}"
  23. context="{'default_product_id': product_id, 'default_company_id': company_id}"/>
  24. <field name="reserved_uom_qty" readonly="1" force_save="1"/>
  25. <field name="qty_done"
  26. decoration-warning="reserved_uom_qty &lt; qty_done"
  27. decoration-success="reserved_uom_qty == qty_done"/>
  28. <field name="product_uom_id" groups="uom.group_uom"/>
  29. </tree>
  30. </field>
  31. </record>
  32. <record id="mrp_subcontracting_portal_stock_move_line_tree_view" model="ir.ui.view">
  33. <field name="name">mrp.subcontracting.portal.stock.move.line.tree.view</field>
  34. <field name="model">stock.move.line</field>
  35. <field name="mode">primary</field>
  36. <field name="priority">1000</field>
  37. <field name="inherit_id" ref="mrp_subcontracting_stock_move_line_tree_view" />
  38. <field name="arch" type="xml">
  39. <xpath expr="//field[@name='lot_id']" position="attributes">
  40. <attribute name="options">{'no_create_edit': True, 'no_open': True}</attribute>
  41. </xpath>
  42. <xpath expr="//field[@name='product_id']" position="attributes">
  43. <attribute name="options">{'no_open': True}</attribute>
  44. </xpath>
  45. </field>
  46. </record>
  47. <record id="mrp_subcontracting_view_stock_move_line_operation_tree" model="ir.ui.view">
  48. <field name="name">mrp.subcontracting.stock.move.line.operations.tree</field>
  49. <field name="model">stock.move.line</field>
  50. <field name="mode">primary</field>
  51. <field name="priority">1000</field>
  52. <field name="inherit_id" ref="stock.view_stock_move_line_operation_tree" />
  53. <field name="arch" type="xml">
  54. <xpath expr="//field[@name='lot_id']" position="attributes">
  55. <attribute name="options">{'no_create_edit': True, 'no_open': True}</attribute>
  56. </xpath>
  57. </field>
  58. </record>
  59. <record id="mrp_subcontracting_view_stock_move_operations" model="ir.ui.view">
  60. <field name="name">mrp.subcontracting.stock.move.operations.form</field>
  61. <field name="model">stock.move</field>
  62. <field name="mode">primary</field>
  63. <field name="priority">1000</field>
  64. <field name="inherit_id" ref="stock.view_stock_move_operations" />
  65. <field name="arch" type="xml">
  66. <xpath expr="//field[@name='move_line_ids']" position="attributes">
  67. <attribute name="context">{'tree_view_ref': 'mrp_subcontracting.mrp_subcontracting_view_stock_move_line_operation_tree', 'default_product_uom_id': product_uom, 'default_picking_id': picking_id, 'default_move_id': id, 'default_product_id': product_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_company_id': company_id}</attribute>
  68. </xpath>
  69. </field>
  70. </record>
  71. <record id="mrp_subcontracting_view_stock_move_nosuggest_operations" model="ir.ui.view">
  72. <field name="name">mrp.subcontracting.stock.move.operations.nosuggest.form</field>
  73. <field name="model">stock.move</field>
  74. <field name="mode">primary</field>
  75. <field name="priority">1000</field>
  76. <field name="inherit_id" ref="stock.view_stock_move_nosuggest_operations" />
  77. <field name="arch" type="xml">
  78. <xpath expr="//field[@name='move_line_nosuggest_ids']" position="attributes">
  79. <attribute name="context">{'tree_view_ref': 'mrp_subcontracting.mrp_subcontracting_view_stock_move_line_operation_tree','default_picking_id': picking_id, 'default_move_id': id, 'default_product_id': product_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_company_id': company_id}</attribute>
  80. </xpath>
  81. </field>
  82. </record>
  83. <record id="mrp_subcontracting_move_form_view" model="ir.ui.view">
  84. <field name="name">mrp.subcontracting.move.form.view</field>
  85. <field name="model">stock.move</field>
  86. <field name="priority">1000</field>
  87. <field name="arch" type="xml">
  88. <form create="0" delete="0">
  89. <header>
  90. <field name="state" widget="statusbar"/>
  91. </header>
  92. <sheet>
  93. <field name="product_uom_category_id" invisible="1"/>
  94. <field name="company_id" invisible="1"/>
  95. <field name="product_id" invisible="1"/>
  96. <field name="sequence" invisible="1"/>
  97. <field name="location_id" invisible="1"/>
  98. <field name="picking_id" invisible="1"/>
  99. <field name="location_dest_id" invisible="1"/>
  100. <field name="has_tracking" invisible="1"/>
  101. <field name="product_uom" invisible="1"/>
  102. <field name="product_uom_qty" invisible="1"/>
  103. <group>
  104. <field name="order_finished_lot_id"/>
  105. <field name="product_uom" groups="uom.group_uom"/>
  106. <field name="quantity_done" string="Total Consumed" readonly="1"/>
  107. </group>
  108. <field name="move_line_ids"
  109. attrs="{'readonly': [('state', 'in', ['done', 'cancel'])]}"
  110. context="{'default_product_uom_id': product_uom, 'default_picking_id': picking_id, 'default_move_id': id, 'default_product_id': product_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id, 'default_company_id': company_id}">
  111. <tree editable="bottom" decoration-muted="state in ('done', 'cancel')">
  112. <field name="company_id" invisible="1"/>
  113. <field name="state" invisible="1"/>
  114. <field name="tracking" invisible="1"/>
  115. <field name="product_uom_id" invisible="1"/>
  116. <field name="product_uom_category_id" invisible="1"/>
  117. <field name="picking_id" invisible="1"/>
  118. <field name="move_id" invisible="1"/>
  119. <field name="location_id" invisible="1"/>
  120. <field name="location_dest_id" invisible="1"/>
  121. <field name="product_id" readonly="1" force_save="1"/>
  122. <field name="qty_done"/>
  123. <field name="lot_id" attrs="{'column_invisible':[('parent.has_tracking', 'not in', ('serial', 'lot'))], 'required': [('tracking', 'in', ('serial', 'lot'))]}" context="{'default_product_id': product_id, 'default_company_id': company_id}" groups="stock.group_production_lot"/>
  124. </tree>
  125. </field>
  126. </sheet>
  127. </form>
  128. </field>
  129. </record>
  130. <record id="mrp_subcontracting_portal_move_form_view" model="ir.ui.view">
  131. <field name="name">mrp.subcontracting.portal.move.form.view</field>
  132. <field name="model">stock.move</field>
  133. <field name="mode">primary</field>
  134. <field name="priority">1000</field>
  135. <field name="inherit_id" ref="mrp_subcontracting_move_form_view" />
  136. <field name="arch" type="xml">
  137. <xpath expr="//field[@name='order_finished_lot_id']" position="attributes">
  138. <attribute name="options">{'no_open': True}</attribute>
  139. </xpath>
  140. <xpath expr="//tree" position="attributes">
  141. <attribute name="no_open">1</attribute>
  142. </xpath>
  143. <xpath expr="//tree/field[@name='lot_id']" position="attributes">
  144. <attribute name="options">{'no_create_edit': True, 'no_open': True}</attribute>
  145. </xpath>
  146. </field>
  147. </record>
  148. <record id="mrp_subcontracting_move_tree_view" model="ir.ui.view">
  149. <field name="name">mrp.subcontracting.move.tree.view</field>
  150. <field name="model">stock.move</field>
  151. <field name="priority">1000</field>
  152. <field name="arch" type="xml">
  153. <tree delete="0" create="0" decoration-muted="is_done" decoration-warning="quantity_done - product_uom_qty &gt; 0.0001" decoration-success="not is_done and quantity_done - product_uom_qty &lt; 0.0001" js_class="subcontracting_portal_move_list_view">
  154. <field name="company_id" invisible="1"/>
  155. <field name="sequence" invisible="1"/>
  156. <field name="product_uom_category_id" invisible="1"/>
  157. <field name="name" invisible="1"/>
  158. <field name="unit_factor" invisible="1"/>
  159. <field name="date" invisible="1"/>
  160. <field name="picking_type_id" invisible="1"/>
  161. <field name="has_tracking" invisible="1"/>
  162. <field name="operation_id" invisible="1"/>
  163. <field name="is_done" invisible="1"/>
  164. <field name="bom_line_id" invisible="1"/>
  165. <field name="location_id" invisible="1"/>
  166. <field name="warehouse_id" invisible="1"/>
  167. <field name="product_uom_qty" invisible="1"/>
  168. <field name="location_dest_id" invisible="1"/>
  169. <field name="state" invisible="1" force_save="1"/>
  170. <field name="raw_material_production_id" invisible="1"/>
  171. <field name="product_id" required="1"/>
  172. <field name="order_finished_lot_id"/>
  173. <field name="reserved_availability" attrs="{'invisible': [('is_done', '=', True)]}" string="Reserved"/>
  174. <field name="quantity_done" string="Consumed" readonly="1"/>
  175. <field name="product_uom" groups="uom.group_uom"/>
  176. </tree>
  177. </field>
  178. </record>
  179. <record id="view_move_search" model="ir.ui.view">
  180. <field name="name">stock.move.search</field>
  181. <field name="model">stock.move</field>
  182. <field name="inherit_id" ref="stock.view_move_search" />
  183. <field name="arch" type="xml">
  184. <xpath expr="//field[@name='partner_id']" position="after">
  185. <field name="order_finished_lot_id"/>
  186. </xpath>
  187. </field>
  188. </record>
  189. </odoo>