sub-project visible and required when checkbox selected

This commit is contained in:
Pawan Kumar 2020-12-16 11:42:16 +05:30
parent 1cb3bcae3c
commit 45f90d2c4d
22 changed files with 32 additions and 13 deletions

0
cor_custom/__init__.py Normal file → Executable file
View File

0
cor_custom/__manifest__.py Normal file → Executable file
View File

Binary file not shown.

0
cor_custom/controllers/__init__.py Normal file → Executable file
View File

Binary file not shown.

0
cor_custom/controllers/controllers.py Normal file → Executable file
View File

0
cor_custom/demo/demo.xml Normal file → Executable file
View File

0
cor_custom/models/__init__.py Normal file → Executable file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

0
cor_custom/models/analytic.py Normal file → Executable file
View File

0
cor_custom/models/crm_lead.py Normal file → Executable file
View File

0
cor_custom/models/models.py Normal file → Executable file
View File

0
cor_custom/security/ir.model.access.csv Normal file → Executable file
View File

View File

@ -6,10 +6,14 @@
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" type="object" name="action_view_account_analytic_line" icon="fa-usd" attrs="{'invisible': [('allow_billable','=',False)]}" string="Cost/Revenue" widget="statinfo">
<div name="button_box" position="inside">
<button class="oe_stat_button" type="object" name="action_view_account_analytic_line" icon="fa-usd"
attrs="{'invisible': [('allow_billable','=',False)]}" string="Cost/Revenue" widget="statinfo">
</button>
</div>
<xpath expr="//field[@name='partner_id']" position="replace">
<field name="partner_id" string="Client"/>
</xpath>
</field>
</record>
@ -20,29 +24,44 @@
<field name="inherit_id" ref="sale_timesheet.project_project_view_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='billing_employee_rate']" position="replace">
<page name="billing_employee_rate" string="Invoicing" attrs="{'invisible': [('allow_billable', '=', False)]}">
<page name="billing_employee_rate" string="Invoicing"
attrs="{'invisible': [('allow_billable', '=', False)]}">
<group>
<field name="display_create_order" invisible="1"/>
<field name="bill_type" widget="radio"/>
<field name="pricing_type" attrs="{'invisible': ['|', ('allow_billable', '=', False), ('bill_type', '!=', 'customer_project')], 'required': ['&amp;', ('allow_billable', '=', True), ('allow_timesheets', '=', True)]}" widget="radio"/>
<div class="o_td_label" attrs="{'invisible': ['|', '|', ('allow_timesheets', '=', False), ('sale_order_id', '!=', False), '&amp;', ('pricing_type', '!=', 'fixed_rate'), ('bill_type', '!=', 'customer_task')]}">
<label for="timesheet_product_id" string="Default Service" attrs="{'invisible': [('bill_type', '!=', 'customer_task')]}"/>
<label for="timesheet_product_id" string="Service" attrs="{'invisible': [('bill_type', '=', 'customer_task')]}"/>
<field name="pricing_type"
attrs="{'invisible': ['|', ('allow_billable', '=', False), ('bill_type', '!=', 'customer_project')], 'required': ['&amp;', ('allow_billable', '=', True), ('allow_timesheets', '=', True)]}"
widget="radio"/>
<div class="o_td_label"
attrs="{'invisible': ['|', '|', ('allow_timesheets', '=', False), ('sale_order_id', '!=', False), '&amp;', ('pricing_type', '!=', 'fixed_rate'), ('bill_type', '!=', 'customer_task')]}">
<label for="timesheet_product_id" string="Default Service"
attrs="{'invisible': [('bill_type', '!=', 'customer_task')]}"/>
<label for="timesheet_product_id" string="Service"
attrs="{'invisible': [('bill_type', '=', 'customer_task')]}"/>
</div>
<field name="timesheet_product_id" nolabel="1" attrs="{'invisible': ['|', '|', ('allow_timesheets', '=', False), ('sale_order_id', '!=', False), '&amp;', ('pricing_type', '!=', 'fixed_rate'), ('bill_type', '!=', 'customer_task')], 'required': ['&amp;', ('allow_billable', '=', True), ('allow_timesheets', '=', True)]}" context="{'default_type': 'service', 'default_service_policy': 'delivered_timesheet', 'default_service_type': 'timesheet'}"/>
<field name="timesheet_product_id" nolabel="1"
attrs="{'invisible': ['|', '|', ('allow_timesheets', '=', False), ('sale_order_id', '!=', False), '&amp;', ('pricing_type', '!=', 'fixed_rate'), ('bill_type', '!=', 'customer_task')], 'required': ['&amp;', ('allow_billable', '=', True), ('allow_timesheets', '=', True)]}"
context="{'default_type': 'service', 'default_service_policy': 'delivered_timesheet', 'default_service_type': 'timesheet'}"/>
<field name="sale_order_id" invisible="1"/>
<field name="sale_line_id" string="Default Sales Order Item" attrs="{'invisible': ['|', '|', ('sale_order_id', '=', False), ('bill_type', '!=', 'customer_project'), ('pricing_type', '!=', 'fixed_rate')], 'readonly': [('sale_order_id', '=', False)]}" options="{'no_create': True, 'no_edit': True, 'delete': False}"/>
<field name="sale_line_id" string="Default Sales Order Item"
attrs="{'invisible': ['|', '|', ('sale_order_id', '=', False), ('bill_type', '!=', 'customer_project'), ('pricing_type', '!=', 'fixed_rate')], 'readonly': [('sale_order_id', '=', False)]}"
options="{'no_create': True, 'no_edit': True, 'delete': False}"/>
</group>
<field name="sale_line_employee_ids" attrs="{'invisible': ['|', ('bill_type', '!=', 'customer_project'), ('pricing_type', '!=', 'employee_rate')]}">
<field name="sale_line_employee_ids"
attrs="{'invisible': ['|', ('bill_type', '!=', 'customer_project'), ('pricing_type', '!=', 'employee_rate')]}">
<tree editable="top">
<field name="company_id" invisible="1"/>
<field name="project_id" invisible="1"/>
<field name="employee_id" options="{'no_create': True}"/>
<field name="budgeted_qty"/>
<field name="budgeted_uom"/>
<field name="timesheet_product_id" attrs="{'column_invisible': [('parent.sale_order_id', '!=', False)]}"/>
<field name="sale_line_id" options="{'no_create': True}" attrs="{'column_invisible': [('parent.sale_order_id', '=', False)]}" domain="[('order_id','=',parent.sale_order_id), ('is_service', '=', True)]"/>
<field name="price_unit" widget="monetary" options="{'currency_field': 'currency_id'}" attrs="{'readonly': [('parent.sale_order_id', '!=', False)]}"/>
<field name="timesheet_product_id"
attrs="{'column_invisible': [('parent.sale_order_id', '!=', False)]}"/>
<field name="sale_line_id" options="{'no_create': True}"
attrs="{'column_invisible': [('parent.sale_order_id', '=', False)]}"
domain="[('order_id','=',parent.sale_order_id), ('is_service', '=', True)]"/>
<field name="price_unit" widget="monetary" options="{'currency_field': 'currency_id'}"
attrs="{'readonly': [('parent.sale_order_id', '!=', False)]}"/>
<field name="employee_price" widget="monetary" options="{'currency_field': 'currency_id'}"/>
<field name="currency_id" invisible="1" readonly="1"/>
</tree>

0
cor_custom/views/templates.xml Normal file → Executable file
View File

0
cor_custom/views/views.xml Normal file → Executable file
View File