Divyesh Makwana(OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/trunk-bug-810548-mdi into lp:openobject-addons.
Requested reviews: OpenERP Core Team (openerp) Related bugs: Bug #810548 in OpenERP Addons: "multi-company invoice validation error" https://bugs.launchpad.net/openobject-addons/+bug/810548 For more details, see: https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-810548-mdi/+merge/79786 Hello Sir, Here i put a constraint for period related to the company. Because, if period is not found for the company, it will take the default company's period. Divyesh Makwana(MDI) -- https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-810548-mdi/+merge/79786 Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-addons/trunk-bug-810548-mdi.
=== modified file 'account/account_invoice.py' --- account/account_invoice.py 2011-10-19 08:14:03 +0000 +++ account/account_invoice.py 2011-10-19 09:43:11 +0000 @@ -927,6 +927,8 @@ period_ids = self.pool.get('account.period').search(cr, uid, [('date_start','<=',inv.date_invoice or time.strftime('%Y-%m-%d')),('date_stop','>=',inv.date_invoice or time.strftime('%Y-%m-%d')), ('company_id', '=', inv.company_id.id)]) if period_ids: period_id = period_ids[0] + else: + raise osv.except_osv(_('No Period Defined !'),_("You must first define a period !") ) if period_id: move['period_id'] = period_id for i in line:
_______________________________________________ Mailing list: https://launchpad.net/~openerp-dev-gtk Post to : openerp-dev-gtk@lists.launchpad.net Unsubscribe : https://launchpad.net/~openerp-dev-gtk More help : https://help.launchpad.net/ListHelp