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 mig sale order line date #600

Merged
merged 7 commits into from
Jul 3, 2018

Conversation

OpenCode
Copy link
Contributor

No description provided.

@OpenCode OpenCode mentioned this pull request Jan 30, 2018
65 tasks
@pedrobaeza pedrobaeza added this to the 11.0 milestone Jan 30, 2018
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

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()
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor

@LoisRForgeFlow LoisRForgeFlow left a 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):
Copy link
Contributor

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()
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 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)
Copy link
Contributor

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

@LoisRForgeFlow
Copy link
Contributor

LoisRForgeFlow commented May 28, 2018

@OpenCode I really needed this fixed so I've just proposed you a PR.

@OpenCode
Copy link
Contributor Author

OpenCode commented Jul 3, 2018

@lreficent Done

@pedrobaeza pedrobaeza merged commit 89a73c8 into OCA:11.0 Jul 3, 2018
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.

10 participants