purchase_views.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="purchase_order_view_form_inherit" model="ir.ui.view">
  4. <field name="name">purchase.order.form.inherit</field>
  5. <field name="model">purchase.order</field>
  6. <field name="inherit_id" ref="purchase.purchase_order_form"/>
  7. <field name="arch" type="xml">
  8. <xpath expr="//header/button[@name='action_rfq_send']" position="after">
  9. <button name="action_view_picking"
  10. string="Receive Products" class="oe_highlight" type="object"
  11. attrs="{'invisible': ['|', '|' , ('is_shipped', '=', True), ('state','not in', ('purchase','done')), ('incoming_picking_count', '=', 0)]}"
  12. data-hotkey="y" groups="stock.group_stock_user"/>
  13. </xpath>
  14. <xpath expr="//header/button[@name='confirm_reminder_mail']" position="attributes">
  15. <attribute name="attrs">{'invisible': ['|', '|', '|', ('state', 'not in', ('purchase', 'done')), ('mail_reminder_confirmed', '=', True), ('date_planned', '=', False), ('effective_date', '!=', False)]}</attribute>
  16. </xpath>
  17. <xpath expr="//div[hasclass('oe_button_box')]" position="inside">
  18. <button type="object"
  19. name="action_view_picking"
  20. class="oe_stat_button"
  21. icon="fa-truck" attrs="{'invisible':[('incoming_picking_count','=', 0)]}" groups="stock.group_stock_user">
  22. <field name="incoming_picking_count" widget="statinfo" string="Receipt" help="Incoming Shipments"/>
  23. </button>
  24. </xpath>
  25. <xpath expr="//field[@name='currency_id']" position="after">
  26. <field name="is_shipped" invisible="1"/>
  27. </xpath>
  28. <xpath expr="//field[@name='order_line']/tree//field[@name='date_planned']" position="after">
  29. <field name="move_dest_ids" invisible="1"/>
  30. </xpath>
  31. <xpath expr="//page/field[@name='order_line']/tree/field[@name='product_qty']" position="after">
  32. <field name="forecasted_issue" invisible="1"/>
  33. <button type="object" name="action_product_forecast_report" title="Forecast Report" icon="fa-area-chart" attrs="{'invisible': ['|', '|', ('id', '=', False), ('forecasted_issue', '=', False), ('product_type', '!=', 'product')]}" class="text-danger"/>
  34. <button type="object" name="action_product_forecast_report" title="Forecast Report" icon="fa-area-chart" attrs="{'invisible': ['|', '|', ('id', '=', False), ('forecasted_issue', '=', True), ('product_type', '!=', 'product')]}"/>
  35. </xpath>
  36. <xpath expr="//div[@name='date_planned_div']" position="inside">
  37. <button name="%(action_purchase_vendor_delay_report)d" class="oe_link" type="action" context="{'search_default_partner_id': partner_id}" attrs="{'invisible': ['|', ('state', 'in', ['purchase', 'done']), ('partner_id', '=', False)]}">
  38. <span attrs="{'invisible': [('on_time_rate', '&lt;', 0)]}"><field name="on_time_rate" widget="integer" class="oe_inline"/>% On-Time Delivery</span>
  39. <span attrs="{'invisible': [('on_time_rate', '&gt;=', 0)]}">No On-time Delivery Data</span>
  40. </button>
  41. </xpath>
  42. <xpath expr="//label[@for='receipt_reminder_email']" position="attributes">
  43. <attribute name="attrs">{'invisible': [('effective_date', '!=', False)]}</attribute>
  44. </xpath>
  45. <xpath expr="//div[@name='reminder']" position="attributes">
  46. <attribute name="attrs">{'invisible': [('effective_date', '!=', False)]}</attribute>
  47. </xpath>
  48. <xpath expr="//div[@name='reminder']" position="after">
  49. <field name="effective_date" attrs="{'invisible': [('effective_date', '=', False)]}"/>
  50. </xpath>
  51. <xpath expr="//field[@name='order_line']/form//field[@name='invoice_lines']" position="after">
  52. <field name="move_ids"/>
  53. </xpath>
  54. <field name="invoice_status" position="before">
  55. <field name="receipt_status" attrs="{'invisible': [('state', 'not in', ('purchase', 'done'))]}"/>
  56. </field>
  57. <xpath expr="//field[@name='order_line']/form//field[@name='analytic_distribution']" position="before">
  58. <field name="propagate_cancel" groups="base.group_no_one"/>
  59. </xpath>
  60. <xpath expr="//field[@name='order_line']/tree//field[@name='qty_received']" position="attributes">
  61. <attribute name="attrs">{'column_invisible': [('parent.state', 'not in', ('purchase', 'done'))], 'readonly': [('product_type', 'in', ('consu', 'product'))]}</attribute>
  62. </xpath>
  63. <xpath expr="//page[@name='purchase_delivery_invoice']/group/group" position="inside">
  64. <field name="default_location_dest_id_usage" invisible="1"/>
  65. <field name="incoterm_id"/>
  66. <field name="incoterm_location" />
  67. </xpath>
  68. <xpath expr="//div[@name='reminder']" position="after">
  69. <field name="picking_type_id" domain="[('code','=','incoming'), '|', ('warehouse_id', '=', False), ('warehouse_id.company_id', '=', company_id)]" options="{'no_create': True}" groups="stock.group_stock_multi_locations"/>
  70. <field name="dest_address_id" groups="stock.group_stock_multi_locations" attrs="{'invisible': [('default_location_dest_id_usage', '!=', 'customer')], 'required': [('default_location_dest_id_usage', '=', 'customer')]}"/>
  71. </xpath>
  72. </field>
  73. </record>
  74. <record id="purchase_order_line_view_form_inherit" model="ir.ui.view">
  75. <field name="name">purchase.order.line.form.inherit</field>
  76. <field name="model">purchase.order.line</field>
  77. <field name="inherit_id" ref="purchase.purchase_order_line_form2"/>
  78. <field name="arch" type="xml">
  79. <xpath expr="//field[@name='invoice_lines']" position="after">
  80. <separator string="Stock Moves"/>
  81. <field name="move_ids"/>
  82. </xpath>
  83. </field>
  84. </record>
  85. <record id="purchase_order_view_tree_inherit" model="ir.ui.view">
  86. <field name="name">purchase.order.tree.inherit</field>
  87. <field name="model">purchase.order</field>
  88. <field name="inherit_id" ref="purchase.purchase_order_view_tree"/>
  89. <field name="arch" type="xml">
  90. <field name="invoice_status" position="before">
  91. <field name="effective_date" invisible="1"/>
  92. <field name="receipt_status" optional="hide" widget="badge"
  93. decoration-success="date_planned and (date_planned &gt; datetime.datetime.combine(datetime.date.today(), datetime.time(23,59,59)).to_utc().strftime('%Y-%m-%d %H:%M:%S') or receipt_status=='full' and effective_date &lt;= date_planned)"
  94. decoration-danger="date_planned and (date_planned &lt; effective_date or date_planned &lt; datetime.datetime.combine(datetime.date.today(), datetime.time(0,0,0)).to_utc().strftime('%Y-%m-%d %H:%M:%S') and receipt_status!='full' and effective_date &lt;= date_planned)"
  95. decoration-warning="date_planned and date_planned &gt;= datetime.datetime.combine(datetime.date.today(), datetime.time(0,0,0)).to_utc().strftime('%Y-%m-%d %H:%M:%S') and date_planned &lt;= datetime.datetime.combine(datetime.date.today(), datetime.time(23,59,59)).to_utc().strftime('%Y-%m-%d %H:%M:%S') and receipt_status!='full'"/>
  96. </field>
  97. </field>
  98. </record>
  99. </odoo>