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:
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()
|
||||
Reference in New Issue
Block a user