Skip to content

[14.0][IMP] sale_order_revision: carry Invoice links to new revision Sales Orders#2930

Closed
dreispt wants to merge 3 commits intoOCA:14.0from
ursais:14-dr-sale_order_revision2
Closed

[14.0][IMP] sale_order_revision: carry Invoice links to new revision Sales Orders#2930
dreispt wants to merge 3 commits intoOCA:14.0from
ursais:14-dr-sale_order_revision2

Conversation

@dreispt
Copy link
Copy Markdown
Member

@dreispt dreispt commented Jan 27, 2024

  • [IMP] sale_order_revision: 'New Revision' quick button on confirmed Sales Orders
  • [IMP] sale_order_revision: carry Invoice links to new revision Sales Orders

Includes:

If the user created a default afvorite filter on the Sales Order list,
it will override the default filter set by the Revisons button.

So, the Sale Order menu Action should not be reused for this.
Comment on lines +64 to +70
def action_cancel_create_revision(self):
for sale in self:
sale.action_cancel()
action = sale.create_revision()
if len(self) == 1:
return action
return {}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
def action_cancel_create_revision(self):
for sale in self:
sale.action_cancel()
action = sale.create_revision()
if len(self) == 1:
return action
return {}
def action_cancel_create_revision(self):
self.ensure_one()
sale.action_cancel()
return sale.create_revision()

If you can only call from the form view for a record, I think it could be simplified like this.

Copy link
Copy Markdown
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.

Revisions shouldn't be done in confirmed sales orders, as that impacts in a lot of workflows. If done, it should be in a separate module, but not forced to be done in the existing one.

@dreispt
Copy link
Copy Markdown
Member Author

dreispt commented Feb 3, 2024

@pedrobaeza I understand.
I will make the button work for Quotation state only, and move the confirmed SO support to a separate module.

I wish I didn't have to do revisions os confirmed SOs, but Portuguese Tax Authority requires SOs to be locked once sent to customers. I'm trying to make abiding to this less painful for PT companies.

@dreispt dreispt changed the title [IMP] sale_order_revision: carry Invoice links to new revision Sales Orders [14.0][IMP] sale_order_revision: carry Invoice links to new revision Sales Orders Feb 3, 2024
@dreispt dreispt marked this pull request as draft February 3, 2024 16:34
@pedrobaeza
Copy link
Copy Markdown
Member

I wish I didn't have to do revisions os confirmed SOs, but Portuguese Tax Authority requires SOs to be locked once sent to customers. I'm trying to make abiding to this less painful for PT companies.

That sound a bit weird, Anyway, sent to customers don't mean confirmed. You have the sent state in the sales order, so I think it's better to forbid the changes in that state that changing all of this, don't you think?

@dreispt
Copy link
Copy Markdown
Member Author

dreispt commented Feb 5, 2024

That sound a bit weird, Anyway, sent to customers don't mean confirmed. You have the sent state in the sales order, so I think it's better to forbid the changes in that state that changing all of this, don't you think?

The forbidding changes is not the issue, that's not hard to enforce.
The issue is when, after sent and confirmed, we need to make changes to the order, such as correcting ordered quantities, prices, or even applicable taxes. Then we need to do that in a copy of the original order.

@pedrobaeza
Copy link
Copy Markdown
Member

OK, but the flow in that case is to cancel the sales order, and then issue a new revision. What you can't do is to try to link things that are generated when you confirm the sales order to the new revision. That's something out of scope of any module IMO.

@dreispt
Copy link
Copy Markdown
Member Author

dreispt commented Aug 20, 2024

Additional work was on on this feature, implementing it in a separate module.
This PR is now superseded by #3275

@dreispt dreispt closed this Aug 20, 2024
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.

4 participants