Merge lp:~vauxoo/addons-vauxoo/8.0-addons-vauxoo-dev-julio into lp:addons-vauxoo

Proposed by Julio Serna-http://www.vauxoo.com
Status: Merged
Merged at revision: 897
Proposed branch: lp:~vauxoo/addons-vauxoo/8.0-addons-vauxoo-dev-julio
Merge into: lp:addons-vauxoo
Diff against target: 38 lines (+5/-3)
2 files modified
account_voucher_tax/account_voucher.py (+4/-2)
invoice_datetime/invoice.py (+1/-1)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/8.0-addons-vauxoo-dev-julio
Reviewer Review Type Date Requested Status
Moisés López - http://www.vauxoo.com Pending
Julio Serna-http://www.vauxoo.com Pending
Review via email: mp+242439@code.launchpad.net

Description of the change

added round to debit/credit and validate invoice_date_tz field in write function when exist value

To post a comment you must log in.
897. By Julio Serna-http://www.vauxoo.com

[MERGE] modified function write to validated field invoice_date_tz and validate round in debit/credit field

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_voucher_tax/account_voucher.py'
2--- account_voucher_tax/account_voucher.py 2014-11-19 19:21:02 +0000
3+++ account_voucher_tax/account_voucher.py 2014-11-20 23:19:19 +0000
4@@ -535,17 +535,19 @@
5 res_round = {}
6 res_without_round = {}
7 res_ids = {}
8+ object_dp = self.pool.get('decimal.precision')
9+ round_val = object_dp.precision_get(cr, uid, 'Account')
10
11 for val_round in dat:
12 res_round.setdefault(val_round['account_id'], 0)
13 res_without_round.setdefault(val_round['account_id'], 0)
14 res_ids.setdefault(val_round['account_id'], 0)
15- res_round[val_round['account_id']] += val_round['round']
16+ res_round[val_round['account_id']] += round(val_round['round'], round_val)
17 res_without_round[val_round['account_id']] += val_round['without']
18 res_ids[val_round['account_id']] = val_round['id']
19 for res_diff_id in res_round.items():
20 diff_val = abs(res_without_round[res_diff_id[0]]) - abs(res_round[res_diff_id[0]])
21- diff_val = round(diff_val, 2)
22+ diff_val = round(diff_val, round_val)
23 if diff_val != 0.00:
24 move_diff_id = [res_ids[res_diff_id[0]]]
25 for move in self.browse(cr, uid, move_diff_id, context=context):
26
27=== modified file 'invoice_datetime/invoice.py'
28--- invoice_datetime/invoice.py 2014-11-19 19:21:02 +0000
29+++ invoice_datetime/invoice.py 2014-11-20 23:19:19 +0000
30@@ -119,7 +119,7 @@
31 datetime_inv = invoice.invoice_datetime and \
32 datetime.datetime.strptime(invoice.invoice_datetime,
33 "%Y-%m-%d %H:%M:%S") or False
34- if datetime_inv:
35+ if datetime_inv and not invoice.date_invoice_tz:
36 vals.update(
37 {'date_invoice_tz': self._get_datetime_with_user_tz(
38 cr, uid, datetime_inv)})