-
-
Notifications
You must be signed in to change notification settings - Fork 750
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
[9.0] [MIG] purchase_order_type module #310
Conversation
70b42ae
to
f155c18
Compare
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.
For giving any functionality added, you can add the stock picking type (only incoming ones), and incoterm information to purchase order types, and pass this information when changing the order type.
def onchange_order_type(self): | ||
self.invoice_method = self.order_type.invoice_method | ||
@api.onchange('partner_id', 'company_id') | ||
def onchange_partner_id(self): |
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.
If you don't want to call super as this is an isolate operation, you can do:
@api.onchange('partner_id', 'company_id')
def onchange_partner_id_purchase_order_type(self):
if self.partner_id.purchase_type:
self.order_type = self.partner_id.purchase_type.id
Although you don't do this change, change the if
part to the new API possibilities (no need to check the existence of each field before accessing the subfields).
|
||
from openerp import models, fields, api | ||
from openerp import models, fields |
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.
Order alphabetically
What about the last point?:
|
@api.onchange('order_type') | ||
def onchange_purchase_order_type(self): | ||
if self.order_type: | ||
self.incoterm_id = self.order_type.incoterm_id.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.
This should be both also conditional. If the value is set, then you overwrite whatever it has. If not, you leave the previous value.
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.
You can add also instructions for the 2 new fields, but not blocking. 9.0 commits to be squashed on merge.
* Remove invoicing options, as they no longer exist. * Added picking type and incoterm information to the type.
e2ceef4
to
aad0d2a
Compare
cc @Tecnativa