mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix #IB181K app_odoo_customize对18版本增加模块类型,Odoo中文应用。了解下我们需要优先升级的模块18
This commit is contained in:
@@ -73,6 +73,7 @@
|
|||||||
'app_odoo_customize/static/src/js/user_menu.js',
|
'app_odoo_customize/static/src/js/user_menu.js',
|
||||||
'app_odoo_customize/static/src/js/ribbon.js',
|
'app_odoo_customize/static/src/js/ribbon.js',
|
||||||
'app_odoo_customize/static/src/js/dialog.js',
|
'app_odoo_customize/static/src/js/dialog.js',
|
||||||
|
'app_odoo_customize/static/src/js/base_import_list_renderer.js',
|
||||||
'app_odoo_customize/static/src/webclient/*.js',
|
'app_odoo_customize/static/src/webclient/*.js',
|
||||||
'app_odoo_customize/static/src/webclient/user_menu.xml',
|
'app_odoo_customize/static/src/webclient/user_menu.xml',
|
||||||
'app_odoo_customize/static/src/xml/res_config_edition.xml',
|
'app_odoo_customize/static/src/xml/res_config_edition.xml',
|
||||||
|
|||||||
@@ -96,3 +96,10 @@ class IrModuleModule(models.Model):
|
|||||||
if author in ['odooai.cn', 'sunpop.cn', 'odooapp.cn']:
|
if author in ['odooai.cn', 'sunpop.cn', 'odooapp.cn']:
|
||||||
self.module_type = 'odooapp.cn'
|
self.module_type = 'odooapp.cn'
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
def web_read(self, specification):
|
||||||
|
fields = list(specification.keys())
|
||||||
|
module_type = self.env.context.get('module_type', 'official')
|
||||||
|
if module_type == 'odooapp.cn':
|
||||||
|
self.env.context = {**self.env.context, "module_type": 'official'}
|
||||||
|
return super().web_read(specification)
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/** @odoo-module */
|
||||||
|
|
||||||
|
import { patch } from "@web/core/utils/patch";
|
||||||
|
import { ImportModuleListRenderer } from "@base_import_module/base_import_list_renderer";
|
||||||
|
|
||||||
|
patch(ImportModuleListRenderer.prototype, {
|
||||||
|
async onCellClicked(record, column, ev) {
|
||||||
|
if (record._values.module_type && record._values.module_type === 'odooapp.cn') {
|
||||||
|
const re_action = {
|
||||||
|
name: "more_info",
|
||||||
|
res_model: "ir.module.module",
|
||||||
|
res_id: record.resId,
|
||||||
|
type: "ir.actions.act_window",
|
||||||
|
views: [[false, "form"]],
|
||||||
|
context: {
|
||||||
|
'module_name': record._values.name,
|
||||||
|
'module_type': record._values.module_type,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.env.services.action.doAction(re_action);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
super.onCellClicked(record, column, ev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -54,6 +54,18 @@
|
|||||||
<field name="addons_path_id" invisible="1"/>
|
<field name="addons_path_id" invisible="1"/>
|
||||||
<field name="addons_path" groups="base.group_no_one"/>
|
<field name="addons_path" groups="base.group_no_one"/>
|
||||||
</field>
|
</field>
|
||||||
|
<xpath expr="//button[@name='button_immediate_install']" position="attributes">
|
||||||
|
<attribute name="invisible">to_buy or state != 'uninstalled' or (module_type and module_type not in ('official', 'odooapp.cn'))</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//button[@name='button_immediate_upgrade']" position="attributes">
|
||||||
|
<attribute name="invisible">state == 'uninstalled' or (module_type and module_type not in ('official', 'odooapp.cn'))</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//button[@name='button_immediate_install_app']" position="attributes">
|
||||||
|
<attribute name="invisible">state != 'uninstalled' or module_type in ('official', 'odooapp.cn')</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//button[@name='button_immediate_install_app'][2]" position="attributes">
|
||||||
|
<attribute name="invisible">state == 'uninstalled' or module_type in ('official', 'odooapp.cn')</attribute>
|
||||||
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
@@ -70,6 +82,15 @@
|
|||||||
<xpath expr="//main//code" position="attributes">
|
<xpath expr="//main//code" position="attributes">
|
||||||
<attribute name="groups"></attribute>
|
<attribute name="groups"></attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
<xpath expr="//button[@name='button_immediate_install']" position="attributes">
|
||||||
|
<attribute name="invisible">state != 'uninstalled' or (module_type and module_type not in ('official', 'odooapp.cn'))</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//button[@name='button_immediate_install_app']" position="attributes">
|
||||||
|
<attribute name="invisible">state != 'uninstalled' or module_type in ('official', 'odooapp.cn')</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//button[@name='button_immediate_install_app'][2]" position="attributes">
|
||||||
|
<attribute name="invisible">state == 'uninstalled' or module_type in ('official', 'odooapp.cn')</attribute>
|
||||||
|
</xpath>
|
||||||
<!--显示快速升级-->
|
<!--显示快速升级-->
|
||||||
<xpath expr="//button[@name='button_immediate_install']" position="after">
|
<xpath expr="//button[@name='button_immediate_install']" position="after">
|
||||||
<button type="object" class="btn btn-default btn-sm float-right" name="button_uninstall_wizard"
|
<button type="object" class="btn btn-default btn-sm float-right" name="button_uninstall_wizard"
|
||||||
|
|||||||
Reference in New Issue
Block a user