Priyesh (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/6.0-opw-5852-pso into
lp:openobject-addons/6.0.
Requested reviews:
Jay Vora (OpenERP) (jvo-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-5852-pso/+merge/66306
Hello,
Added clause for company in the find method of period to solve the issue of
payment in multicompany environment (case:5783)
Thanks,
pso
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-5852-pso/+merge/66306
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.0-opw-5852-pso.
=== modified file 'account/account.py'
--- account/account.py 2011-06-22 20:05:58 +0000
+++ account/account.py 2011-06-29 13:58:27 +0000
@@ -907,10 +907,11 @@
return False
def find(self, cr, uid, dt=None, context=None):
+ cid = self.pool.get('res.company')._company_default_get(cr, uid, 'account.period', context=context)
if not dt:
dt = time.strftime('%Y-%m-%d')
#CHECKME: shouldn't we check the state of the period?
- ids = self.search(cr, uid, [('date_start','<=',dt),('date_stop','>=',dt)])
+ ids = self.search(cr, uid, [('date_start','<=',dt),('date_stop','>=',dt),('company_id','=',cid)])
if not ids:
raise osv.except_osv(_('Error !'), _('No period defined for this date: %s !\nPlease create a fiscal year.')%dt)
return ids
_______________________________________________
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