Merge branch 'development' of http://103.74.223.20:8085/prakash.jain/cor-odoo into pawan_branch

This commit is contained in:
Pawan Kumar 2020-12-16 11:07:40 +05:30
commit 1cb3bcae3c
8 changed files with 57 additions and 2 deletions

View File

@ -20,7 +20,7 @@
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['base', 'crm', 'sale_timesheet'],
'depends': ['base', 'crm', 'sale_timesheet', 'analytic'],
# always loaded
'data': [
@ -28,6 +28,7 @@
'views/crm_view.xml',
'views/project_view.xml',
'views/hr_timesheet_templates.xml',
'views/analytic_view.xml',
'views/views.xml',
'views/templates.xml',
],

View File

@ -3,4 +3,5 @@
from . import crm_lead
from . import models
from . import project
from . import project_overview
from . import project_overview
from . import analytic

View File

@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details
from odoo import api, fields, models, _
from odoo.exceptions import UserError, AccessError
from odoo.osv import expression
class AccountAnalyticLine(models.Model):
_inherit = 'account.analytic.line'
ispercentage = fields.Boolean(string="Is Percentage", default=False)
percentage_rate = fields.Float(string="Percentage (%)")
per_from_amt = fields.Float(string="Of", digits=(6, 2))

View File

@ -12,3 +12,5 @@ class Lead(models.Model):
ref_summary_status = fields.Char(string='Referral Summary status')
project_scope = fields.Char(string='The scope of the project')
client_folder = fields.Char(string='Client Folder')
start_date = fields.Date(string='Start Date')
close_date = fields.Date(string='Close Date')

View File

@ -7,6 +7,9 @@ class InheritProjectProductEmployeeMap(models.Model):
_inherit = 'project.sale.line.employee.map'
employee_price = fields.Float("Employee Price")
budgeted_qty = fields.Float(string='Budgeted qty', related='sale_line_id.product_uom_qty', readonly=True)
budgeted_uom = fields.Many2one('uom.uom', string='Budgeted UOM', related='sale_line_id.product_uom', readonly=True)
@api.onchange('employee_id')
def _onchange_employee_price(self):

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_account_analytic_line_inherit_percentage" model="ir.ui.view">
<field name="name">Percentage Analytic</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="analytic.view_account_analytic_line_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='company_id']" position="after">
<separator string="Percentage"/>
<field name="ispercentage"/>
<field name="percentage_rate" attrs="{'invisible':[('ispercentage','=',False)]}"/>
<field name="per_from_amt" attrs="{'invisible':[('ispercentage','=',False)]}"/>
</xpath>
</field>
</record>
</odoo>

View File

@ -14,6 +14,8 @@
<field name="ref_summary_status"/>
<field name="project_scope"/>
<field name="client_folder"/>
<field name="start_date"/>
<field name="close_date"/>
</xpath>
</field>
</record>

View File

@ -1,6 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="project_project_analytic_view_form" model="ir.ui.view">
<field name="name">Project Analytic</field>
<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">
</button>
</div>
</field>
</record>
<record id="inherit_project_project_view_form" model="ir.ui.view">
<field name="name">project.project.form.inherit</field>
<field name="model">project.project</field>
@ -25,6 +38,8 @@
<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)]}"/>