Skip to Content
Menu
This question has been flagged
3 Replies
4255 Views

I'm configuring Odoo 17 Community and noticed a strange behavior.  In two places settings consistently revert back to default after logout/login.  Sometimes they stay.  Sometimes they are lost after switching users. Sometimes they are missing after the instance sits for a while.  At first I thought that maybe me changing other settings affects this, but I don't think I am changing anything now and it still keeps happening.  Not  sure what's going on.

- First issue is changing inventory valuation to Automatic and setting up the accounts for a Product Category.  This gets reverted back to Manual.

- Second is when I change "http" to "https" under Technical > Parameter > System Parameters > web.base.url   Same deal - it gets reverted to "http"


Anyone know what's going on?  Is database doing a rollback or not committing transaction for some reason?


EDIT:

Did more testing.  Inventory valuation method gets reset to Manual every time any setting is changed and I hit the "Save" button.


Also, to enable Automatic inventory valuation I added myself to: 

 - Technical / Stock Accounting Automatic group

 - Technical / Show Full Accounting Features group


Is there more to do to make it work properly?


This is a Bitnami Odoo 17 VM running on Debian 11, if it makes a difference.

Avatar
Discard

Hi Vlad,

I tested this on Runboat, and it seems to work fine if you add the user to those two groups. I can set the Product Category to Automated and it does not get reverted.

(Also the code you added got deleted by the forum)

Author

That's weird.... I just tried on Runbot using version 17.0 and 17.1 and it behaves exactly as I described. Settings are lost.

Just to clarify, here are the steps to reproduce:

1) Log in as Admin and enable Developer mode.
2) Add the Admin user to
- Technical / Stock Accounting Automatic group
- Technical / Show Full Accounting Features group
3) Switch to Inventory module. Then Configuration > Product Categories
4) Pick a product category (I picked All / Salable) and change it to Automatic inventory valuation. Save settings.
5) Switch to Settings and immediately click Save without making any changes.
6) Go back to the Product Category that you se to Automatic and verify that your change has been reverted.

OK, so you can report it to Odoo in GitHub (but I still can't recreate it).

Author Best Answer

I think I solved it.  It seems that for automatic inventory to work properly res_config_setting.group_stock_accounting_automatic must be set in the database.  Problem is, even if you manually set it in the database it will get wiped out next time you click "Save" button to save settings in the Settings menu.  Even if you did not change any settings.


So, you need to expose this setting and set it in the UI.  I added an extension view to res.config.settings.view.form.inherit.base.setup with the following code to make that happen.

      


Avatar
Discard
Author

For whatever reason my code gets wiped out after posting… the idea is to add a checkbox to the Setting menu, which allows control of the flag set in the group_stock_accounting_automatic column.

Best Answer

Hi,
The issue has been reported in:  https://github.com/odoo/odoo/issues/159651

Thanks



Avatar
Discard
Author

Thanks Niyas! I also reported it when encountered first, so now we have two issues opened for the same thing. https://github.com/odoo/odoo/issues/156226

Best Answer

Hi Vlad,

I am having the same issue and keep getting valuation as manual. Can you please show me on how to fix this in odoo17CU. I saw that you are not able to post the code. Maybe you can share it over email with appreciation. 

Is it possible to set this in the Fields section?

moe@sdsqatar.com

Avatar
Discard
Author

Moe, I added a screenshot of the code to my answer. Still can't post straight code, but can post pictures. You'll have to retype it. Hope this helps.