Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FW][FIX] point_of_sale: set archived warehouse for pos type #162627

Open
wants to merge 1 commit into
base: saas-17.1
Choose a base branch
from

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Apr 19, 2024

Found error during migration in customer database. when company is archived but will get that company on self.env.company of pos_config table,
this error is generated when it's try to create the record for pos config from pos_resturant module
by data file (defined on this commit)

3236c1c

as picking_type_id field in pos_config is required and we set default value by fetching warehouse for related company but here as company is archived, related warehouse is also archived and that why we didnot get picking_type_id for archived company and that will raise Error :

  File "/home/odoo/src/odoo/17.0/odoo/models.py", line 4787, in _create
    cr.execute(SQL(
  File "/home/odoo/src/odoo/17.0/odoo/sql_db.py", line 332, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.NotNullViolation: null value in column "picking_type_id" of relation "pos_config" violates not-null constraint

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #151719

@robodoo
Copy link
Contributor

robodoo commented Apr 19, 2024

@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 19, 2024

This PR targets saas-17.1 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@C3POdoo C3POdoo added the RD research & development, internal work label Apr 19, 2024
@robodoo robodoo added the forwardport This PR was created by @fw-bot label Apr 19, 2024
@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 19, 2024

@atp-odoo @caburj ci/runbot failed on this forward-port PR

@caburj
Copy link
Contributor

caburj commented Apr 29, 2024

Hi @atp-odoo. Can you rebase for rebuild so that we can move forward with it?

Found error during migration in customer database.
when company is archived but will get that company
on `self.env.company` of pos_config table,
this error is generated when it's try to create the
record for pos config from pos_resturant module
by data file (defined on this commit)

odoo@3236c1c

as picking_type_id field in pos_config is required
and we set default value by fetching warehouse for related company
but here as company is archived, related warehouse is also
archived and that why we didnot get picking_type_id
for archived company and that will raise Error :

```
  File "/home/odoo/src/odoo/17.0/odoo/models.py", line 4787, in _create
    cr.execute(SQL(
  File "/home/odoo/src/odoo/17.0/odoo/sql_db.py", line 332, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.NotNullViolation: null value in column "picking_type_id" of relation "pos_config" violates not-null constraint
```

X-original-commit: 34b9bf8
@atp-odoo atp-odoo force-pushed the saas-17.1-saas-16.4-fecth-archived-picking_type_id-atp-7-QW-fw branch from d0f68ab to f6b4bba Compare May 2, 2024 07:42
@fw-bot
Copy link
Contributor Author

fw-bot commented May 2, 2024

@atp-odoo @caburj this PR was modified / updated and has become a normal PR. It should be merged the normal way (via @robodoo)

@atp-odoo
Copy link
Contributor

atp-odoo commented May 2, 2024

@robodoo r+

@C3POdoo C3POdoo requested review from a team and adgu-odoo and removed request for a team May 2, 2024 07:44
@adgu-odoo adgu-odoo requested review from caburj and removed request for adgu-odoo May 2, 2024 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants