Skip to content

odoo-app-dev/odoo

Repository files navigation

odoo

While developing odoo apps, sometimes it neened to have some minor changes in odoo core. I add them here it might be usefull for other developers.

wesite

find out which user is loged in

website_check_user_id.py

survey

To add page break while printing survey results

addons/survey/views/survey_templates_statistics.xml#L64

<p style="page-break-after: always;"></p> <!-- Add this line. It will separate each question data on one page -->

Javascript

Notification

https://github.com/odoo-app-dev/odoo/blob/main/js/notification.js

Pyton

Constrains

Sample 1 Sample 2

field.Selection

state = field.Selection([('a', 'Firest'),('b', 'Second')])

  • record.state => a
  • dict(record._fields["state"].selection).get(record.state) => First
  • dict(record._fields["state"]._description_selection(record.env)).get(record.state) => First ( translatable in website + Explicit exports)

Get the current record id on creation

new

def create(self, vals):
    res = super(<class name>, self).create(vals)
    print('Record ID: ', res.id)
    return res

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors