Nehal Panchal (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/6.1-opw-574637-nep into
lp:openobject-addons/6.1.
Requested reviews:
Naresh(OpenERP) (nch-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-574637-nep/+merge/106619
hello,
When we edit analytic distribution, OpenERP will duplicate the analytic
distribution without required field model's plan. Which is incorrect behavior.
As suggested by nel and qdp, removed the write function of
"account.analytic.plan.instance" object.
Thanks.
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-574637-nep/+merge/106619
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.1-opw-574637-nep.
=== modified file 'account_analytic_plans/account_analytic_plans.py'
--- account_analytic_plans/account_analytic_plans.py 2012-01-03 12:33:39 +0000
+++ account_analytic_plans/account_analytic_plans.py 2012-05-21 12:43:21 +0000
@@ -235,28 +235,6 @@
return super(account_analytic_plan_instance, self).create(cr, uid, vals, context=context)
- def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
- if context is None:
- context = {}
- this = self.browse(cr, uid, ids[0], context=context)
- invoice_line_obj = self.pool.get('account.invoice.line')
- if this.plan_id and not vals.has_key('plan_id'):
- #this instance is a model, so we have to create a new plan instance instead of modifying it
- #copy the existing model
- temp_id = self.copy(cr, uid, this.id, None, context=context)
- #get the list of the invoice line that were linked to the model
- lists = invoice_line_obj.search(cr, uid, [('analytics_id','=',this.id)], context=context)
- #make them link to the copy
- invoice_line_obj.write(cr, uid, lists, {'analytics_id':temp_id}, context=context)
-
- #and finally modify the old model to be not a model anymore
- vals['plan_id'] = False
- if not vals.has_key('name'):
- vals['name'] = this.name and (str(this.name)+'*') or "*"
- if not vals.has_key('code'):
- vals['code'] = this.code and (str(this.code)+'*') or "*"
- return super(account_analytic_plan_instance, self).write(cr, uid, ids, vals, context=context)
-
account_analytic_plan_instance()
class account_analytic_plan_instance_line(osv.osv):
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp