[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.
pull/1805/head
Luis González [Vauxoo] 2020-03-18 00:10:40 -06:00 committed by Luis González
parent 8e0d78ea80
commit 837369b780
4 changed files with 21 additions and 2 deletions

View File

@ -3,7 +3,7 @@
{ {
"name": "Company Country", "name": "Company Country",
"summary": "Set country to main company", "summary": "Set country to main company",
"version": "13.0.1.0.1", "version": "13.0.1.0.2",
"category": "base", "category": "base",
"website": "https://github.com/OCA/server-tools/tree/13.0/company_country", "website": "https://github.com/OCA/server-tools/tree/13.0/company_country",
"maintainers": ["moylop260", "luisg123v"], "maintainers": ["moylop260", "luisg123v"],

View File

@ -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),))

View File

@ -9,7 +9,7 @@ from odoo.exceptions import ValidationError
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
class CompanyCountryConfigSettings(models.TransientModel): class CompanyCountryConfigSettings(models.AbstractModel):
_name = "company.country.config.settings" _name = "company.country.config.settings"
_description = "Company Country Configuration Settings" _description = "Company Country Configuration Settings"

View File

@ -1 +1,2 @@
* Moisés López <moylop260@vauxoo.com> * Moisés López <moylop260@vauxoo.com>
* Luis González <lgonzalez@vauxoo.com>