From ddae539d94076b5b4a60a8e97736ad299cf557fa Mon Sep 17 00:00:00 2001 From: ced <> Date: Thu, 4 Oct 2007 05:59:39 +0000 Subject: [PATCH] Improve payment, invoice, statement - Use the right reference from invoice on account move lines - Add a reference type on invoice - Payment are now multi-currency - Add wizard to populate statement - Make thread safe payment wizard - Add mod10r in utils - Add colors on statement lines bzr revid: ced-24b50b0267903bb60e05ed673d6debc7fd755422 --- bin/tools/misc.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bin/tools/misc.py b/bin/tools/misc.py index e4b2843662f..3c5e790ebb5 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -423,4 +423,19 @@ def get_user_companies(cr, user): compids.extend(_get_company_children(cr, compids)) return compids +def mod10r(number): + """ + Input number : account or invoice number + Output return: the same number completed with the recursive mod10 + key + """ + codec=[0,9,4,6,8,2,7,1,3,5] + report = 0 + result="" + for digit in number: + result += digit + if digit.isdigit(): + report = codec[ (int(digit) + report) % 10 ] + return result + str((10 - report) % 10) + # vim:noexpandtab