[IMP]: partner_crm hr_timesheet: Task -225 Improvement in partner_crm module
bzr revid: ksa@tinyerp.co.in-20100506122954-leluf2cvydnl27eu
This commit is contained in:
parent
d5ae9ca15a
commit
6df236b561
|
@ -44,6 +44,7 @@ class hr_analytic_timesheet(osv.osv):
|
|||
_order = "id desc"
|
||||
_columns = {
|
||||
'line_id' : fields.many2one('account.analytic.line', 'Analytic line', ondelete='cascade'),
|
||||
'partner_id': fields.related('account_id', 'partner_id', type='many2one', string='Partner Id',relation='account.analytic.account',store=True),
|
||||
}
|
||||
|
||||
def unlink(self, cr, uid, ids, context={}):
|
||||
|
@ -56,8 +57,7 @@ class hr_analytic_timesheet(osv.osv):
|
|||
|
||||
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, unit, context={}):
|
||||
res = {}
|
||||
# if prod_id and unit_amount:
|
||||
if prod_id:
|
||||
if prod_id and unit_amount:
|
||||
# find company
|
||||
company_id=self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context)
|
||||
res = self.pool.get('account.analytic.line').on_change_unit_amount(cr, uid, id, prod_id, unit_amount,company_id,unit, context)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -24,15 +24,18 @@ from osv import osv, fields
|
|||
class res_partner(osv.osv):
|
||||
""" Inherits partner and adds more information in the partner form """
|
||||
_inherit = 'res.partner'
|
||||
|
||||
|
||||
_columns = {
|
||||
'opportunity_ids': fields.one2many('crm.opportunity', 'partner_id', 'Opportunities'),
|
||||
'opportunity_ids': fields.one2many('crm.opportunity', 'partner_id', 'Opportunities'),
|
||||
'meeting_ids': fields.one2many('crm.meeting', 'partner_id',\
|
||||
'Meetings'),
|
||||
'phonecall_ids': fields.one2many('crm.phonecall', 'partner_id', 'Phonecalls'),
|
||||
'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices'),
|
||||
'Meetings'),
|
||||
'phonecall_ids': fields.one2many('crm.phonecall', 'partner_id', 'Phonecalls'),
|
||||
'invoice_ids': fields.one2many('account.invoice.line', 'partner_id', 'Invoices'),
|
||||
'contract_ids': fields.one2many('account.analytic.account', \
|
||||
'partner_id', 'Contracts'),
|
||||
'partner_id', 'Contracts'),
|
||||
'account_line_ids': fields.one2many('hr.analytic.timesheet', \
|
||||
'partner_id', 'Anaylitic account lines '),
|
||||
|
||||
}
|
||||
|
||||
res_partner()
|
||||
|
|
|
@ -11,19 +11,19 @@
|
|||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page string="Other Info">
|
||||
<group col="2" colspan="4">
|
||||
<field name="opportunity_ids" colspan="4" nolabel="1" />
|
||||
<field name="meeting_ids" colspan="4" nolabel="1" />
|
||||
<page string="CRM Info">
|
||||
<field name="opportunity_ids" colspan="4" nolabel="1" />
|
||||
<field name="meeting_ids" colspan="4" nolabel="1" />
|
||||
<field name="phonecall_ids" colspan="4" nolabel="1" />
|
||||
</group>
|
||||
<group col="2" colspan="4">
|
||||
<field name="invoice_ids" colspan="4" nolabel="1" context="{'group_by':'product_id'}"/>
|
||||
</group>
|
||||
<group col="2" colspan="4">
|
||||
<field name="contract_ids" colspan="4" nolabel="1" />
|
||||
</group>
|
||||
</page>
|
||||
|
||||
<page string="Other Info">
|
||||
<field name="invoice_ids" colspan="4" nolabel="1" context="{'group_by':'product_id'}"/>
|
||||
<field name="contract_ids" colspan="4" nolabel="1"/>
|
||||
<field name="account_line_ids" colspan="4" nolabel="1" context="{'group_by':'date'}"/>
|
||||
|
||||
</page>
|
||||
|
||||
</notebook>
|
||||
</field>
|
||||
</record>
|
||||
|
|
Loading…
Reference in New Issue