Analytic percentage field added and crm start, close date added

This commit is contained in:
projectsodoo 2020-12-16 11:03:26 +05:30
parent 777e639447
commit 83f6ea35e6
7 changed files with 52 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

@ -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>