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

[16.0][IMP] sale_order_carrier_auto_assign enable feature settings #2837

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

santostelmo
Copy link
Contributor

@santostelmo santostelmo commented Dec 7, 2023

That is an improvement of PR:
#2533

It will allow to enable feature via settings

image

Copy link

@Ricardoalso Ricardoalso left a comment

Choose a reason for hiding this comment

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

LGTM

@simahawk simahawk force-pushed the 16.0-imp-sale_order_carrier_auto_assign-add-config branch from f5846ca to 0a6fc3e Compare February 19, 2024 07:11
cls.env = cls.env["base"].with_context(**DISABLED_MAIL_CONTEXT).env
cls.settings = cls.env["res.config.settings"].create({})
cls.settings.carrier_auto_assign = True
cls.settings.execute()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cls.settings.execute()
cls.settings.set_values()

Never use execute. Always use set_values to not trigger a whole not needed machinery that will slow down everything.



class SaleOrder(models.Model):

_inherit = "sale.order"

def action_confirm(self):
if config["test_enable"] and not self.env.context.get(
Copy link
Contributor

Choose a reason for hiding this comment

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

this is changing the default behavior where ppl expects this to be working OOTB.
It requires an upgrade step to enable it by default on existing installations.

@simahawk
Copy link
Contributor

I've rebased

@trisdoan
Copy link
Contributor

Hi @santostelmo, I created camptocamp#34 to improve your PR

@santostelmo santostelmo force-pushed the 16.0-imp-sale_order_carrier_auto_assign-add-config branch 2 times, most recently from f44e997 to c3b0520 Compare February 28, 2024 11:21
@santostelmo santostelmo force-pushed the 16.0-imp-sale_order_carrier_auto_assign-add-config branch from c3b0520 to 81bdb1c Compare February 28, 2024 11:22
@santostelmo santostelmo requested a review from simahawk February 29, 2024 05:59
@jbaudoux
Copy link
Contributor

@santostelmo Looks obsolete. Can this be closed?

@santostelmo
Copy link
Contributor Author

Yes let's close it

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