-
-
Notifications
You must be signed in to change notification settings - Fork 665
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
10.0 mig account invoice supplierinfo update #252
10.0 mig account invoice supplierinfo update #252
Conversation
…unction. (prepare function added) [ADD] description [FIX] remove unused dependencies for the time being
c282aa1
to
c25965a
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.
thanks for your contribution!
Update Supplier Info of product from Supplier Invoice | ||
===================================================== | ||
|
||
This module allows in the supplier invoice, to automatically update all |
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 module allows to automatically update all products information in vendor bill for which the purchase information on the line are different from the supplier information defined in the product form."
products informations whose purchase informations on the line are different | ||
from the supplier informations, defined on the product form. | ||
|
||
It creates a new supplier information line if there is not or it updates the |
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.
It creates a new supplier information line if there is not any or it updates the
first one in the list.
It creates a new supplier information line if there is not or it updates the | ||
first. | ||
|
||
This module add an extra button 'Check Supplier Informations' on supplier |
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 module adds an new button 'Check Supplier Informations' in supplier
.. image:: /account_invoice_supplierinfo_update/static/description/supplier_invoice_form.png | ||
|
||
|
||
When user click on it, he can see supplier informations changes, that will |
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.
When the user clicks on it, he can see the supplier information changes that will
apply. Optionally, he can remove some temporary changes, specially, if,
for example, a supplier applied an exceptional price change.
|
||
.. image:: /account_invoice_supplierinfo_update/static/description/main_screenshot.png | ||
|
||
* blue: Create a full new supplier info |
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.
Creates a full new supplier info line
@@ -0,0 +1,12 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<odoo> | |||
<!-- |
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.
idem
<field name="arch" type="xml"> | ||
<xpath expr="//button[@name='action_invoice_open']" position="after"> | ||
<button name="check_supplierinfo" string="Check Supplier Infos" | ||
help="Check if the invoice informations are similar from the supplier informations" |
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.
information (never plural)
Why define the help message here: wouldnot it be better at the model definition?
type="object" states="draft,proforma2" | ||
groups="account.group_account_invoice"/> | ||
<button name="set_supplierinfo_ok" string="Ignore" type="object" | ||
confirm="This will mark the invoice as checked. Are you sure? It will be possible to uncheck manually in the 'Other Info' tab." help="This will mark the invoice as checked. It will be possible to uncheck manually in the 'Other Info' tab."/> |
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.
the confirm string seems very long...
self.write({'price_variation': False}) | ||
for line in self.filtered('current_price'): | ||
line.price_variation = 100 *\ | ||
(line.new_price - line.current_price) / line.current_price |
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.
are you sure the line.current_price is not 0
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.
Yes, I test it self.filtered('current_price') eliminates object with line.current_price =0
# Compute price variation | ||
if supplierinfo.price: | ||
price_variation = 100 *\ | ||
(self.price_unit - supplierinfo.price) / supplierinfo.price |
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.
Are you sure that supplierinfo.price is not 0
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.
Yes, "if supplierinfo.price (price=0.0)" is eq to "if False". (tested)
thanks @elicoidal for review. I fixed your remarks. |
|
||
price_variation = fields.Float( | ||
string='Price Variation (%)', compute='_compute_price_variation', | ||
digits_compute=dp.get_precision('Discount')) |
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.
Warning on install
parameter 'digits_compute' is no longer supported; use 'digits' 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.
I fixed it. Thanks for review
a333968
to
e495364
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.
👍 code review & Test.
Thanks a lot for adapting this module to the new supplierinfo model. (More simple by the way, I like it !)
Hi @jgrandguillaume, could you merge this PR please ? |
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.
Tested and code reviewed. Thanks!
No description provided.