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][FIX] account_global_discount: link line taxes to discount move line #745

Merged
merged 2 commits into from
Jul 16, 2020

Conversation

chienandalu
Copy link
Member

cc @Tecnativa TT24526

@pedrobaeza pedrobaeza added this to the 11.0 milestone Jun 30, 2020
@pedrobaeza pedrobaeza requested a review from carlosdauden June 30, 2020 10:17
@chienandalu chienandalu force-pushed the 11.0-fix-disc-aml-tax branch from 048122d to 89f6a5c Compare June 30, 2020 10:37
@chienandalu
Copy link
Member Author

please review @carlosdauden

@chienandalu chienandalu force-pushed the 11.0-fix-disc-aml-tax branch from 89f6a5c to 1da9249 Compare June 30, 2020 11:01
@chienandalu chienandalu force-pushed the 11.0-fix-disc-aml-tax branch from 1da9249 to d2f508a Compare June 30, 2020 13:41
Copy link
Contributor

@carlosdauden carlosdauden left a comment

Choose a reason for hiding this comment

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

It doesn't work as expected.

Selección_053

Selección_054

@pedrobaeza
Copy link
Member

@carlosdauden please check my latest changes

@pedrobaeza pedrobaeza force-pushed the 11.0-fix-disc-aml-tax branch 4 times, most recently from d1f5859 to fcd1690 Compare July 3, 2020 12:32
@pedrobaeza pedrobaeza changed the title [FIX] account_global_discount: link line taxes to discount move line [11.0][FIX] account_global_discount: link line taxes to discount move line Jul 3, 2020
pedrobaeza added a commit to Tecnativa/sale-workflow that referenced this pull request Jul 3, 2020
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
pedrobaeza added a commit to Tecnativa/sale-workflow that referenced this pull request Jul 3, 2020
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
pedrobaeza added a commit to Tecnativa/sale-workflow that referenced this pull request Jul 3, 2020
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
@pedrobaeza pedrobaeza force-pushed the 11.0-fix-disc-aml-tax branch from fcd1690 to a6d211d Compare July 10, 2020 17:19
Copy link
Member Author

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

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

Tested @pedrobaeza changes 👍
@carlosdauden Please re-review

@SoniaViciana
Copy link

This PR isn't ok, at the accounting entry of discount, I miss the detail of 349 model on intra-community invoices:

image

Please, could you check it @chienandalu ?

Thanks a lot!

@pedrobaeza
Copy link
Member

@SoniaViciana this is because you need a glue module between both. It's the problem of having this anti-nature way of giving discounts. We have been forced to do it in a customer, but we DON'T RECOMMEND these global discounts as it needs a lot of patching in successive things, like this 349 side effect.

- We need to take into account invoice lines with multiple taxes, so the link should
  be m2m.
- Migration scripts for preserving the best information on existing installations.
- Tests for checking new conditions.
- Perform sanity check for not ending in an incompatible situation.
- Some refactor done on onchanges for avoiding duplicating operations.
- Adjust UI for not allowing to edit computed invoice global discounts.
@pedrobaeza pedrobaeza force-pushed the 11.0-fix-disc-aml-tax branch from a6d211d to 0ae672d Compare July 16, 2020 11:22
@pedrobaeza
Copy link
Member

@SoniaViciana @chienandalu I think I have found method for not needing that glue modules in most cases. Can you please check with latest push about the 349?

@pedrobaeza
Copy link
Member

Well, not sure if we need to change 349 method:

https://github.com/OCA/l10n-spain/blob/245ff2527aabd2670c99325a056651fef5cfce3f/l10n_es_aeat_mod349/models/account_invoice.py#L22

and doing this in invoice_line_move_line_get instead. And even in that case, it would depend on the call chain...

I'm giving up now on this, as our customer only uses global discounts for national operations (and in very few cases).

@chienandalu
Copy link
Member Author

Yes, looks like a glue module is still needed for that case: https://github.com/OCA/l10n-spain/blob/245ff2527aabd2670c99325a056651fef5cfce3f/l10n_es_aeat_mod349/models/account_invoice.py#L35-L36

Anyway, let's move forward

@pedrobaeza
Copy link
Member

/ocabot merge patch

kirca pushed a commit to archeti-org/sale-workflow that referenced this pull request Feb 17, 2022
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
omar7r pushed a commit to Comunitea/sale-workflow that referenced this pull request Feb 21, 2022
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
xavier-bouquiaux pushed a commit to acsone/sale-workflow that referenced this pull request Jun 13, 2022
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
dreispt pushed a commit to ursais/sale-workflow that referenced this pull request Jun 21, 2022
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
kirca pushed a commit to archeti-org/sale-workflow that referenced this pull request Oct 25, 2022
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
alexeirivera87 pushed a commit to archeti-org/sale-workflow that referenced this pull request Jan 18, 2023
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
ferran-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request Jan 20, 2023
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
kirca pushed a commit to archeti-org/sale-workflow that referenced this pull request Feb 13, 2023
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
ferran-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request Apr 17, 2023
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
ferran-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request May 22, 2023
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
ferran-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request Jun 19, 2023
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
RabbitJon-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request Jun 26, 2023
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
hildickethan pushed a commit to Studio73/sale-workflow that referenced this pull request Aug 8, 2023
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
pedrobaeza added a commit to Tecnativa/sale-workflow that referenced this pull request Aug 10, 2023
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
hildickethan pushed a commit to Studio73/sale-workflow that referenced this pull request Aug 29, 2023
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
alan196 pushed a commit to Jarsa/sale-workflow that referenced this pull request Nov 23, 2023
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
miguel-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request Dec 21, 2023
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
miguel-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request Mar 18, 2024
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
miguel-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request Mar 18, 2024
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
alan196 pushed a commit to Jarsa/sale-workflow that referenced this pull request Apr 22, 2024
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
ferran-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request Apr 30, 2024
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
ferran-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request May 20, 2024
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
trisdoan pushed a commit to trisdoan/sale-workflow that referenced this pull request Jun 10, 2024
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
trisdoan pushed a commit to camptocamp/sale-workflow that referenced this pull request Jun 11, 2024
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
ferran-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request Jun 20, 2024
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
miguel-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request Aug 14, 2024
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
ferran-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request Sep 27, 2024
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
bealdav pushed a commit to akretion/sale-workflow that referenced this pull request Sep 27, 2024
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
miguel-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request Nov 6, 2024
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
miguel-S73 pushed a commit to Studio73/sale-workflow that referenced this pull request Nov 19, 2024
Not all taxes combinations are possible with global discounts when they are later
invoiced and posted, so we need to constraint them early.

OCA/account-invoicing#745 addresses the problem at invoice level, posting correctly
taxes for supported cases, and constraining the rest.

We apply here the same constraints at sales order level. Existing tests have been
changed because they were using one of the forbidden taxes combination, and 2 new
tests have been added for covering the new constraints.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants