Odoo Help

0

0
2 Відповіді
0
Romain Buisson Франція
11.04.19, 04:38

Thanks. Couldn't make that work though. For example, I am trying to uncheck the group_multi_currency setting

Here is what I've done:

model = env["ir.values"]
result = model.sudo().set_default(
    'base.config.settings','group_multi_currency','f'
)

This will update the ir_values table:

id | model_id |         name         |   key   | value
----+----------+----------------------+---------+-------
 70 |          | group_multi_currency | default | S'f'  +
   

And this does not affect the value of the property.

Furthermore, anytime the module is started, the record in ir_table will be deleted and a new one created.

0
Аватар

Aktiv software Індія

--Aktiv software--
4377
| 6 3 9
Ahmedabad, Індія
--Aktiv software--

Started off with a small number and here we are serving multiple Odoo development organizations as a backend technical and functional Odoo force.
Apart from various business-oriented goals, we as a team have strongly emphasized on serving the Odoo Community. Being into the development of the open-source community we continuously thrive to learn, share and contribute to Odoo. Odoo having 20,000+ people contributing to the community from around the globe, we are proud that we belong here.
Talking about our contribution to Odoo Community we have prepared over 50+ Aktiv app modules. Moreover, we have launched wide range of modules that enhance the out-of-box functionalities of Odoo and meets the real-time business scenarios.
-POS
-Project Management
-Website
-Accounting
-Sales
-Productivity
-Inventory
-Document Management
-Human Resources
-Payment module (Payment Reminder)
-User Accessibility (Sign Up with Mobile Number, Activity Log)
-Report Modules (PDF, Printing, Invoice)
All in all, we combine the ERP solutions to add icing on the cake thereby beautifying the base of default Odoo functionalities. So, raise the bar of your business with our Go-To Odoo Apps.
To know more about the latest trends and innovations in Odoo you can also stay in tune with our social media profiles and grab relevant inside scoops.
“Your rewards are always in direct proportion to your contribution”. Keep Sharing, Keep Growing!

Aktiv software Індія
10.04.19, 06:48

Hello @Romain Buisson,

If you are trying to save something in the settings you can do it like this.


_inherit="base.config.settings"


@api.multi

def set_field_name_default(self):    

    return self.env['ir.values'].sudo().set_default(

            'base.config.settings', 'field_name', self.field_name)

Then to access the saved value in the settings,




ir_values = request.env['ir.values']

field_value = ir_values.get_default('base.config.settings', 'field_name')


Can you please mark this as a resolved if you are satisfied with my answer.

1 Коментар
Romain Buisson Франція
11.04.19, 05:33

Thanks. Couldn't make that work though. For example, I am trying to uncheck the group_multi_currency setting

Here is what I've done:

model = env["ir.values"]

result = model.sudo().set_default(

'base.config.settings','group_multi_currency','f'

)

This will update the ir_values table:

id | model_id | name | key | value

----+----------+----------------------+---------+-------

70 | | group_multi_currency | default | S'f' +

And this does not affect the value of the property.

Furthermore, anytime the module is started, the record in ir_table will be deleted and a new one created.

Задайте запитання
Автор
Продовжити інформувати
2 підписник(и)
Про цю спільноту

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