diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py index e89d52659f4..ccfea216054 100644 --- a/addons/hr_timesheet/hr_timesheet.py +++ b/addons/hr_timesheet/hr_timesheet.py @@ -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) diff --git a/addons/partner_crm/partner_crm.py b/addons/partner_crm/partner_crm.py index 2162f850115..fef1b36391c 100644 --- a/addons/partner_crm/partner_crm.py +++ b/addons/partner_crm/partner_crm.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # @@ -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 . +# along with this program. If not, see . # ############################################################################## @@ -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() diff --git a/addons/partner_crm/partner_crm_view.xml b/addons/partner_crm/partner_crm_view.xml index ab75f5c58ed..8aabbb242e9 100644 --- a/addons/partner_crm/partner_crm_view.xml +++ b/addons/partner_crm/partner_crm_view.xml @@ -11,19 +11,19 @@ - - - - + + + - - - - - - - + + + + + + + +