Merge lp:~gs.clearcorp/openobject-addons/6.1-ccorp into lp:~clearcorp-drivers/openobject-addons/6.1-ccorp

Proposed by Glen Sojo
Status: Merged
Merged at revision: 6824
Proposed branch: lp:~gs.clearcorp/openobject-addons/6.1-ccorp
Merge into: lp:~clearcorp-drivers/openobject-addons/6.1-ccorp
Diff against target: 98 lines (+60/-28)
1 file modified
account_voucher/account_voucher.py (+60/-28)
To merge this branch: bzr merge lp:~gs.clearcorp/openobject-addons/6.1-ccorp
Reviewer Review Type Date Requested Status
ClearCorp drivers Pending
Review via email: mp+240725@code.launchpad.net
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 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py 2013-08-07 21:35:18 +0000
+++ account_voucher/account_voucher.py 2014-11-05 14:27:57 +0000
@@ -937,34 +937,66 @@
937 # Even if the amount_currency is never filled, we need to pass the foreign currency because otherwise937 # Even if the amount_currency is never filled, we need to pass the foreign currency because otherwise
938 # the receivable/payable account may have a secondary currency, which render this field mandatory938 # the receivable/payable account may have a secondary currency, which render this field mandatory
939 account_currency_id = company_currency <> current_currency and current_currency or False939 account_currency_id = company_currency <> current_currency and current_currency or False
940 move_line = {940 if line.voucher_id.type == 'payment':
941 'journal_id': line.voucher_id.journal_id.id,941 #if True:
942 'period_id': line.voucher_id.period_id.id,942 move_line = {
943 'name': _('change')+': '+(line.name or '/'),943 'journal_id': line.voucher_id.journal_id.id,
944 'account_id': line.voucher_id.type in ('sale', 'receipt') and line.account_id.id or account_id.id,944 'period_id': line.voucher_id.period_id.id,
945 'move_id': move_id,945 'name': _('change')+': '+(line.name or '/'),
946 'partner_id': line.voucher_id.partner_id.id,946 'account_id': line.voucher_id.type in ('sale', 'receipt') and line.account_id.id or account_id.id,
947 'currency_id': account_currency_id,947 'move_id': move_id,
948 'amount_currency': 0.0,948 'partner_id': line.voucher_id.partner_id.id,
949 'quantity': 1,949 'currency_id': account_currency_id,
950 'credit': amount_residual > 0 and amount_residual or 0.0,950 'amount_currency': 0.0,
951 'debit': amount_residual < 0 and -amount_residual or 0.0,951 'quantity': 1,
952 'date': line.voucher_id.date,952 'credit': amount_residual < 0 and -amount_residual or 0.0,
953 }953 'debit': amount_residual > 0 and amount_residual or 0.0,
954 move_line_counterpart = {954 'date': line.voucher_id.date,
955 'journal_id': line.voucher_id.journal_id.id,955 }
956 'period_id': line.voucher_id.period_id.id,956 move_line_counterpart = {
957 'name': _('change')+': '+(line.name or '/'),957 'journal_id': line.voucher_id.journal_id.id,
958 'account_id': line.voucher_id.type in ('sale', 'receipt') and account_id.id or line.account_id.id,958 'period_id': line.voucher_id.period_id.id,
959 'move_id': move_id,959 'name': _('change')+': '+(line.name or '/'),
960 'amount_currency': 0.0,960 'account_id': line.voucher_id.type in ('sale', 'receipt') and account_id.id or line.account_id.id,
961 'partner_id': line.voucher_id.partner_id.id,961 'move_id': move_id,
962 'currency_id': account_currency_id,962 'amount_currency': 0.0,
963 'quantity': 1,963 'partner_id': line.voucher_id.partner_id.id,
964 'debit': amount_residual > 0 and amount_residual or 0.0,964 'currency_id': account_currency_id,
965 'credit': amount_residual < 0 and -amount_residual or 0.0,965 'quantity': 1,
966 'date': line.voucher_id.date,966 'debit': amount_residual < 0 and -amount_residual or 0.0,
967 }967 'credit': amount_residual > 0 and amount_residual or 0.0,
968 'date': line.voucher_id.date,
969 }
970 else:
971 move_line = {
972 'journal_id': line.voucher_id.journal_id.id,
973 'period_id': line.voucher_id.period_id.id,
974 'name': _('change')+': '+(line.name or '/'),
975 'account_id': line.voucher_id.type in ('sale', 'receipt') and line.account_id.id or account_id.id,
976 'move_id': move_id,
977 'partner_id': line.voucher_id.partner_id.id,
978 'currency_id': account_currency_id,
979 'amount_currency': 0.0,
980 'quantity': 1,
981 'credit': amount_residual > 0 and amount_residual or 0.0,
982 'debit': amount_residual < 0 and -amount_residual or 0.0,
983 'date': line.voucher_id.date,
984 }
985 move_line_counterpart = {
986 'journal_id': line.voucher_id.journal_id.id,
987 'period_id': line.voucher_id.period_id.id,
988 'name': _('change')+': '+(line.name or '/'),
989 'account_id': line.voucher_id.type in ('sale', 'receipt') and account_id.id or line.account_id.id,
990 'move_id': move_id,
991 'amount_currency': 0.0,
992 'partner_id': line.voucher_id.partner_id.id,
993 'currency_id': account_currency_id,
994 'quantity': 1,
995 'debit': amount_residual > 0 and amount_residual or 0.0,
996 'credit': amount_residual < 0 and -amount_residual or 0.0,
997 'date': line.voucher_id.date,
998 }
999
968 if line.voucher_id.type not in ('sale', 'receipt'):1000 if line.voucher_id.type not in ('sale', 'receipt'):
969 # in case of supplier vouchers, the line with the payable account is 'move_line_counterpart', 1001 # in case of supplier vouchers, the line with the payable account is 'move_line_counterpart',
970 # and thus it must be returned as first element1002 # and thus it must be returned as first element

Subscribers

People subscribed via source and target branches