Use direct access to backend classes
issue8836 review258421002
This commit is contained in:
1 parent
94a4d51d9a
commit
a62a3c5eb3
3 files changed
+7
-9
No files matched your search
+3
-3
@@ -735,7 +735,7 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
|
||||
invoice_query = Rule.query_get('account.invoice')
|
||||
Operator = fields.SQL_OPERATORS[operator]
|
||||
# SQLite uses float for sum
|
||||
if backend.name() == 'sqlite':
|
||||
if backend.name == 'sqlite':
|
||||
value = float(value)
|
||||
|
||||
union = (line.join(invoice, condition=(invoice.id == line.invoice)
|
||||
@@ -771,7 +771,7 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
|
||||
invoice_query = Rule.query_get('account.invoice')
|
||||
Operator = fields.SQL_OPERATORS[operator]
|
||||
# SQLite uses float for sum
|
||||
if backend.name() == 'sqlite':
|
||||
if backend.name == 'sqlite':
|
||||
value = float(value)
|
||||
|
||||
query = line.join(invoice,
|
||||
@@ -800,7 +800,7 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
|
||||
invoice_query = Rule.query_get('account.invoice')
|
||||
Operator = fields.SQL_OPERATORS[operator]
|
||||
# SQLite uses float for sum
|
||||
if backend.name() == 'sqlite':
|
||||
if backend.name == 'sqlite':
|
||||
value = float(value)
|
||||
|
||||
query = tax.select(tax.invoice,
|
||||
|
||||
@@ -58,8 +58,7 @@ class PartyPaymentTerm(ModelSQL, ValueMixin):
|
||||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
TableHandler = backend.get('TableHandler')
|
||||
exist = TableHandler.table_exist(cls._table)
|
||||
exist = backend.TableHandler.table_exist(cls._table)
|
||||
|
||||
super(PartyPaymentTerm, cls).__register__(module_name)
|
||||
|
||||
|
||||
+3
-4
@@ -251,7 +251,6 @@ class PaymentTermLineRelativeDelta(sequence_ordered(), ModelSQL, ModelView):
|
||||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
TableHandler = backend.get('TableHandler')
|
||||
transaction = Transaction()
|
||||
cursor = transaction.connection.cursor()
|
||||
pool = Pool()
|
||||
@@ -267,12 +266,12 @@ class PaymentTermLineRelativeDelta(sequence_ordered(), ModelSQL, ModelView):
|
||||
old_model_name = 'account.invoice.payment_term.line.relativedelta'
|
||||
old_table = config.get(
|
||||
'table', old_model_name, default=old_model_name.replace('.', '_'))
|
||||
if TableHandler.table_exist(old_table):
|
||||
TableHandler.table_rename(old_table, cls._table)
|
||||
if backend.TableHandler.table_exist(old_table):
|
||||
backend.TableHandler.table_rename(old_table, cls._table)
|
||||
|
||||
# Migration from 5.0: use ir.calendar
|
||||
migrate_calendar = False
|
||||
if TableHandler.table_exist(cls._table):
|
||||
if backend.TableHandler.table_exist(cls._table):
|
||||
cursor.execute(*sql_table.select(
|
||||
sql_table.month, sql_table.weekday,
|
||||
where=(sql_table.month != Null)
|
||||
|
||||
Reference in new issue
Block a user