I had some problem with odoo 10 UI after installing some theme module , and I tried many ways to fix it , and only one way worked with me , which by running the command bellow in the terminal
sudo npm install -g less@3.0.4 less-plugin-clean-css
I had some problem with odoo 10 UI after installing some theme module , and I tried many ways to fix it , and only one way worked with me , which by running the command bellow in the terminal
sudo npm install -g less@3.0.4 less-plugin-clean-css
In this blog we will explain how read report color from user in odoo . so let us make an example
First : we have to define char field that will contain the color rbg as bellow
color = fields.Char(string="Color")
Second : create the view for this field as bellow
<field name="color" widget="colorpicker"/>
or
<field name="color" widget="color"/>
after that the view will look like bellow
Third : we can read our color in the report template as bellow
background-color:<t t-esc="color"/>!important; // to make it as back groud color for some element
color:<t t-esc="color"/>!important; // to make it as text color
...
Eg : say we want to add it as back ground color for td in a table so we can do it as bellow
<td style="width:100px;font-size:14px; border: 1px solid black;padding-top:2px; padding-bottom:2px;background-color:<t t-esc="color"/>!important; font-size: 14px; text-align:center;font-weight:bold;"
<span t-esc="field_name"/>
</td >
I used this with odoo 11 , and it worked :)
(0, 0, { values }) link to a new record that needs to be created with the given value
dictionary
(1, ID, { values }) update the linked record with id = ID (write *values* on it)
(2, ID) remove and delete the linked record with id = ID (calls unlink on ID,
that will delete the object completely, and the link to it as well)
(3, ID) cut the link to the linked record with id = ID (delete the relationship between
the two objects but does not delete the target object itself)
(4, ID) link to existing record with id = ID (adds a relationship)
(5) remove all (like using (3,ID) for all linked records)
(6, 0, [IDs]) replace the list of linked IDs (like using (5) then (4,ID) for each ID in the list of IDs)
restore dump backup database in postgresql
pg_restore -U postgres -d coffee -1 /home/user_name/Downloads/db_backup_name.dump
or
pg_dump DB_name > /home/user/Desktop/db_backup_name.dump
restore ZIP backup database in postgresql
curl -X POST -F 'master_pwd=1234' -F 'name=DB_name' -F 'backup_format=zip' -o /home/user/Desktop/back_up.zip http://localhost:8069/web/database/backup
Create new database
CREATE DATABASE DB_name;
Connect one database
psql db_name user_name
Delete database
DROP DATABASE DB_name
Rename database
ALTER DATABASE DB_name RENAME TO DB_new_name
Copy database
CREATE DATABASE New_DB_name
WITH TEMPLATE Existed_DB_name;
caller_function = sys._getframe(1).f_code.co_name
caller function file :
caller_filename = sys._getframe(1).f_code.co_filename
calling line in the caller function :
caller_line_number = sys._getframe(1).f_lineno
#Note
we can get the current function name as
current_function = sys._getframe(1).f_code.co_name
and we can add them to logging file from here
Logging in odoo is very important thing in order to know what is happening in odoo server and to tracking any process in the server , and to make logging in odoo we have 2 steps
_logger = logging.getLogger(__name__)
Here we will explain how to set security group for all users in odoo from xml file , so to do that we will add all users to the specific group by adding the bellow line to group xml tag
<field model="res.users" name="users" search="[('id', '!=', 0)]"/>
EG :
<record id="group_api_tap" model="res.groups">
<field name="name">APIs</field>
<field model="res.users" name="users" search="[('id', '!=', 0)]"/>
<field name="category_id" ref="validator.module_validator"/>
</record>
There are two main issues must of us facing with the QR code in Odoo invoice & these issues are 1/ QR code displayed as broken image w...