Merge lp:~openerp-dev/openobject-addons/7.0-opw-589937-ado into lp:openobject-addons/7.0

Proposed by Amit Dodiya (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 9025
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-589937-ado
Merge into: lp:openobject-addons/7.0
Diff against target: 40 lines (+9/-3)
2 files modified
account/account_invoice.py (+7/-1)
account/account_invoice_view.xml (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-589937-ado
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Xavier ALT Pending
Review via email: mp+159187@code.launchpad.net

Description of the change

Hello,

"[IMP]account: displayed warning message while changing/adding fiscal position on invoice if invoice line is already created"

Issue:
While adding the fiscal position on invoice the tax mapping is not performed on existing invoice lines it only affects on new line created after adding fiscal position.

For version 7.0 i have implemented onchange method on fiscal position for displaying a message which triggers while changing/adding fiscal position on invoice if you have invoice line is already created in invoice.

Regards,
Amit Dodiya

To post a comment you must log in.
9025. By Amit Dodiya (OpenERP)

[IMP]account: displayed warning message while changing/adding fiscal position on invoice if invoice line is already created

Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Unmerged revisions

9025. By Amit Dodiya (OpenERP)

[IMP]account: displayed warning message while changing/adding fiscal position on invoice if invoice line is already created

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-03-29 15:59:38 +0000
3+++ account/account_invoice.py 2013-04-16 16:01:26 +0000
4@@ -308,7 +308,13 @@
5 ]
6
7
8-
9+ def onchange_fiscal_position(self, cr, uid, ids, fiscal_position_id, context):
10+ if fiscal_position_id and ids:
11+ invoice_line = self.pool.get('account.invoice.line').search(cr, uid, [('invoice_id', '=', ids[0])])
12+ if invoice_line:
13+ raise osv.except_osv(_('Warning!'), _('Be careful, We noticed change in fiscal position.' \
14+ 'Lines are already created in invoice. If you want impact of this fiscal position you need to recreate the existing invoice lines !'))
15+ return {'value': {'fiscal_position': fiscal_position_id}}
16
17 def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
18 journal_obj = self.pool.get('account.journal')
19
20=== modified file 'account/account_invoice_view.xml'
21--- account/account_invoice_view.xml 2013-03-13 12:43:17 +0000
22+++ account/account_invoice_view.xml 2013-04-16 16:01:26 +0000
23@@ -167,7 +167,7 @@
24 on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)"
25 context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"
26 domain="[('supplier', '=', True)]"/>
27- <field name="fiscal_position" widget="selection"/>
28+ <field name="fiscal_position" widget="selection" on_change="onchange_fiscal_position(fiscal_position, context)"/>
29 <field name="origin"/>
30 <field name="supplier_invoice_number"/>
31 <label for="reference_type"/>
32@@ -321,7 +321,7 @@
33 on_change="onchange_partner_id(type,partner_id,date_invoice,payment_term, partner_bank_id,company_id)"
34 groups="base.group_user" context="{'search_default_customer':1, 'show_address': 1}"
35 options='{"always_reload": True}'/>
36- <field name="fiscal_position" widget="selection" />
37+ <field name="fiscal_position" widget="selection" on_change="onchange_fiscal_position(fiscal_position, context)"/>
38 </group>
39 <group>
40 <field name="date_invoice"/>