product_views.xml 1.4 KB

1234567891011121314151617181920212223
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="product_template_form_view_invoice_policy_inherit_sale_project" model="ir.ui.view">
  4. <field name="name">product.template.inherit.sale.projectform</field>
  5. <field name="model">product.template</field>
  6. <field name="inherit_id" ref="sale.product_template_form_view"/>
  7. <field name="arch" type="xml">
  8. <field name="invoice_policy" position="attributes">
  9. <attribute name="invisible">False</attribute>
  10. <attribute name="attrs">{'invisible': [('type', '=', 'service')]}</attribute>
  11. </field>
  12. <field name="invoice_policy" position="after">
  13. <field name="service_policy" string="Invoicing Policy" attrs="{'invisible': [('type', '!=', 'service')], 'required': [('type', '=', 'service')]}"/>
  14. <field name="service_tracking" required="1" attrs="{'invisible': [('type', '!=', 'service')]}"/>
  15. <field name="project_id" context="{'default_allow_billable': True}" attrs="{'invisible':[('service_tracking','!=','task_global_project')], 'required':[('service_tracking','==','task_global_project')]}"/>
  16. <field name="project_template_id" context="{'active_test': False, 'default_allow_billable': True}" attrs="{'invisible':[('service_tracking','not in',['task_in_project', 'project_only'])]}"/>
  17. </field>
  18. </field>
  19. </record>
  20. </odoo>