diff --git a/sh_backmate_theme_adv_enterprise/models/inherit_menu.py b/sh_backmate_theme_adv_enterprise/models/inherit_menu.py new file mode 100644 index 000000000..4f5acb9e0 --- /dev/null +++ b/sh_backmate_theme_adv_enterprise/models/inherit_menu.py @@ -0,0 +1,30 @@ + +from odoo import models, fields + + +class MenuInherit(models.Model): + _inherit = 'ir.ui.menu' + + is_phone = fields.Boolean("是否手机显示", default=True) + + def load_web_menus(self, debug): + """ Loads all menu items (all applications and their sub-menus) and + processes them to be used by the webclient. Mainly, it associates with + each application (top level menu) the action of its first child menu + that is associated with an action (recursively), i.e. with the action + to execute when the opening the app. + + :return: the menus (including the images in Base64) + """ + web_menus = {} + menus = self.search_read([], fields=['id', 'is_phone']) + menus_dict = {m['id']: m for m in menus} + + old_menus = super().load_web_menus(debug) + + for menu in old_menus.values(): + + menu['is_phone'] = menus_dict[menu['id']]['is_phone'] if menu['id'] != 'root' else True + web_menus[menu['id']] = menu + + return web_menus diff --git a/sh_backmate_theme_adv_enterprise/views/ir_ui_menu.xml b/sh_backmate_theme_adv_enterprise/views/ir_ui_menu.xml new file mode 100644 index 000000000..d94f24eac --- /dev/null +++ b/sh_backmate_theme_adv_enterprise/views/ir_ui_menu.xml @@ -0,0 +1,15 @@ + + + + + + ir.ui.menu + + + + + + + + + \ No newline at end of file diff --git a/th_form_controller/__init__.py b/th_form_controller/__init__.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/th_form_controller/__init__.py @@ -0,0 +1 @@ + diff --git a/th_form_controller/__manifest__.py b/th_form_controller/__manifest__.py new file mode 100644 index 000000000..744cf900a --- /dev/null +++ b/th_form_controller/__manifest__.py @@ -0,0 +1,13 @@ +{ + 'name': 'TH Form Controller', + 'summary': 'Override form controller layout styles without patching core', + 'version': '17.0.1.0.0', + 'category': 'Tools', + 'depends': ['web'], + 'assets': { + 'web.assets_backend': [ + 'th_form_controller/static/src/scss/form_controller.scss', + ], + }, + 'license': 'LGPL-3', +} diff --git a/th_form_controller/static/src/scss/form_controller.scss b/th_form_controller/static/src/scss/form_controller.scss new file mode 100644 index 000000000..4185228bb --- /dev/null +++ b/th_form_controller/static/src/scss/form_controller.scss @@ -0,0 +1,9 @@ +@media (max-width: 575.98px) { + .o_form_view .o_inner_group { + grid-template-columns: fit-content(150px) minmax(0, 1fr) !important; + } + + .o_form_view .o_inner_group .d-flex { + display: contents !important; + } +} diff --git a/yuthon_report/views/receivable_report_views.xml b/yuthon_report/views/receivable_report_views.xml index aa25215e0..ada16241c 100644 --- a/yuthon_report/views/receivable_report_views.xml +++ b/yuthon_report/views/receivable_report_views.xml @@ -27,7 +27,7 @@