-
-
Notifications
You must be signed in to change notification settings - Fork 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
11.0 mig sale order line date #600
Conversation
sale_order_line_date/__manifest__.py
Outdated
@@ -1,4 +1,3 @@ | |||
# -*- coding: utf-8 -*- |
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.
@OpenCode why removing everywhere the coding
line?
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.
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.
ok
class SaleOrderLine(models.Model): | ||
_inherit = 'sale.order.line' | ||
|
||
requested_date = fields.Datetime() |
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.
Good to add string to it
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.
"requested_date" is converted automatically in "Requested Date" by Odoo. Why add a string?
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.
True that, I realised later.
if res.order_id.requested_date and not res.requested_date: | ||
res.write({'requested_date': res.order_id.requested_date}) | ||
return res | ||
|
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.
Rather than overriding create() and write(), cannot we make an onchange / depends(order_id.requested_date), and do the rest?
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.
Thanks for the migration. See my comments inline.
return res | ||
|
||
@api.multi | ||
def _prepare_order_line_procurement(self, group_id=False): |
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 method's name is different in v11. change to:
def _prepare_procurement_values(self, group_id=False):
|
||
@api.multi | ||
def _prepare_order_line_procurement(self, group_id=False): | ||
self.ensure_one() |
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 not needed as it already present on the parent method.
def _prepare_order_line_procurement(self, group_id=False): | ||
self.ensure_one() | ||
vals = super(SaleOrderLine, self).\ | ||
_prepare_order_line_procurement(group_id) |
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.
change accordingly to above comment
@OpenCode I really needed this fixed so I've just proposed you a PR. |
@lreficent Done |
No description provided.