Merge lp:~openerp-dev/openobject-addons/trunk-bug-810548-mdi into lp:openobject-addons

Proposed by DJ Patel (OpenERP)
Status: Merged
Merged at revision: 5703
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-810548-mdi
Merge into: lp:openobject-addons
Diff against target: 25 lines (+4/-3)
1 file modified
account/account_invoice.py (+4/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-810548-mdi
Reviewer Review Type Date Requested Status
Purnendu Singh (OpenERP) (community) Approve
DJ Patel (OpenERP) (community) Needs Resubmitting
qdp (OpenERP) Pending
Review via email: mp+81941@code.launchpad.net

This proposal supersedes a proposal from 2011-10-19.

Description of the change

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)

To post a comment you must log in.
Revision history for this message
qdp (OpenERP) (qdp) wrote : Posted in a previous version of this proposal

not good patch, you must use the function find(self, cr, uid, dt=None, context=None) of account_period.

review: Needs Fixing
Revision history for this message
DJ Patel (OpenERP) (mdi-openerp) wrote : Posted in a previous version of this proposal

Hello Sir,

I have done the changes, as per your suggestion.

Thanks and Regards,

Divyesh Makwana(MDI)

review: Needs Resubmitting
Revision history for this message
Purnendu Singh (OpenERP) (purnendu-singh) wrote : Posted in a previous version of this proposal

9 + period_ids = period_obj.find(cr, uid, inv.date_invoice)
20 + period_id = period_ids[0]

can be optimize by

                period_id = period_obj.find(cr, uid, inv.date_invoice)[0]

review: Needs Fixing
Revision history for this message
DJ Patel (OpenERP) (mdi-openerp) wrote : Posted in a previous version of this proposal

Hello Sir,

I have done the changes, as per your suggestion.

Thanks and Regards,

Divyesh Makwana(MDI)

review: Needs Resubmitting
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

This does not fixes the bug.

Revision history for this message
DJ Patel (OpenERP) (mdi-openerp) wrote :

Hello Sir,

I have passes the "company_id" in context.

Thanks and Regards,

Divyesh Makwana(MDI)

review: Needs Resubmitting
Revision history for this message
Purnendu Singh (OpenERP) (purnendu-singh) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py 2011-11-11 13:27:53 +0000
+++ account/account_invoice.py 2011-11-14 11:56:17 +0000
@@ -795,6 +795,7 @@
795 """Creates invoice related analytics and financial move lines"""795 """Creates invoice related analytics and financial move lines"""
796 ait_obj = self.pool.get('account.invoice.tax')796 ait_obj = self.pool.get('account.invoice.tax')
797 cur_obj = self.pool.get('res.currency')797 cur_obj = self.pool.get('res.currency')
798 period_obj = self.pool.get('account.period')
798 context = {}799 context = {}
799 for inv in self.browse(cr, uid, ids):800 for inv in self.browse(cr, uid, ids):
800 if not inv.journal_id.sequence_id:801 if not inv.journal_id.sequence_id:
@@ -923,10 +924,10 @@
923 'narration':inv.comment924 'narration':inv.comment
924 }925 }
925 period_id = inv.period_id and inv.period_id.id or False926 period_id = inv.period_id and inv.period_id.id or False
927 ctx.update({'company_id': inv.company_id.id})
926 if not period_id:928 if not period_id:
927 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)])929 period_ids = period_obj.find(cr, uid, inv.date_invoice, context=ctx)
928 if period_ids:930 period_id = period_ids and period_ids[0] or False
929 period_id = period_ids[0]
930 if period_id:931 if period_id:
931 move['period_id'] = period_id932 move['period_id'] = period_id
932 for i in line:933 for i in line:

Subscribers

People subscribed via source and target branches

to all changes: