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

[12.0][FIX] account_invoice_inter_company: avoid issue writing the company_id #311

Conversation

AdriaGForgeFlow
Copy link
Contributor

@AdriaGForgeFlow AdriaGForgeFlow commented Sep 3, 2021

This PR intends to fix an issue in Travis (#305) making fail the tests when the module account_bill_line_distribution is installed.

image

cc ~ @ForgeFlow

@OCA-git-bot
Copy link
Contributor

Hi @AdriaGForgeFlow! Thank you very much for this contribution. As the addon you are improving does not have a declared maintainer, I take the opportunity to mention that you can consider adopting it. To do so, please read the maintainer role description, and, if interested, create a pull request to add your GitHub login to the maintainers key of the addon manifest.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field needs to be written because there are other fields that depends on it that are not correctly computed. The problem you mention should be by a view with higher priority that provokes to not select it correctly for the Form. Please check that instead.

to prevent issues writing the company_id in the invoice lines
@AdriaGForgeFlow AdriaGForgeFlow force-pushed the 12.0-fix-account_invoice_inter_company branch from f2fe69e to abf79ba Compare September 3, 2021 09:51
@AdriaGForgeFlow AdriaGForgeFlow changed the title [12.0][FIX] account_invoice_inter_company: do not write company_id on invoice lines [12.0][FIX] account_invoice_inter_company: avoid issue writing the company_id Sep 3, 2021
@AdriaGForgeFlow
Copy link
Contributor Author

The field needs to be written because there are other fields that depends on it that are not correctly computed. The problem you mention should be by a view with higher priority that provokes to not select it correctly for the Form. Please check that instead.

You are right.
What do you think about the new solution, it's the only way I found but maybe you can think of a better approach. I tried working with priorities on the views but did not work.

@pedrobaeza pedrobaeza added this to the 12.0 milestone Sep 3, 2021
@pedrobaeza
Copy link
Member

I don't think that's a good solution, but unless you put the steps to reproduce the problem, we can't provide alternatives.

@AdriaGForgeFlow
Copy link
Contributor Author

AdriaGForgeFlow commented Sep 3, 2021

I don't think that's a good solution, but unless you put the steps to reproduce the problem, we can't provide alternatives.

To reproduce the issue:

Using the branch from this PR: #305 which fixes an issue with a wrongly migrated function.

In a fresh Odoo instance, install the modules purchase_sale_inter_company and the module account_bill_line_distribution. You can then run the tests for purchase_sale_inter_company and you will have one FAILED test. Otherwise, you can configure the Odoo and create an inter-company invoice. When you try to post that invoice you will also see the issue in the logs complaining about writing in a field that is readonly.

image

@pedrobaeza
Copy link
Member

This fix #313 should be the solution for this (it needs to be back-ported though).

@AdriaGForgeFlow
Copy link
Contributor Author

This fix #313 should be the solution for this (it needs to be back-ported though).

I have tried but it does not fix the issue, the code never enters that create / write and the inverse is already defined in v12.

@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jun 19, 2022
@github-actions github-actions bot closed this Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs fixing question stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants