| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<odoo> |
| 3 |
|
| 4 |
<record id="product_template_form_view_invoice_policy_inherit_sale_project" model="ir.ui.view"> |
| 5 |
<field name="name">product.template.inherit.sale.projectform</field> |
| 6 |
<field name="model">product.template</field> |
| 7 |
<field name="inherit_id" ref="sale.product_template_form_view"/> |
| 8 |
<field name="arch" type="xml"> |
| 9 |
<field name="invoice_policy" position="attributes"> |
| 10 |
<attribute name="invisible" separator="or" add="type == 'service'"/> |
| 11 |
</field> |
| 12 |
<field name="service_tracking" position="attributes"> |
| 13 |
<attribute name="invisible" remove="1" separator="or"/> |
| 14 |
</field> |
| 15 |
<field name="service_tracking" position="after"> |
| 16 |
<div class="o_td_label d-inline-flex" invisible="service_tracking != 'task_global_project'"> |
| 17 |
<label for='project_id'/> |
| 18 |
</div> |
| 19 |
<field name="project_id" context="{'default_allow_billable': True}" invisible="service_tracking != 'task_global_project'" nolabel="1" placeholder="Defined on quotation"/> |
| 20 |
<div class="o_td_label d-inline-flex" invisible="service_tracking not in ['task_in_project', 'project_only']"> |
| 21 |
<label for='project_template_id'/> |
| 22 |
</div> |
| 23 |
<field name="project_template_id" context="{'active_test': False, 'default_allow_billable': True, 'default_is_template': True}" invisible="service_tracking not in ['task_in_project', 'project_only']" nolabel="1" placeholder="Empty project"/> |
| 24 |
<div class="o_td_label d-inline-flex" |
| 25 |
invisible="not project_id or service_tracking != 'task_global_project'"> |
| 26 |
<label for="task_template_id" /> |
| 27 |
</div> |
| 28 |
<!-- field for project manager --> |
| 29 |
<field name="task_template_id" |
| 30 |
groups="project.group_project_manager" |
| 31 |
context="{'default_is_template': True, 'default_project_id': project_id or project_template_id}" |
| 32 |
invisible="not project_id or service_tracking != 'task_global_project'" |
| 33 |
nolabel="1" /> |
| 34 |
<!-- field for non-project manager --> |
| 35 |
<field name="task_template_id" |
| 36 |
groups="!project.group_project_manager" |
| 37 |
options="{'no_open': True, 'no_create_edit': True, 'no_create': True}" |
| 38 |
invisible="not project_id or service_tracking != 'task_global_project'" |
| 39 |
nolabel="1" /> |
| 40 |
<field name="service_policy" |
| 41 |
string="Invoicing Policy" |
| 42 |
invisible="type != 'service' or sale_ok == False" |
| 43 |
required="type == 'service' and sale_ok == True"/> |
| 44 |
</field> |
| 45 |
</field> |
| 46 |
</record> |
| 47 |
|
| 48 |
<!-- TODO: remove me in master --> |
| 49 |
<record id="product_template_form_view_inherit_sale_project" model="ir.ui.view"> |
| 50 |
<field name="name">product.template.sale.project.form</field> |
| 51 |
<field name="model">product.template</field> |
| 52 |
<field name="inherit_id" ref="sale.product_template_form_view"/> |
| 53 |
<field name="mode">primary</field> |
| 54 |
<field name="priority">999</field> |
| 55 |
<field name="arch" type="xml"> |
| 56 |
<field name="type" position="attributes"> |
| 57 |
<attribute name="invisible">1</attribute> |
| 58 |
</field> |
| 59 |
</field> |
| 60 |
</record> |
| 61 |
|
| 62 |
<record id="product_product_form_view_inherit_sale_project" model="ir.ui.view"> |
| 63 |
<field name="name">product.product.sale.project.form</field> |
| 64 |
<field name="model">product.product</field> |
| 65 |
<field name="inherit_id" ref="product.product_normal_form_view"/> |
| 66 |
<field name="mode">primary</field> |
| 67 |
<field name="priority">999</field> |
| 68 |
<field name="arch" type="xml"> |
| 69 |
<field name="type" position="attributes"> |
| 70 |
<attribute name="invisible">1</attribute> |
| 71 |
</field> |
| 72 |
</field> |
| 73 |
</record> |
| 74 |
</odoo> |