diff --git a/account_credit_control/__openerp__.py b/account_credit_control/__openerp__.py index 3cd76fa96..0cf428b77 100644 --- a/account_credit_control/__openerp__.py +++ b/account_credit_control/__openerp__.py @@ -55,7 +55,8 @@ On each generated line, you have many choices: * Change the state (so you can ignore or reopen lines) """, 'website': 'http://www.camptocamp.com', - 'init_xml': ["data.xml"], + 'init_xml': ["data.xml", + ], 'update_xml': ["line_view.xml", "account_view.xml", "partner_view.xml", diff --git a/account_credit_control/line.py b/account_credit_control/line.py index 108d96201..f19fe712f 100644 --- a/account_credit_control/line.py +++ b/account_credit_control/line.py @@ -170,7 +170,7 @@ class CreditControlLine(Model): context=context) errors = [] - db, __ = pooler.get_db_and_pool(cursor.dbname) + db = pooler.get_db(cursor.dbname) local_cr = db.cursor() try: for line in ml_obj.browse(cursor, uid, lines, context): diff --git a/account_credit_control/run.py b/account_credit_control/run.py index 78058dad1..b96e6e2e5 100644 --- a/account_credit_control/run.py +++ b/account_credit_control/run.py @@ -155,7 +155,8 @@ class CreditControlRun(Model): Lock the ``credit_control_run`` Postgres table to avoid concurrent calls of this method. """ - context = context or {} + if context is None: + context = {} try: cursor.execute('SELECT id FROM credit_control_run' ' LIMIT 1 FOR UPDATE NOWAIT' )