-
-
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
sale_order_type improvements #333
Conversation
596d689
to
ed23616
Compare
|
||
|
||
class AccountInvoice(models.Model): | ||
_inherit = 'account.invoice' | ||
|
||
sale_type_id = fields.Many2one( |
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.
Better to bind this to account journal instead.
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.
@pedrobaeza, journal contains accounting specific informations. Sale Type
is more like a Line of business
. That is, for the same journal, I could configure several lines of business: I should not be forced to create a journal for every line of business
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
Please only one module per PR |
1e298b2
to
72727ee
Compare
@pedrobaeza Thanks |
Please check CIs status |
72727ee
to
5f7d442
Compare
@pedrobaeza travis should be ok now |
Please rebase to fix runbot and can you check if you can improve the test coverage? |
1730897
to
26d5ddc
Compare
26d5ddc
to
1b3e822
Compare
@pedrobaeza thanks, done |
👍 |
Thank you, but can you describe these new features in the module's README? |
@StefanRijnhart description improved |
5672a04
to
10bcab4
Compare
LGTM 👍 |
👍 |
if self.type_id.pricelist_id: | ||
self.pricelist_id = self.type_id.pricelist_id.id | ||
if self.type_id.incoterm_id: | ||
self.incoterm = self.type_id.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 method will invoke multiple times the write method of the sale.order object (potentially this can happen up to 6 times). I believe it would be better, as also advised in the official Odoo documentation, to gather all the values that need to be updated in a dictionary and to explicitly invoke the write method once for all in the end. This for performance reasons.
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.
@espo-tony, I agree.
Could you please make a PR on branch 8.0?
Thank you in advance.
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.
@tafaRU , I'm sorry I made a mistake:
Being this method decorated with the onchange decorator, it will not trigger the write method of the object, instead all the work will be done in the cache. No performance issue in this case.
I'm sorry for wasting your time.
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.
@espo-tony, no problem! I also did not see the onchage decorator 😉
ADD Payment Term, Pricelist and Incoterm to sale order type
ADD sale type for invoices