mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
更新ribbon样式,更新 mrp_pro
This commit is contained in:
@@ -83,6 +83,7 @@
|
||||
'css': [
|
||||
],
|
||||
'qweb': [
|
||||
'static/src/xml/*.xml',
|
||||
],
|
||||
'js': [
|
||||
],
|
||||
|
||||
17
app_base_chinese/models/res_company.py
Normal file
17
app_base_chinese/models/res_company.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import api, models, fields, _
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = 'res.company'
|
||||
|
||||
short_name = fields.Char('Short Name', related='partner_id.short_name', readonly=False, store=True)
|
||||
|
||||
# 当传参 show_short_name 时,只显示简称
|
||||
def name_get(self):
|
||||
if self._context.get('show_short_name'):
|
||||
return [(value.id, "%s" % (value.short_name if value.short_name else value.name)) for value in self]
|
||||
else:
|
||||
return super().name_get()
|
||||
12
app_base_chinese/static/src/xml/views.xml
Normal file
12
app_base_chinese/static/src/xml/views.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<!--改search中英文-->
|
||||
<t t-extend="SearchPanel.Category">
|
||||
<t t-jquery="div.alert" t-operation="replace">
|
||||
<div t-if="category.limitAttained" class="alert alert-warning">
|
||||
<span>性能原因,只支持 200 条记录的显示</span>
|
||||
<span t-if="category.parentField">记录没有树状结构</span>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
||||
26
app_base_chinese/views/res_company_views.xml
Normal file
26
app_base_chinese/views/res_company_views.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="app_view_company_tree" model="ir.ui.view">
|
||||
<field name="name">app.res.company.form</field>
|
||||
<field name="model">res.company</field>
|
||||
<field name="inherit_id" ref="base.view_company_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='name']" position="after">
|
||||
<field name="short_name"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="app_view_company_form" model="ir.ui.view">
|
||||
<field name="name">app.res.company.form</field>
|
||||
<field name="model">res.company</field>
|
||||
<field name="inherit_id" ref="base.view_company_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='phone']" position="before">
|
||||
<field name='short_name'/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user