Migrate to 14.0

pull/671/head
Florian da Costa 2021-03-22 17:30:58 +01:00 committed by Sylvain LE GAL
parent 333bccfd80
commit 102fddb50f
5 changed files with 12 additions and 9 deletions

View File

@ -4,7 +4,7 @@
{
"name": "SQL Export",
"version": "12.0.1.1.1",
"version": "14.0.1.0.0",
"author": "Akretion,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-tools",
"license": "AGPL-3",

View File

@ -1,3 +1,4 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_sql_export_all","access_sql_export_all","model_sql_export",,1,0,0,0
"access_sql_export_editor","access_sql_export_editor","model_sql_export",sql_request_abstract.group_sql_request_manager,1,1,1,1
"access_sql_file_wizard","access_sql_file_wizard","model_sql_file_wizard",,1,1,1,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_sql_export_all access_sql_export_all model_sql_export 1 0 0 0
3 access_sql_export_editor access_sql_export_editor model_sql_export sql_request_abstract.group_sql_request_manager 1 1 1 1
4 access_sql_file_wizard access_sql_file_wizard model_sql_file_wizard 1 1 1 0

View File

@ -6,10 +6,10 @@ import base64
from odoo import fields
from odoo.exceptions import UserError
from odoo.tests.common import TransactionCase, post_install
from odoo.tests.common import TransactionCase, tagged
@post_install(True)
@tagged("post_install", "-at_install")
class TestExportSqlQuery(TransactionCase):
def setUp(self):
super(TestExportSqlQuery, self).setUp()

View File

@ -83,7 +83,7 @@
<field name="name">Sql_export_tree_view</field>
<field name="model">sql.export</field>
<field name="arch" type="xml">
<tree string="SQL Export" colors="blue:state == 'draft'">
<tree string="SQL Export" decoration-info="state=='draft'">
<field name="name" />
<field name="state" />
<button

View File

@ -2,11 +2,12 @@
# @author: Florian da Costa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import json
from datetime import datetime
from lxml import etree
from odoo import api, fields, models, osv
from odoo import api, fields, models
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
@ -37,11 +38,12 @@ class SqlFileWizard(models.TransientModel):
toupdate_fields = []
for field in sql_export.field_ids:
toupdate_fields.append(field.name)
attrib = {"name": field.name}
if field.required:
attrib["required"] = "True"
attrib = {"name": field.name, "required": "0", "readonly": "0"}
view_field = etree.SubElement(group, "field", attrib=attrib)
osv.orm.setup_modifiers(view_field, self.fields_get(field.name))
modifiers = json.loads(view_field.get("modifiers", "{}"))
if field.required:
modifiers["required"] = True
view_field.set("modifiers", json.dumps(modifiers))
res["fields"].update(self.fields_get(toupdate_fields))
placeholder = eview.xpath(