ThinhPhan / notes

notes, journal, includes everything that I found interesting. Dump here ;)
0 stars 0 forks source link

12 - Odoo - Customize many2one_avatar widget #12

Open ThinhPhan opened 3 weeks ago

ThinhPhan commented 3 weeks ago

Goal

Solution

Issue

The arrow not horizontal align with avatar & name. They are on 2 lines as the below illustration

( ) Name      | -----------> ( ) Name >
>             |

Change style display: block -> display: inline-block make the trick. (Bang the head to the wall to find workaround fix like change xpath to div, change position to inside but doesn't work).

References

  1. Using mixin class (avatar_mixin) to support show avatar next to many2one record (employee)

Mixin Classes

  1. Add/Modify many2one widget
  1. Customize fields
ThinhPhan commented 3 weeks ago

XPath Cheatsheet

Odoo XPath Guide https://github.com/salvorapi/odoo-xpath-tutorial

XPath cheatsheet

Odoo XPath Doc

https://odoo-development.readthedocs.io/en/latest/dev/xml/xpath.html To test xpath

#Odoo tip - XPath playground:
$ sudo apt-get install libxml-xpath-perl
$ xpath -e "//record[@id=',,,']" -e "//field[@name='...']" *.xml