Merge lp:~openerp-dev/openobject-addons/trunk-bug-1088219-mansi into lp:openobject-addons

Proposed by Mansi Kariya(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1088219-mansi
Merge into: lp:openobject-addons
Diff against target: 29 lines (+19/-0)
1 file modified
account/account_invoice.py (+19/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1088219-mansi
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+163849@code.launchpad.net

Description of the change

Hello,

    Added Constraint to check status of parent_id of account of invoice line.

Thanks.

-Mansi

To post a comment you must log in.
8662. By Mansi Kariya(OpenERP)

[MERGE]Trunk.

8663. By Mansi Kariya(OpenERP)

[FIX] Added constraint on parent_id of account_id

8664. By Mansi Kariya(OpenERP)

[MERGE] merge with main addons

Unmerged revisions

8664. By Mansi Kariya(OpenERP)

[MERGE] merge with main addons

8663. By Mansi Kariya(OpenERP)

[FIX] Added constraint on parent_id of account_id

8662. By Mansi Kariya(OpenERP)

[MERGE]Trunk.

8661. By Mansi Kariya(OpenERP)

[FIX] Added constraint on parent_id of account_id

8660. By Mansi Kariya(OpenERP)

[FIX] Added constraint on parent_id of account_id

8659. By Mansi Kariya(OpenERP)

[FIX] Done changes in purchase_workflow

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_invoice.py'
2--- account/account_invoice.py 2013-06-05 09:04:53 +0000
3+++ account/account_invoice.py 2013-06-07 06:48:41 +0000
4@@ -1434,6 +1434,25 @@
5 'company_id': fields.related('invoice_id','company_id',type='many2one',relation='res.company',string='Company', store=True, readonly=True),
6 'partner_id': fields.related('invoice_id','partner_id',type='many2one',relation='res.partner',string='Partner',store=True)
7 }
8+
9+ def _check_invoice_line_account_id(self, cr, uid, ids, context=None):
10+ for obj in self.browse(cr, uid, ids, context=context):
11+ parent_id=obj.account_id.parent_id
12+ def check(self,parent_id):
13+ if parent_id:
14+ if parent_id.active:
15+ return check(self,parent_id.parent_id)
16+ else:
17+ return False
18+ return True
19+ result_status= check(self,parent_id)
20+ if not result_status:
21+ return False
22+ return True
23+
24+ _constraints = [
25+ (_check_invoice_line_account_id, "Invoice line's selected Account or its parent account is inactive, Please active that or select active account only! ", ['account_id']),
26+ ]
27
28 def _default_account_id(self, cr, uid, context=None):
29 # XXX this gets the default account for the user's company,

Subscribers

People subscribed via source and target branches

to all changes: