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
=== modified file 'l10n_ve_withholding_iva/model/invoice.py'
--- l10n_ve_withholding_iva/model/invoice.py 2012-01-14 22:45:30 +0000
+++ l10n_ve_withholding_iva/model/invoice.py 2012-01-19 17:54:27 +0000
@@ -149,6 +149,22 @@
149 'wh_iva_rate': wh_iva_rate,149 'wh_iva_rate': wh_iva_rate,
150 })150 })
151151
152 def action_wh_iva_supervisor(self, cr, uid, ids, *args):
153 user_obj= self.pool.get('res.users')
154 user_brw= user_obj.browse(cr,uid,uid)
155 print
156 for inv in self.browse(cr, uid, ids):
157 if inv.amount_total==0.0 and inv.currency_id.id != user_brw.company_id.currency_id.id:
158 raise osv.except_osv('Invalid Action !', _('The currency of the invoice does not match with the currency of the company. Check this please'))
159
160 elif inv.amount_total==0.0 or inv.currency_id.id != user_brw.company_id.currency_id.id:
161 if inv.amount_total==0.0:
162 raise osv.except_osv('Invalid Action !', _('This invoice has total amount %s %s check the products price')%(inv.amount_total,inv.currency_id.symbol))
163 elif inv.currency_id.id != user_brw.company_id.currency_id.id:
164 raise osv.except_osv('Invalid Action !', _('The currency of the invoice does not match with the currency of the company. Check this please'))
165 return True
166
167
152 def action_wh_iva_create(self, cr, uid, ids, *args):168 def action_wh_iva_create(self, cr, uid, ids, *args):
153 wh_iva_obj = self.pool.get('account.wh.iva')169 wh_iva_obj = self.pool.get('account.wh.iva')
154 for inv in self.browse(cr, uid, ids):170 for inv in self.browse(cr, uid, ids):
155171
=== modified file 'l10n_ve_withholding_iva/workflow/account_workflow.xml'
--- l10n_ve_withholding_iva/workflow/account_workflow.xml 2012-01-03 15:23:32 +0000
+++ l10n_ve_withholding_iva/workflow/account_workflow.xml 2012-01-19 17:54:27 +0000
@@ -14,7 +14,7 @@
14 <field name="name">Withholding Vat</field>14 <field name="name">Withholding Vat</field>
15 <field name="kind">subflow</field>15 <field name="kind">subflow</field>
16 <field name="subflow_id" ref="wh_iva_order"/>16 <field name="subflow_id" ref="wh_iva_order"/>
17 <field name="action">action_wh_iva_create()</field>17 <field name="action">action_wh_iva_supervisor() and action_wh_iva_create()</field>
18 </record>18 </record>
1919
20 20