Community Mailinglisten Archive


Re: Margin Percentage on Quotation

Open For Small Business Ltd, Graeme Gellatly
- 23.06.2015 20:21:56
Many years ago when OpenERP used to respond to bug reports for new features odony wrote a little module for me called sale_pricelist_recalculation.

I've maintained it sparingly since then and ported to new versions (as well as created purchase_pricelist_recalculation).

It is at gdgellatly/o4sb-addons

At v7 the working production features are -
Change pricelist on draft sale orders

However in test/development since January, using the identical concept we have
  • Balance to amount - including tax (nearly works, depends on quantity of last line the size of the difference, can be out by ((0.01 + tax) * last_line_qty)
  • Balance to amount - excluding tax (as above)
  • Update from Quote (matches on product templates, ignores non-quoted lines as we use colours a lot and quoted colour always different to ordered one, plus has some hardcoded logic that needs removal)
  • Manually reprice all lines using either unit price, discount or line subtotal (also has a slight rounding issue when using price_subtotal).
  • Add freight cost (currently will add a new line rather than updating existing if found, and relies on a hardcoded freight code)

And it will update draft and confirmed (but not validated invoiced) sale orders plus any associated draft invoices.

To add the margin feature is pretty easy, maybe 3 lines of code so I will add it, and I am working on v8 ports at the moment and this was one that I identified as a good candidate to clean up for OCA, now that variants is built in but in the meantime, you can always modify the original sale_pricelist_recalculation module, just needs the error checking removed and the loop amended to rather than update from pricelist to use cost price. 

But you could also do it without a wizard if you only needed to update quotes/draft sale orders.  I prefer the wizard because sale order lines themselves are writable individually, just not on the order when confirmed. 

account_fiscal_position_update from akretion/OCA uses this concept (updates lines from the header document), and from memory if you look in the old PR's it does it with an onchange although I think after review it was settled on to use a button to make the change in the end.

But until I have got all the original features of product_variant_multi restored into the new variants model of v8 I won't be looking at this as it depends on many of those features and that is a big job.  The new variants model doesn't have basic required features like
different cost per variant (nearly ready for review),
code generation (in review, done by akretion, needs fixing),
attribute groups (in review, although currently unreviewed),
supplier per variant (initial design didn't work),
price history per variant (design done)
and is written in a really hard way to modify without affecting other modules which rely on products.  But we are getting there, although that is not a comprehensive list.

On Wed, Jun 24, 2015 at 11:23 AM, <> wrote:
You're mail will be quarantined and examined before delivery.

Post to: