Odoo 도움말

0

0
2 응답
1
Avatar

Hilar AK Switzerland

--Hilar AK--
16138
| 7 6 11
Switzerland
--Hilar AK--
Experienced Odoo / Python Developer with a demonstrated history of working in the information technology and services industry with 3.5+years of experience. Skilled in Python, PostgreSQL, SQL, HTML, JavaScript. Strong engineering professional with a Bachelor of Technology (BTech) focused on Computer Science from the College of Engineering Munnar.

 Blogs:-

https://medium.com/@hilarak
        https://hilarlive.wordpress.com/
 StackOverflow:
       https://stackoverflow.com/users/7561347/burmese-pythis-hilar-ak

Quora:
    

            https://www.quora.com/profile/Hilar-Ak-1

Github:


https://github.com/hilarak



Hilar AK Switzerland
18. 5. 22. 오후 2:54

give the _rec_name for your many2one model. here is an example done for pos product lines. GIve field name needed to display on rec_name

class PosOrderLine(models.Model):
_name = "pos.order.line"
_description = "Lines of Point of Sale"
_rec_name = "product_id"

or you should override the name_get method for your custom model. for eg:

@api.multi
def name_get(self):
if not self._context.get('employee_id'):
# leave counts is based on employee_id, would be inaccurate if not based on correct employee
return super(HolidaysType, self).name_get()
res = []
for record in self:
name = record.name
if not record.limit:
name = "%(name)s (%(count)s)" % {
'name': name,
'count': _('%g remaining out of %g') % (record.virtual_remaining_leaves or 0.0, record.max_leaves or 0.0)
}
res.append((record.id, name))
return res

This is the display set for showing remaining leaves in Leave Request's leave type selection.

질문하기
태그
Keep Informed
1 팔로워
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now