Merge lp:~vauxoo/openerp-venezuela-localization/7.0-minor_fixes-rev01-hbto into lp:openerp-venezuela-localization

Proposed by hbto [Vauxoo] http://www.vauxoo.com
Status: Merged
Approved by: hbto [Vauxoo] http://www.vauxoo.com
Approved revision: 992
Merged at revision: 992
Proposed branch: lp:~vauxoo/openerp-venezuela-localization/7.0-minor_fixes-rev01-hbto
Merge into: lp:openerp-venezuela-localization
Diff against target: 21 lines (+7/-4)
1 file modified
l10n_ve_fiscal_book/model/fiscal_book.py (+7/-4)
To merge this branch: bzr merge lp:~vauxoo/openerp-venezuela-localization/7.0-minor_fixes-rev01-hbto
Reviewer Review Type Date Requested Status
hbto [Vauxoo] http://www.vauxoo.com Approve
Review via email: mp+219582@code.launchpad.net

Description of the change

Fixing get_transaction_type method

To post a comment you must log in.
Revision history for this message
hbto [Vauxoo] http://www.vauxoo.com (humbertoarocha) wrote :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'l10n_ve_fiscal_book/model/fiscal_book.py'
2--- l10n_ve_fiscal_book/model/fiscal_book.py 2014-05-14 16:26:24 +0000
3+++ l10n_ve_fiscal_book/model/fiscal_book.py 2014-05-14 19:10:15 +0000
4@@ -1674,10 +1674,13 @@
5 rp_id = rp_obj._find_accounting_partner(inv_brw.partner_id)
6 rp_brw = rp_obj.browse(cr, uid, rp_id, context=context)
7 fb_brw = self.browse(cr, uid, fb_id, context=context)
8- return inv_brw.customs_form_id \
9- and (fb_brw.type == 'sale' and 'ex' or 'im') \
10- or (fb_brw.type == 'purchase' and 'do' \
11- or (rp_brw.vat_subjected and 'tp' or 'ntp' ))
12+ if inv_brw.customs_form_id:
13+ return 'ex' if fb_brw.type == 'sale' else 'im'
14+ else:
15+ if fb_brw.type == 'purchase':
16+ return 'do'
17+ else:
18+ return 'tp' if inv_brw.partner_id.vat_subjected else 'ntp'
19
20 def unlink(self, cr, uid, ids, context=None):
21 """ Overwrite the unlink method to throw an exception if the book is