Merge branch 'pawan_branch' into 'development'

Pawan branch

See merge request prakash.jain/cor-odoo!40
This commit is contained in:
pawan.sharma 2020-12-30 02:13:29 -08:00
commit 35a61b74c5
4 changed files with 28 additions and 7 deletions

View File

@ -38,6 +38,23 @@ class Project(models.Model):
" them or by someone of their company.")
allow_billable = fields.Boolean("Billable", default=True, help="Invoice your time and material from tasks.")
budgeted_hours = fields.Float(string='Budgeted Hours', digits=(16, 2))
budgeted_revenue = fields.Float(string='Budgeted Revenue', digits=(16, 2))
# @api.onchange('sale_line_employee_ids','sale_line_employee_ids.budgeted_qty', 'project_id')
# def onchange_(self):
# if self.project_type == 'hours_in_consultant':
# print('555555555')
# val = 0.0
# for rec in self.sale_line_employee_ids:
# val = val + rec.budgeted_qty
# print('66666666666666666', val)
# print('777777777', val)
# self.budgeted_hours = val
class InheritProjectProductEmployeeMap(models.Model):
_inherit = 'project.sale.line.employee.map'

View File

@ -39,6 +39,11 @@
widget="radio"/>
<field name="project_type" attrs="{'invisible': [('pricing_type', '=', 'fixed_rate')]}"
widget="radio"/>
<field name="budgeted_hours"
attrs="{'invisible': [('pricing_type','=','fixed_rate')], 'readonly': [('project_type','=','hours_in_consultant')],
'required': [('pricing_type','!=','fixed_rate')]}"/>
<field name="budgeted_revenue"
attrs="{'invisible': [('pricing_type','=','fixed_rate')], 'required': [('pricing_type','!=','fixed_rate')]}"/>
<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"
@ -65,7 +70,8 @@
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="budgeted_qty" attrs="{'readonly': [('parent.project_type', '=', 'hours_no_limit')]}"/>
<field name="budgeted_qty"
attrs="{'readonly': [('parent.project_type', '=', 'hours_no_limit')]}"/>
<field name="timesheet_hour"/>
<field name="budgeted_hour_week"/>
<field name="currency_id" invisible="1" readonly="1"/>

View File

@ -6,7 +6,5 @@ from odoo import api, fields, models, _
class Project(models.Model):
_inherit = 'project.project'
budgeted_hours = fields.Float(string='Budgeted Hours', digits=(16, 2))
budgeted_revenue = fields.Float(string='Budgeted Revenue', digits=(16, 2))

View File

@ -12,10 +12,10 @@
attrs="{'invisible': [('allow_billable','=',False)]}" string="Create Expense" widget="statinfo">
</button>
</div>
<xpath expr="//field[@name='analytic_account_id']" position="after">
<field name="budgeted_hours" attrs="{'invisible': [('pricing_type','=','fixed_rate')]}"/>
<field name="budgeted_revenue" attrs="{'invisible': [('pricing_type','=','fixed_rate')]}"/>
</xpath>
<!--<xpath expr="//field[@name='analytic_account_id']" position="after">
<field name="budgeted_hours" attrs="{'invisible': [('pricing_type','=','fixed_rate')], 'required': [('pricing_type','!=','fixed_rate')]}"/>
<field name="budgeted_revenue" attrs="{'invisible': [('pricing_type','=','fixed_rate')], 'required': [('pricing_type','!=','fixed_rate')]}"/>
</xpath>-->
</field>
</record>