Skip to content

Conversation

@acsonefho
Copy link
Contributor

Keep context during import.
In some case, the lang set into the context is important to do the import.
For example when the file contain a translatable name as a key (ex: product.attribute) and currently as there is no context, the search is executed in English (default lang) instead of user's lang.

Depends on #406

Use the current company to trigger the job (+ add related tests)
Fill allowed_company_ids from context with the job's company instead of every allowed companies of the user.
Because most of the time, a job is related to only one company. And adding every allowed companies of the user into the context may load some unexpected records (during search for example). Because standards ir.rule use ['|',('company_id','=',False),('company_id', 'in', company_ids)] and this 'company_ids' is filled with every allowed companies from the context.
In some case, the lang set into the context is important to do the import. For example when the file contain a translatable name as a key (ex: product.attribute) and currently as there is no context, the search is executed in English (default lang) instead of user's lang
@guewen
Copy link
Member

guewen commented Feb 16, 2022

Thanks for your PR. Any reason why the context is not stored in the recordset as I proposed in #283?

@rousseldenis
Copy link
Contributor

@acsonefho

@francesco-ooops
Copy link
Contributor

Hi @acsonefho , let us know if you need any help finishing this. We're planning to port this to 14 as soon as it's ready

@thomaspaulb
Copy link

@guewen We want to backport this to 11.0, but could you clarify your point about "storing it on the recordset" ? It's not clear to me from the issue you point to what you mean, or why it should be done.

@guewen
Copy link
Member

guewen commented Apr 12, 2022

@thomaspaulb here: #406 (comment) but check with @acsonefho who maybe already started to work on it

@acsonefho
Copy link
Contributor Author

@thomaspaulb @guewen
I finished yesterday the improvement on #406 but it's better to wait the merge before update this PR.

@francesco-ooops
Copy link
Contributor

Hi @acsonefho , what are the next steps in light of #432 having been merged?

@acsonefho
Copy link
Contributor Author

Hi @acsonefho , what are the next steps in light of #432 having been merged?

I have to update this PR according to the one merge :)

@francesco-ooops
Copy link
Contributor

I have to update this PR according to the one merge :)

makes sense :)

@acsonefho
Copy link
Contributor Author

I close this PR because with the context stored in the job, we have nothing else to do in this module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants