1
This commit is contained in:
@@ -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
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<record id="edit_menu_access" model="ir.ui.view">
|
||||||
|
<field name="model">ir.ui.menu</field>
|
||||||
|
<field name="inherit_id" ref="base.edit_menu_access"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='sequence']" position="after">
|
||||||
|
<field name="is_phone"/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -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',
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_property_accounts_receivable_report"
|
id="menu_property_accounts_receivable_report2"
|
||||||
name="应收账单报表"
|
name="应收账单报表"
|
||||||
parent="yuthon_property_approval.property_approval_report_menu"
|
parent="yuthon_property_approval.property_approval_report_menu"
|
||||||
action="action_property_accounts_receivable_report"
|
action="action_property_accounts_receivable_report"
|
||||||
|
|||||||
Reference in New Issue
Block a user