Amit Dodiya (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/6.0-opw-58105-ado into
lp:openobject-addons/6.0.
Requested reviews:
Naresh(OpenERP) (nch-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-58105-ado/+merge/89657
Hello,
[FIX] Absolute value of bank line must be equal to voucher value"
There is a incomplete control in the bank statements line between amount and
the voucher.
Currently, it is only an absolute value control whereas the functional rule is
more complex:
When the voucher is a receipt : the bank line amount must be equal to the
voucher one.
and when the voucher is a payment : the amount must be the exact opposite to
the voucher one.
Thanks,
Amit
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-58105-ado/+merge/89657
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.0-opw-58105-ado.
=== modified file 'account/account_bank_statement.py'
--- account/account_bank_statement.py 2011-09-27 12:34:47 +0000
+++ account/account_bank_statement.py 2012-01-23 10:50:20 +0000
@@ -320,6 +320,9 @@
context = {}
for st in self.browse(cr, uid, ids, context=context):
+ if not st.line_ids:
+ raise osv.except_osv(_('Warning !'),
+ _('You can not confirm bank statement without statement line.'))
j_type = st.journal_id.type
company_currency_id = st.journal_id.company_id.currency_id.id
if not self.check_status_condition(cr, uid, st.state, journal_type=j_type):
=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py 2011-10-24 07:25:44 +0000
+++ account_voucher/account_voucher.py 2012-01-23 10:50:20 +0000
@@ -990,7 +990,8 @@
def _check_amount(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids, context=context):
if obj.voucher_id:
- if not (abs(obj.amount) == obj.voucher_id.amount):
+ if (((obj.voucher_id.type == "receipt") and (obj.amount <> obj.voucher_id.amount)) or
+ ((obj.voucher_id.type == "payment") and (obj.amount <> -obj.voucher_id.amount))):
return False
return True
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp