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

[9.0] [MIG] purchase_order_type module #310

Merged
merged 3 commits into from
Dec 21, 2016

Conversation

cubells
Copy link
Sponsor Member

@cubells cubells commented Dec 17, 2016

  • Updated README
  • Updated views
  • Removed invoice_method
  • Updated onchange_partner_id method

cc @Tecnativa

@cubells cubells force-pushed the 9.0-mig-purchase_order_type branch 2 times, most recently from 70b42ae to f155c18 Compare December 17, 2016 10:34
Copy link
Member

@pedrobaeza pedrobaeza left a 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):
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

Order alphabetically

@pedrobaeza
Copy link
Member

What about the last point?:

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.

@api.onchange('order_type')
def onchange_purchase_order_type(self):
if self.order_type:
self.incoterm_id = self.order_type.incoterm_id.id
Copy link
Member

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.

Copy link
Member

@pedrobaeza pedrobaeza left a 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.

cubells and others added 2 commits December 21, 2016 18:38
* Remove invoicing options, as they no longer exist.
* Added picking type and incoterm information to the type.
@pedrobaeza pedrobaeza merged commit f56996b into OCA:9.0 Dec 21, 2016
@pedrobaeza pedrobaeza deleted the 9.0-mig-purchase_order_type branch December 21, 2016 19:10
@pedrobaeza pedrobaeza mentioned this pull request Dec 21, 2016
35 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants