-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
port onchanges to API 8.0 to fix #22 #23
port onchanges to API 8.0 to fix #22 #23
Conversation
I have to refactor this a bit -> WIP |
'total_cost': price * self.proposed_qty, | ||
'supplier_id': agreement.supplier_id.id} | ||
self.write(vals) | ||
res = {} | ||
if not enough_qty: |
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 check seems useless as in framework_agreement get_cheapest_agreement_for_qty only returns an agreement if it found a matching one with enough qty.
@nbessi @lepistone have we somewhere in OCA modules an override of get_cheapest_agreement_for_qty that could return something else than:
(None, None) or (agreement_id, True) ?
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.
@yvaucher I don't know off the top of my head. In any case, ping me if I can help.
9f67ae8
to
da16dad
Compare
This restore former warning message when we can find an agreement with not enough quantities This allow to find and finish the framework agreement almost finished. As it is preferable to finish agreements completely instead of contracting new ones and be left with multiple remainings of agreements.
da16dad
to
e350d69
Compare
Do you plan to use openerp.fields classes to have a full port to v8.0? also you are using osv and orm. They are a redondant, aren't they? |
@foutoucour I think porting fields in this PR is out of scope of the fix. And odoo 8.0 old api is not yet deprecated. 😃 This PR does not intend to port the whole code to v8.0. I just fixed the onchanges tooking the opportunity to port them to new API. About They are not redundant, as I use direct path for old style fields: This to use new fields in onchanges. (just seeing I'm calling the wrong datetime BTW) And didn't changed the old stylish path to Model (which is in fact in models.py now but this is out of scope of this PR) |
Thanks! 👍 |
👍 |
…-fix-onchanges port onchanges to API 8.0 to fix #22
No description provided.