Bugfix for take a price_unit received before the res.list_price in account module

Bug #560456 reported by Moisés López - http://www.vauxoo.com
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

In addons/account/invoice.py

Now take a price_unit=res.list_price and not the price_unit received.

This I did because I made an adjustment to take the price from the price list, and send it as a parameter, but not processed as a replacement.

I can also share the code for my module.

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello moylop,
We accept your request, but it cannot be entertained on generic platform.
Supplier Invoice is a kind of listing where we do not know the price everytime,we need to adjust prices acc. to the total provided.
For Customer Invoices, the list prices are fixed. You may create an SO and adjust your pricelist for your purpose.

Thanks.

Changed in openobject-addons:
milestone: none → 5.0.10
status: New → Invalid
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Hello Jay
I agree with you, but do not know if I did not understand

The function receives as parameter a price, which does not process even if it is sending correctly as a parameter from another function, because the function substitutes with list price of product, without first processing the price received as a parameter.
Unlike the 1071 line, where it is processed before the price received:
        if type in ('in_invoice', 'in_refund')
            self.product_id_change_unit_price_inv to_update = (cr, uid, tax_id, PRICE_UNIT or res.standard_price, qty, address_invoice_id, product, partner_id, context = context)

But in line with 1074, do not do so.
result.update (('price_unit': res.list_price, 'invoice_line_tax_id': tax_id))

As should reconsider the process, it received before replacing the value:
result.update (('price_unit': PRICE_UNIT or res.list_price, 'invoice_line_tax_id': tax_id))

Yes I mean?

Saludos

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Saludos,

I agree with what you point.
But, talking about functional aspect, the supplier invoices are treated in a way that we first put the total say 1000 to he total on invoices. We add one invoice line worth 300. Now, when we add a line,automatically it takes 700 on that new entry. This is the purpose why line 1071 is written. We can call it adjustment. We need to adjust according to total.

For customer invoices, there is no total. Each product is having its fixed sale price(list price). All the changes are related to pricelist.

Hope this helps.
Thanks.

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Hello Jay
Sorry if I did not write correctly from the beginning to explain
But that's because I'm using a espaniol-English translator
I agree totally with what you say, but I do not think I'm being understood.

Soon I will send you a video, explaining a better way, the problem I want to expres

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Saludos,

Yes you are open to express your view.
We will definately work towards the solution if there is a problem.

Thank you for your interest.

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Thanks for your patience Jay

I attach a video

Can you see?

I hope I express myself better with the video

Actually the problem is very small but substantial

Regards

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Hello Jay

Could you see the video?

I have not received a reply, I can generarte the video in another format, if you could not see

Regards!

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hi ,

I will take a look at this very soon.

Thanks.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello ,

I have gone through the video.
Here are 2 aspects:
1. You want this change only due to you override the onchange method.
2. This change is not acceptable as for customer invoices, it has to take the sales price.

For 1, you may simply do this:
def onchange()
 something = call super
somethng['price'unit'] = some price
return something

For 2, I am sorry, we cannot use this patch because this is a generic need.

I will consult more experts for this point.
Thanks.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.