[FIX] account,base: python 3.8 compatibility
Remove warnings Add mandatory parameter posonlyargs closes odoo/odoo#40396 X-original-commit: aeb1e592a6fbc918fb4edf4a8953aa375124337d Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit is contained in:
@@ -1350,7 +1350,7 @@ class AccountTax(models.Model):
|
||||
|
||||
@api.onchange('amount_type')
|
||||
def onchange_amount_type(self):
|
||||
if self.amount_type is not 'group':
|
||||
if self.amount_type != 'group':
|
||||
self.children_tax_ids = [(5,)]
|
||||
if self.amount_type == 'group':
|
||||
self.description = None
|
||||
|
||||
@@ -94,6 +94,7 @@ class Contextifier(ast.NodeTransformer):
|
||||
# handle that cross-version
|
||||
kwonlyargs=[],
|
||||
kw_defaults=[],
|
||||
posonlyargs=[],
|
||||
),
|
||||
body=Contextifier(self._safe_names + tuple(names)).visit(node.body)
|
||||
), node)
|
||||
@@ -542,7 +543,7 @@ class QWeb(object):
|
||||
ast.arg(arg='values', annotation=None),
|
||||
ast.arg(arg='options', annotation=None),
|
||||
ast.arg(arg='log', annotation=None),
|
||||
], defaults=[], vararg=None, kwarg=None, kwonlyargs=[], kw_defaults=[]),
|
||||
], defaults=[], vararg=None, kwarg=None, posonlyargs=[], kwonlyargs=[], kw_defaults=[]),
|
||||
body=body or [ast.Return()],
|
||||
decorator_list=[])
|
||||
if lineno is not None:
|
||||
|
||||
@@ -597,7 +597,7 @@ class ResConfigSettings(models.TransientModel, ResConfigModuleInstallationMixin)
|
||||
# other fields: execute method 'set_values'
|
||||
# Methods that start with `set_` are now deprecated
|
||||
for method in dir(self):
|
||||
if method.startswith('set_') and method is not 'set_values':
|
||||
if method.startswith('set_') and method != 'set_values':
|
||||
_logger.warning(_('Methods that start with `set_` are deprecated. Override `set_values` instead (Method %s)') % method)
|
||||
|
||||
def execute(self):
|
||||
|
||||
Reference in New Issue
Block a user