Merge lp:~vauxoo/openerp-venezuela-localization/miguel-Bug918565 into lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk

Proposed by Miguel Delgado (Vauxoo)
Status: Merged
Merged at revision: 553
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/miguel-Bug918565
Merge into: lp:~openerp-venezuela/openerp-venezuela-localization/6.0-trunk
Diff against target: 37 lines (+17/-1)
2 files modified
l10n_ve_withholding_iva/model/invoice.py (+16/-0)
l10n_ve_withholding_iva/workflow/account_workflow.xml (+1/-1)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/miguel-Bug918565
Reviewer Review Type Date Requested Status
Gabriela Quilarque Pending
Review via email: mp+89306@code.launchpad.net

This proposal supersedes a proposal from 2012-01-19.

Description of the change

fix 918565

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_ve_withholding_iva/model/invoice.py'
2--- l10n_ve_withholding_iva/model/invoice.py 2012-01-14 22:45:30 +0000
3+++ l10n_ve_withholding_iva/model/invoice.py 2012-01-19 17:54:27 +0000
4@@ -149,6 +149,22 @@
5 'wh_iva_rate': wh_iva_rate,
6 })
7
8+ def action_wh_iva_supervisor(self, cr, uid, ids, *args):
9+ user_obj= self.pool.get('res.users')
10+ user_brw= user_obj.browse(cr,uid,uid)
11+ print
12+ for inv in self.browse(cr, uid, ids):
13+ if inv.amount_total==0.0 and inv.currency_id.id != user_brw.company_id.currency_id.id:
14+ raise osv.except_osv('Invalid Action !', _('The currency of the invoice does not match with the currency of the company. Check this please'))
15+
16+ elif inv.amount_total==0.0 or inv.currency_id.id != user_brw.company_id.currency_id.id:
17+ if inv.amount_total==0.0:
18+ raise osv.except_osv('Invalid Action !', _('This invoice has total amount %s %s check the products price')%(inv.amount_total,inv.currency_id.symbol))
19+ elif inv.currency_id.id != user_brw.company_id.currency_id.id:
20+ raise osv.except_osv('Invalid Action !', _('The currency of the invoice does not match with the currency of the company. Check this please'))
21+ return True
22+
23+
24 def action_wh_iva_create(self, cr, uid, ids, *args):
25 wh_iva_obj = self.pool.get('account.wh.iva')
26 for inv in self.browse(cr, uid, ids):
27
28=== modified file 'l10n_ve_withholding_iva/workflow/account_workflow.xml'
29--- l10n_ve_withholding_iva/workflow/account_workflow.xml 2012-01-03 15:23:32 +0000
30+++ l10n_ve_withholding_iva/workflow/account_workflow.xml 2012-01-19 17:54:27 +0000
31@@ -14,7 +14,7 @@
32 <field name="name">Withholding Vat</field>
33 <field name="kind">subflow</field>
34 <field name="subflow_id" ref="wh_iva_order"/>
35- <field name="action">action_wh_iva_create()</field>
36+ <field name="action">action_wh_iva_supervisor() and action_wh_iva_create()</field>
37 </record>
38
39