-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
base: 16.0
Are you sure you want to change the base?
[16.0][IMP] sale_order_carrier_auto_assign enable feature settings #2837
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f5846ca
to
0a6fc3e
Compare
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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( |
There was a problem hiding this comment.
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.
I've rebased |
Hi @santostelmo, I created camptocamp#34 to improve your PR |
f44e997
to
c3b0520
Compare
c3b0520
to
81bdb1c
Compare
@santostelmo Looks obsolete. Can this be closed? |
Yes let's close it |
That is an improvement of PR:
#2533
It will allow to enable feature via settings