From 74a8e55054832b3989e0a0beafe8266e3913c417 Mon Sep 17 00:00:00 2001 From: Ivan Office Date: Thu, 8 Aug 2024 23:00:15 +0800 Subject: [PATCH] =?UTF-8?q?fix=20misc=EF=BC=8C=E4=B8=BB=E8=A6=81=E6=98=AFs?= =?UTF-8?q?o=E5=92=8Cpo=E7=9A=84=E4=BB=85=E5=8F=91=E9=80=81=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_common/__init__.py | 1 + app_common/__manifest__.py | 3 +- app_common/i18n/zh_CN.po | 98 ++++++++++++++++++- app_common/wizard/__init__.py | 4 + app_common/wizard/mail_compose_message.py | 29 ++++++ .../wizard/mail_compose_message_views.xml | 15 +++ app_purchase_superbar/__manifest__.py | 2 +- ...ase_views.xml => purchase_order_views.xml} | 0 app_purchase_superbar_pro/__manifest__.py | 2 +- .../views/purchase_order_views.xml | 2 + app_web_enterprise/__manifest__.py | 2 +- .../static/src/scss/app_style_before.scss | 9 ++ 12 files changed, 159 insertions(+), 8 deletions(-) create mode 100644 app_common/wizard/__init__.py create mode 100644 app_common/wizard/mail_compose_message.py create mode 100644 app_common/wizard/mail_compose_message_views.xml rename app_purchase_superbar/views/{purchase_views.xml => purchase_order_views.xml} (100%) diff --git a/app_common/__init__.py b/app_common/__init__.py index 7f49029b..04a817c1 100644 --- a/app_common/__init__.py +++ b/app_common/__init__.py @@ -2,6 +2,7 @@ from . import controllers from . import models +from . import wizard from .hooks import pre_init_hook from .hooks import post_init_hook from .hooks import uninstall_hook diff --git a/app_common/__manifest__.py b/app_common/__manifest__.py index b263e029..9afcadad 100644 --- a/app_common/__manifest__.py +++ b/app_common/__manifest__.py @@ -39,7 +39,7 @@ { 'name': "odooAi Common Util and Tools,欧度智能基础核心优化", - 'version': '16.24.04.18', + 'version': '16.24.08.08', 'author': 'odooai.cn', 'category': 'Extra tools', 'website': 'https://www.odooai.cn', @@ -82,6 +82,7 @@ ], 'data': [ 'views/ir_cron_views.xml', + 'wizard/mail_compose_message_views.xml', # 'report/.xml', ], 'qweb': [ diff --git a/app_common/i18n/zh_CN.po b/app_common/i18n/zh_CN.po index 9552e39e..53bab727 100644 --- a/app_common/i18n/zh_CN.po +++ b/app_common/i18n/zh_CN.po @@ -1,29 +1,119 @@ # Translation of Odoo Server. +# This file contains the translation of the following modules: +# * app_common # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 16.0-20231112\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-01-08 14:28+0000\n" -"PO-Revision-Date: 2018-01-08 14:28+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2024-08-08 14:55+0000\n" +"PO-Revision-Date: 2024-08-08 14:55+0000\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: app_common +#. odoo-python +#: code:addons/app_common/models/ir_mail_server.py:0 +#: code:addons/app_common/models/mail_mail.py:0 +#, python-format +msgid "=================Email to ignore: %s" +msgstr "=================被忽略的邮箱: %s" + +#. module: app_common +#: model:ir.model,name:app_common.model_base +msgid "Base" +msgstr "基础" + +#. module: app_common +#: model:ir.model,name:app_common.model_res_partner +msgid "Contact" +msgstr "联系人" + +#. module: app_common +#: model:ir.model,name:app_common.model_mail_compose_message +msgid "Email composition wizard" +msgstr "EMail撰写向导" + +#. module: app_common +#. odoo-python +#: code:addons/app_common/models/ir_mail_server.py:0 +#, python-format +msgid "Email to ignore: %s" +msgstr "忽略的邮箱: %s" + +#. module: app_common +#: model:ir.model,name:app_common.model_ir_http +msgid "HTTP Routing" +msgstr "HTTP 路由" + #. module: app_common #: model:ir.model.fields,field_description:app_common.field_ir_cron__trigger_user_id msgid "Last Trigger User" msgstr "手动运行用户" +#. module: app_common +#: model:ir.model.fields,field_description:app_common.field_res_users__login +msgid "Login" +msgstr "登录账号" + +#. module: app_common +#: model:ir.model,name:app_common.model_ir_mail_server +msgid "Mail Server" +msgstr "邮件服务器" + +#. module: app_common +#: model:ir.model,name:app_common.model_mail_mail +msgid "Outgoing Mails" +msgstr "发出邮件" + #. module: app_common #: model:ir.model,name:app_common.model_ir_cron msgid "Scheduled Actions" msgstr "安排的动作" +#. module: app_common +#: model_terms:ir.ui.view,arch_db:app_common.app_mail_compose_message_form +msgid "Send Without Mail" +msgstr "仅改状态不发邮" + +#. module: app_common +#: model:ir.model.fields,field_description:app_common.field_mail_compose_message__show_send_without_mail +msgid "Show Send Only" +msgstr "显示只改状态" + +#. module: app_common +#. odoo-python +#: code:addons/app_common/wizard/mail_compose_message.py:0 +#, python-format +msgid "This only available in Sale Order or Purchase Order" +msgstr "本操作只对销售订单和采购订单生效" + +#. module: app_common +#: model:ir.model.fields,help:app_common.field_res_users__login +msgid "Used to log into the system" +msgstr "用此账号名登录系统" + +#. module: app_common +#: model:ir.model,name:app_common.model_res_users +msgid "User" +msgstr "用户" + #. module: app_common #: model:ir.model,name:app_common.model_ir_ui_view msgid "View" msgstr "查看" + +#. module: app_common +#. odoo-python +#: code:addons/app_common/models/ir_ui_view.py:0 +#, python-format +msgid "" +"You can Ignore this. Failed to load RelaxNG XML schema for views validation," +" file: %s" +msgstr "" +"此警告可忽略:载入文件失败 RelaxNG XML schema for views validation," +" 文件名: %s" diff --git a/app_common/wizard/__init__.py b/app_common/wizard/__init__.py new file mode 100644 index 00000000..63bc2e53 --- /dev/null +++ b/app_common/wizard/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import mail_compose_message + diff --git a/app_common/wizard/mail_compose_message.py b/app_common/wizard/mail_compose_message.py new file mode 100644 index 00000000..de5f4f86 --- /dev/null +++ b/app_common/wizard/mail_compose_message.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- + +from odoo import models, api, fields, _ +from odoo.exceptions import AccessError, UserError + + +class MailComposeMessage(models.TransientModel): + _inherit = 'mail.compose.message' + + show_send_without_mail = fields.Boolean(string="Show Send Only", compute='_compute_show_send_without_mail') + + @api.depends('model') + def _compute_show_send_without_mail(self): + show = False + if self.model in ['sale.order', 'purchase.order']: + order = self.env[self.model].browse(self.res_id) + if order and order.state == 'sent': + show = False + elif self.env.context.get('send_rfq') or self.env.context.get('mark_so_as_sent'): + show = True + self.show_send_without_mail = show + + def action_send_without_mail(self): + # hook + if self.model in ['sale.order', 'purchase.order']: + pass + else: + raise UserError(_('This only available in Sale Order or Purchase Order')) + return {'type': 'ir.actions.act_window_close'} diff --git a/app_common/wizard/mail_compose_message_views.xml b/app_common/wizard/mail_compose_message_views.xml new file mode 100644 index 00000000..fabd533c --- /dev/null +++ b/app_common/wizard/mail_compose_message_views.xml @@ -0,0 +1,15 @@ + + + + app.mail.compose.message.form + mail.compose.message + + + + +