Browse Source
[IMP] company_country: Don't create DB table for model (#1791 )
That model is intended only to set config and has no fields, so there is
no need for creating a DB table for it. This is achieved by switching
the model type from transient to abstract.
12.0-mig-module_prototyper_last
Luis González [Vauxoo]
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
21 additions and
2 deletions
company_country/__manifest__.py
company_country/migrations/12.0.1.0.2/pre-migration.py
company_country/models/res_config.py
company_country/readme/CONTRIBUTORS.rst
@ -3,7 +3,7 @@
{
" name " : " Company Country " ,
" summary " : " Set country to main company " ,
" version " : " 12.0.1.0.1 " ,
" version " : " 12.0.1.0.2 " ,
" category " : " base " ,
" website " : " https://github.com/OCA/server-tools/tree/12.0/company_country " ,
" maintainers " : [ ' moylop260 ' , ' luisg123v ' ] ,
@ -0,0 +1,18 @@
import logging
from psycopg2.extensions import AsIs
from odoo import tools
_logger = logging . getLogger ( __name__ )
def migrate ( cr , version ) :
drop_table_model_company_country ( cr )
def drop_table_model_company_country ( cr ) :
tablename = ' company_country_config_settings '
if tools . table_exists ( cr , tablename ) :
_logger . info ( " Dropping table %s " , tablename )
cr . execute ( " DROP TABLE IF EXISTS %s ; " , ( AsIs ( tablename ) , ) )
@ -9,7 +9,7 @@ from odoo.exceptions import ValidationError
_logger = logging . getLogger ( __name__ )
class CompanyCountryConfigSettings ( models . Transien tModel) :
class CompanyCountryConfigSettings ( models . Abstrac tModel) :
_name = ' company.country.config.settings '
_description = ' Company Country Configuration Settings '
@ -1,2 +1,3 @@
* Moisés López <moylop260@vauxoo.com>
* Luis González <lgonzalez@vauxoo.com>