← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-781189-dbr into lp:openobject-addons

 

Devishree Brahmbhatt (OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-781189-dbr into lp:openobject-addons.

Requested reviews:
  Bhumika (OpenERP) (sbh-openerp)
Related bugs:
  Bug #781189 in OpenERP Addons: "[PS] Wrong adaptation of the partner address in the Project view"
  https://bugs.launchpad.net/openobject-addons/+bug/781189

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-781189-dbr/+merge/61083
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-781189-dbr/+merge/61083
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-781189-dbr.
=== modified file 'project_timesheet/project_timesheet.py'
--- project_timesheet/project_timesheet.py	2011-01-14 00:11:01 +0000
+++ project_timesheet/project_timesheet.py	2011-05-16 09:53:15 +0000
@@ -222,6 +222,19 @@
                 context=context)
 res_partner()
 
+class account_analytic_account(osv.osv):
+
+    _inherit = 'account.analytic.account'
+    _description = 'Analytic Account'
+
+    def onchange_partner_id(self, cr, uid, ids, part, context=None):
+        partner_obj = self.pool.get('res.partner')
+        if not part:
+            return {'value':{'contact_id': False}}
+        addr = partner_obj.address_get(cr, uid, [part], ['contact'])
+        return {'value':{'contact_id': addr['contact']}}
+account_analytic_account()
+
 class account_analytic_line(osv.osv):
    _inherit = "account.analytic.line"
    def on_change_account_id(self, cr, uid, ids, account_id):

=== modified file 'project_timesheet/project_timesheet_view.xml'
--- project_timesheet/project_timesheet_view.xml	2011-01-28 07:23:17 +0000
+++ project_timesheet/project_timesheet_view.xml	2011-05-16 09:53:15 +0000
@@ -76,6 +76,21 @@
                 </field>
             </field>
         </record>
+	<!-- Analytic Account -->
+        <record id="account_report_balance_view" model="ir.ui.view">
+          <field name="name">account.analytic.account.inherit1</field>
+          <field name="model">account.analytic.account</field>
+          <field name="type">form</field>
+          <field name="inherit_id" ref="account.view_account_analytic_account_form" />
+          <field name="arch" type="xml">
+            <data>
+            <xpath expr="//field[@name='partner_id']" position="replace">
+		<field name="partner_id" on_change="onchange_partner_id(partner_id)" select="1" groups="account.group_account_invoice"/>
+            	<field name="contact_id" select="1" groups="account.group_account_invoice"/>
+            </xpath>
+            </data>
+          </field>
+        </record>
 
         <!-- Menus -->
         <record id="action_project_timesheet_bill_task" model="ir.actions.act_window">


Follow ups