Add @api.model on method that should use it

Improve log msg
This commit is contained in:
Alexis de Lattre
2018-12-17 11:17:43 +01:00
parent 813c123517
commit 66532aec75

View File

@@ -253,6 +253,7 @@ class AccountAccount(models.Model):
logger.info("END of the script 'fix bank and cash account types'") logger.info("END of the script 'fix bank and cash account types'")
return True return True
@api.model
def create_account_groups(self, level=2, name_prefix=u'Comptes '): def create_account_groups(self, level=2, name_prefix=u'Comptes '):
'''Should be launched by a script. Make sure the account_group module is installed '''Should be launched by a script. Make sure the account_group module is installed
(the account_usability module doesn't depend on it currently''' (the account_usability module doesn't depend on it currently'''
@@ -262,7 +263,7 @@ class AccountAccount(models.Model):
if len(companies) > 1: if len(companies) > 1:
logger.info( logger.info(
'Multi-company detected: running script create_account_groups ' 'Multi-company detected: running script create_account_groups '
'as root') 'as admin')
self = self.sudo() self = self.sudo()
ago = self.env['account.group'] ago = self.env['account.group']
groups = ago.search([]) groups = ago.search([])