Se rendre au contenu
Menu
Cette question a été signalée

Hi -

I'm new to Odoo and I'm using Odoo version 12.0 installed in Ubuntu 18.04. I'm trying to setup POS in multiple company (ex. Main Company, Company A & Company B). The POS is working perfectly in the Main Company. However, when I tried to setup POS in Company A/B, I'm getting a pop-dialog error when clicking 'New Session" button. I've configured Journals, Chart of Accounts, Warehouses, etc., for each company.

Error in dialog box:

 Odoo Server Error - Validation Error 

× 

The operation cannot be completed: 

- Create/update: a mandatory field is not set. 

- Delete: another model requires the record being deleted. If possible, archive it instead. 

 

Model: Point of Sale Session (pos.session), Field: Session ID (name)

------------------

Here is what I got from the logs:

2019-10-11 21:41:41,019 23642 ERROR CompanyA odoo.sql_db: bad query: b'INSERT INTO "pos_session" ("id", "create_uid", "create_date", "write_uid", "write_date", "config_id", "login_number", "name", "rescue", "sequence_number", "state", "user_id") VALUES (nextval(\'pos_session_id_seq\'), 1, (now() at time zone \'UTC\'), 1, (now() at time zone \'UTC\'), 2, 0, NULL, false, 1, \'opening_control\', 2) RETURNING id' 

ERROR: null value in column "name" violates not-null constraint 

DETAIL: Failing row contains (16, 2, null, 2, null, null, opening_control, 1, 0, null, null, f, 1, 2019-10-11 21:41:40.963799, 1, 2019-10-11 21:41:40.963799).

I hope someone can help me with this problem. Thanks in advance!


Avatar
Ignorer
Auteur Meilleure réponse

Thanks @Niyas Raphy for your suggestion. I tried creating a new database and repeat the steps in creating muliple companies, chart of account, journals, etc., but I still encountered same error.

I finally figure out that after creating a Point of Sale and configure proper Accounting and Inventory settings, you need to configure also Sequences and Identifiers. To do this, go to Setting->Technical-Sequences & Identifiers->Sequences. Filter the Sequence Code to display only "pos". You may noticed that there is only one pos.session entry for the Main Company. Duplicate the pos.session and configure it for CompanyA. Go back to Point of Sale and click "New Session" and it FINALLY WORKS!




Avatar
Ignorer
Meilleure réponse

Hi,

You are getting this error message because as value for a required field is not supplied during the Create operation. From the error message it says the value for the field name is not supplied during the creation of the pos.session model . 

If you are using any custom modules in your system, make sure that there are not making trouble. You can create a new database, without installing any custom module and see still the issue is there or not. If issue is not there without custom modules,you can confirm that the error you get earlier is from the custom modules.

If you feel the error is from Odoo Code itself, then you can double check and confirm the same in runbot, if you are able to reproduce the same in Runbot, report the issue at: https://github.com/odoo/odoo/issues

Thanks

Avatar
Ignorer
Publications associées Réponses Vues Activité
1
mars 24
2631
1
nov. 18
4767
2
mars 15
4584
1
juin 25
1027
1
juin 25
988