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

10.0 mig account invoice supplierinfo update #252

Merged

Conversation

mourad-ehm
Copy link
Contributor

No description provided.

@mourad-ehm mourad-ehm force-pushed the 10.0-mig-account_invoice_supplierinfo_update branch from c282aa1 to c25965a Compare April 3, 2017 12:43
@mourad-ehm mourad-ehm closed this Apr 3, 2017
@mourad-ehm mourad-ehm reopened this Apr 3, 2017
Copy link

@elicoidal elicoidal left a 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

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

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

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

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

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>
<!--

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"

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."/>

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

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

Copy link
Contributor Author

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

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

Copy link
Contributor Author

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)

@mourad-ehm
Copy link
Contributor Author

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'))
Copy link

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.

Copy link
Contributor Author

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

@mourad-ehm mourad-ehm force-pushed the 10.0-mig-account_invoice_supplierinfo_update branch from a333968 to e495364 Compare April 4, 2017 06:43
Copy link
Contributor

@legalsylvain legalsylvain left a 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 !)

@mourad-ehm
Copy link
Contributor Author

Hi @jgrandguillaume, could you merge this PR please ?

Copy link
Member

@StefanRijnhart StefanRijnhart left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants