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

[11.0][IMP] account_invoice_inter_company: option to avoid product_id in invoice lines #111

Merged
merged 4 commits into from
Oct 12, 2018

Conversation

astirpe
Copy link
Member

@astirpe astirpe commented Sep 19, 2018

For our multicompany environment we need an option to skip the product_id in the created invoice lines.

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.

Curious use case, but modifications are correct and they don't mean any performance penalty. I think any way that this should be put at inter-company rule level instead, for better flexibility. Is it possible?

@astirpe
Copy link
Member Author

astirpe commented Sep 19, 2018

@pedrobaeza the point is that some users can have access to multiple companies, so products belonging to a different company than the one of the invoice could be used. In our environment we use different product for different companies. I cannot find a working solution by inter-company rule level.

@pedrobaeza
Copy link
Member

I'm talking about putting the "no product" option in the inter-company rule level, although a product mapping can be also a good addition.

@astirpe
Copy link
Member Author

astirpe commented Sep 19, 2018

I think I didn't understand then... What do you mean with inter-company rule? 🤔

@yung-wang
Copy link

yung-wang commented Sep 19, 2018

@pedrobaeza I think the productmapping will be quite complex if you have a lot of products. We are working with 4 companies and mapping them would be a lot of work. For now I would suggest to keep it as simple as possible and leave it empty.

Maybe in the future we can add a matrix with the products on the left side and on the top row the companies. And a good addition would be to have a flag on the products for intercompany usage, so the list of the to be mapped is shorter.

@pedrobaeza
Copy link
Member

OK, I see that there's no other place but company to put this. Then it's OK for me. You can mention in the roadmap the mapping part.

@@ -250,6 +252,11 @@ def _prepare_invoice_line_data(self, dest_invoice, dest_company):
% (self.env.ref('account.data_account_type_revenue').name,
dest_company.name, dest_company.id))
tax_ids = dest_line_data.get('invoice_line_tax_ids', False)

Copy link
Member

Choose a reason for hiding this comment

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

Please don't add empty lines inside methods code.

Copy link

@yung-wang yung-wang left a comment

Choose a reason for hiding this comment

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

Works fine. All the lines are copied to the intercompany invoice without products

@astirpe astirpe force-pushed the 11_imp_account_invoice_inter_company branch from e131e71 to 8b238d4 Compare September 25, 2018 11:56
@yung-wang
Copy link

Well it would be nice to add the possibility to create an invoice without any products. At this moment the system will raise an user error when I try confirm the invoice, and it wont create the inter-company invoice in the other company.
This is the user error I get:

The invoice line 'inter-company test invoice line' doesn't have a product. All invoice lines should have a product for inter-company invoices.

@astirpe
Copy link
Member Author

astirpe commented Oct 12, 2018

Failure of tests in travis seems not related with this module

@pedrobaeza pedrobaeza merged commit 9ad1235 into OCA:11.0 Oct 12, 2018
@astirpe astirpe deleted the 11_imp_account_invoice_inter_company branch October 12, 2018 15:50
bealdav pushed a commit to akretion/multi-company that referenced this pull request Feb 13, 2019
… in invoice lines (OCA#111)

* Add product mapping in roadmap
* Allow creation of invoice lines without products
AdriaGForgeFlow pushed a commit to ForgeFlow/multi-company that referenced this pull request Mar 27, 2020
… in invoice lines (OCA#111)

* Add product mapping in roadmap
* Allow creation of invoice lines without products
PierrickBrun pushed a commit to akretion/multi-company that referenced this pull request Dec 4, 2020
… in invoice lines (OCA#111)

* Add product mapping in roadmap
* Allow creation of invoice lines without products
enriquemartin pushed a commit to Digital5-Odoo/multi-company that referenced this pull request Jul 1, 2021
… in invoice lines (OCA#111)

* Add product mapping in roadmap
* Allow creation of invoice lines without products
ChrisOForgeFlow pushed a commit to ForgeFlow/multi-company that referenced this pull request Feb 18, 2022
… in invoice lines (OCA#111)

* Add product mapping in roadmap
* Allow creation of invoice lines without products
ChrisOForgeFlow pushed a commit to ForgeFlow/multi-company that referenced this pull request May 3, 2022
… in invoice lines (OCA#111)

* Add product mapping in roadmap
* Allow creation of invoice lines without products
chafique-delli pushed a commit to akretion/multi-company that referenced this pull request Jan 6, 2023
… in invoice lines (OCA#111)

* Add product mapping in roadmap
* Allow creation of invoice lines without products
chafique-delli pushed a commit to akretion/multi-company that referenced this pull request Jan 10, 2023
… in invoice lines (OCA#111)

* Add product mapping in roadmap
* Allow creation of invoice lines without products
chafique-delli pushed a commit to akretion/multi-company that referenced this pull request Feb 3, 2023
… in invoice lines (OCA#111)

* Add product mapping in roadmap
* Allow creation of invoice lines without products
JordiBForgeFlow pushed a commit to ForgeFlow/multi-company that referenced this pull request Jun 19, 2023
… in invoice lines (OCA#111)

* Add product mapping in roadmap
* Allow creation of invoice lines without products
cuongnmtm pushed a commit to komit-consulting/multi-company that referenced this pull request Mar 15, 2024
… in invoice lines (OCA#111)

* Add product mapping in roadmap
* Allow creation of invoice lines without products
cuongnmtm pushed a commit to komit-consulting/multi-company that referenced this pull request Aug 10, 2024
… in invoice lines (OCA#111)

* Add product mapping in roadmap
* Allow creation of invoice lines without products
cuongnmtm pushed a commit to komit-consulting/multi-company that referenced this pull request Aug 10, 2024
… in invoice lines (OCA#111)

* Add product mapping in roadmap
* Allow creation of invoice lines without products
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.

3 participants