← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/trunk-bug-734497-pso into lp:openobject-addons

 

pso (Open ERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-734497-pso into lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #734497 in OpenERP Addons: "hr_timesheet_invoice: reinvoicing is not correctly set on analytic account lines"
  https://bugs.launchpad.net/openobject-addons/+bug/734497

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-734497-pso/+merge/56693

Fixed bug: 734497 (https://bugs.launchpad.net/openobject-addons/+bug/734497)
Passed to_invoice while creating analytic lines
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-734497-pso/+merge/56693
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-734497-pso.
=== modified file 'hr_timesheet_invoice/hr_timesheet_invoice.py'
--- hr_timesheet_invoice/hr_timesheet_invoice.py	2011-01-14 00:11:01 +0000
+++ hr_timesheet_invoice/hr_timesheet_invoice.py	2011-04-07 05:46:26 +0000
@@ -176,5 +176,20 @@
 
 account_invoice()
 
+class account_move_line(osv.osv):
+    _inherit = "account.move.line"
+
+    def create_analytic_lines(self, cr, uid, ids, context=None):
+        res = super(account_move_line, self).create_analytic_lines(cr, uid, ids,context=context)
+        analytic_line_obj = self.pool.get('account.analytic.line')
+        for move_line in self.browse(cr, uid, ids, context=context):
+            for line in move_line.analytic_lines:
+                toinv = line.account_id.to_invoice.id
+                if toinv:
+                    analytic_line_obj.write(cr, uid, line.id, {'to_invoice': toinv})
+        return res
+
+account_move_line()
+
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
 


Follow ups