[MIG] sql_request_abstract: Migration to 15.0

pull/669/head
mariadforgeflow 2021-12-02 12:18:35 +01:00 committed by Sylvain LE GAL
parent 01d76a12fe
commit 5a93d2e267
3 changed files with 4 additions and 7 deletions

View File

@ -4,7 +4,7 @@
{ {
"name": "SQL Request Abstract", "name": "SQL Request Abstract",
"version": "14.0.1.1.0", "version": "15.0.1.0.0",
"author": "GRAP,Akretion,Odoo Community Association (OCA)", "author": "GRAP,Akretion,Odoo Community Association (OCA)",
"maintainers": ["legalsylvain"], "maintainers": ["legalsylvain"],
"website": "https://github.com/OCA/reporting-engine", "website": "https://github.com/OCA/reporting-engine",

View File

@ -51,7 +51,7 @@ class SQLRequestMixin(models.AbstractModel):
def _default_group_ids(self): def _default_group_ids(self):
ir_model_obj = self.env["ir.model.data"] ir_model_obj = self.env["ir.model.data"]
return [ return [
ir_model_obj.xmlid_to_res_id("sql_request_abstract.group_sql_request_user") ir_model_obj._xmlid_to_res_id("sql_request_abstract.group_sql_request_user")
] ]
@api.model @api.model
@ -59,17 +59,15 @@ class SQLRequestMixin(models.AbstractModel):
return [] return []
# Columns Section # Columns Section
name = fields.Char("Name", required=True) name = fields.Char(required=True)
query = fields.Text( query = fields.Text(
string="Query",
required=True, required=True,
help="You can't use the following words" help="You can't use the following words"
": DELETE, DROP, CREATE, INSERT, ALTER, TRUNCATE, EXECUTE, UPDATE.", ": DELETE, DROP, CREATE, INSERT, ALTER, TRUNCATE, EXECUTE, UPDATE.",
) )
state = fields.Selection( state = fields.Selection(
string="State",
selection=STATE_SELECTION, selection=STATE_SELECTION,
default="draft", default="draft",
help="State of the Request:\n" help="State of the Request:\n"
@ -180,7 +178,7 @@ class SQLRequestMixin(models.AbstractModel):
SQL(query), SQL(view_name) SQL(query), SQL(view_name)
) )
else: else:
raise UserError(_("Unimplemented mode : '%s'" % mode)) raise UserError(_("Unimplemented mode : '%s'") % mode)
if rollback: if rollback:
rollback_name = self._create_savepoint() rollback_name = self._create_savepoint()

View File

@ -1 +0,0 @@
* Move modules sql_request_abstract and sql_export to oca/reporting-engine for version 15