This commit is contained in:
Ivan x390
2020-03-16 11:56:37 +08:00
7 changed files with 49 additions and 7 deletions

View File

@@ -45,6 +45,7 @@
9. 时间格式年月日为 2019-12-30时间为 22:10
10. 国家增加排序,中国排第一
11. 收款相关显示中国习惯
12. 翻译导出默认中文默认po
21. todo:中文演示数据(只有demo模式才加载)
""",
'pre_init_hook': 'pre_init_hook',

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data noupdate="1">
<data>
<!-- 各种默认值 -->
<!--设置客户默认国家为中国-->
<record id="res_partner_country_id_default" model="ir.default">
@@ -22,5 +22,15 @@
<field name="field_id" eval="ref('product.field_product_template__type')"/>
<field name="json_value">"product"</field>
</record>
<!--设置翻译导出默认中文-->
<record id="base_language_export_lang_default" model="ir.default">
<field name="field_id" eval="ref('base.field_base_language_export__lang')"/>
<field name="json_value">"zh_CN"</field>
</record>
<!--设置翻译导出默认po-->
<record id="base_language_export_format_default" model="ir.default">
<field name="field_id" eval="ref('base.field_base_language_export__format')"/>
<field name="json_value">"po"</field>
</record>
</data>
</odoo>

View File

@@ -23,7 +23,7 @@
{
'name': 'Customize odoo OEM (Boost, My Odoo)',
'version': '13.20.03.05',
'version': '13.20.03.15',
'author': 'Sunpop.cn',
'category': 'Productivity',
'website': 'https://www.sunpop.cn',
@@ -89,8 +89,8 @@
'views/app_odoo_customize_views.xml',
'views/app_theme_config_settings_views.xml',
'views/res_config_settings_views.xml',
'views/ir_module_module_views.xml',
'views/ir_views.xml',
'views/ir_module_module_views.xml',
'views/ir_ui_menu_views.xml',
# data
'data/ir_config_parameter.xml',

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-02-24 20:30+0000\n"
"PO-Revision-Date: 2020-02-24 20:30+0000\n"
"POT-Creation-Date: 2020-03-15 10:33+0000\n"
"PO-Revision-Date: 2020-03-15 10:33+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -89,7 +89,7 @@ msgstr "激活开发者模式"
#: code:addons/app_odoo_customize/static/src/xml/customize_user_menu.xml:0
#, python-format
msgid "Activate the developer mode (with assets)"
msgstr "激活开发者模式(Assets)"
msgstr "激活开发者模式 (assets)"
#. module: app_odoo_customize
#: model_terms:ir.ui.view,arch_db:app_odoo_customize.view_app_theme_config_settings
@@ -233,6 +233,12 @@ msgstr "开发者手册"
msgid "Documentation Url"
msgstr "用户手册链接"
#. module: app_odoo_customize
#: model:ir.actions.act_window,name:app_odoo_customize.action_server_module_multi_get_po
#: model_terms:ir.ui.view,arch_db:app_odoo_customize.app_module_view_kanban
msgid "Export Translation"
msgstr "导出翻译"
#. module: app_odoo_customize
#: model:ir.model,name:app_odoo_customize.model_base_language_install
msgid "Install Language"

View File

@@ -24,6 +24,13 @@ class IrModule(models.Model):
modules = self.browse(self.env.context.get('active_ids'))
[module.button_immediate_uninstall() for module in modules if module not in ['base', 'web']]
def button_get_po(self):
self.ensure_one()
action = self.env.ref('app_odoo_customize.action_server_module_multi_get_po').read()[0]
action['context'].update({
'default_lang': self.env.user.lang,
})
return action
@api.depends('name')
def _get_latest_version(self):

View File

@@ -54,10 +54,14 @@
<code><field name="name"/></code>
</xpath>
<!--显示快速升级-->
<xpath expr="//div[@class='oe_module_action']" position="inside" groups="app_odoo_customize.group_show_quick_upgrade">
<xpath expr="//div[hasclass('oe_module_action')]" position="inside" groups="app_odoo_customize.group_show_quick_upgrade">
<button type="object" class="btn btn-default btn-sm float-right" name="button_uninstall_wizard" states="installed">Uninstall</button>
<button type="object" class="btn btn-success btn-sm float-right" name="button_immediate_upgrade" states="installed">Upgrade</button>
</xpath>
<!--显示导出翻译-->
<xpath expr="//div[hasclass('dropdown-menu')]" position="inside">
<a t-if="installed" name="%(app_odoo_customize.action_server_module_multi_get_po)d" type="action" role="menuitem" class="dropdown-item">Export Translation</a>
</xpath>
<xpath expr="//div[@class='oe_module_action']/a[@target='_blank']" position="replace" groups="app_odoo_customize.group_show_quick_upgrade"/>
</field>
</record>

View File

@@ -12,5 +12,19 @@
records.module_multi_uninstall()
</field>
</record>
<record id="action_server_module_multi_get_po" model="ir.actions.act_window">
<field name="name">Export Translation</field>
<field name="type">ir.actions.act_window</field>
<field name="binding_model_id" ref="base.model_ir_module_module" />
<field name="res_model">base.language.export</field>
<field name="view_id" ref="base.wizard_lang_export"/>
<field name="target">new</field>
<field name="context">{
'default_format': 'po',
'default_modules': active_ids,
}
</field>
</record>
</data>
</odoo>