Comment 1 for bug 603100

Revision history for this message
Nhomar - Vauxoo (nhomar) wrote : Re: [Bug 603100] [NEW] Error saving purchase order if purchase_tax_include is installed (function field with 'store' overwriten)

The framework should inform this.... +1 for the Idea...

Here we have two issues:

1.- What you are saying (technical issue).
2.- How something than _important_ like the tax in a document can be bad
implemented in a module on Extra-Addons....

If you can refer to the workshops http://piratepad.net/communitydays-merges

We took this point in exrta-addons this kind of problem should be avoided by
us, we didn't try this module yet, but for example, the purchase_discount
module overwrite all the functions about cost calculation with several
accounting issues, This is a similar problem in my point of view....

How technically do you think we can avoid this kind of errors on
addons-extra?

2010/7/8 Launchpad Bug Tracker <email address hidden>

> You have been subscribed to a public bug by Borja López Soilán (Pexego)
> (borjals):
>
> On 5.0 and 6.0, if the purchase_tax_include module (from extra-addons)
> is installed, saving a purchase order will throw an exception: "column
> "amount_tax" of relation "purchase_order" does not exist"
>
> The problem seems to be that the 'amount_tax' field (a function field
> with store={...}) is being redefined by purchase_tax_include as a
> function field without 'store'.
>
> Current 5.0 amount_tax field is defined like this:
>
> 'amount_tax': fields.function(_amount_all, method=True, digits=(16,
> int(config['price_accuracy'])), string='Taxes',
> store={
> 'purchase.order.line': (_get_order, None, 10),
> }, multi="sums"),
>
> Current 6.0 amount_tax field is defined like this:
>
> 'amount_tax': fields.function(_amount_all, method=True,
> digits_compute= dp.get_precision('Purchase Price'), string='Taxes',
> store={
> 'purchase.order.line': (_get_order, None, 10),
> }, multi="sums"),
>
> And purchase_tax_include amount_tax_field is defined like this:
>
> 'amount_tax': fields.function(_amount_tax, method=True,
> string='Taxes'),
>
> As you can see, the last definition is not compatible with the previous
> ones (does not have 'store').
> It seems that the bug is present since 2008-12-05 (on revno 2047 of the 5.0
> addons the 'store' options where added to the amount_tax field).
>
>
> I'll fix this bug for this module, but my question for the Framework
> Experts is:
>
> - Shouldn't the framework be able to handle this case (a function field
> with 'store' being overwritten by a function field without 'store')?
>
> ** Affects: openobject-addons
> Importance: Undecided
> Status: New
>
> --
> Error saving purchase order if purchase_tax_include is installed (function
> field with 'store' overwriten)
> https://bugs.launchpad.net/bugs/603100
> You received this bug notification because you are subscribed to
> OpenObject.
>

--
Saludos Cordiales

Nhomar G. Hernandez M.
+58-414-4110269
+58-212-6615932
+58-212-9536734 ext 124
+58-212-9512643
Skype: nhomar00
Web-Blog: http://geronimo.com.ve
Servicios IT: http://openerp.netquatro.com
Linux-Counter: 467724
Correos:
<email address hidden>
<email address hidden>