Merge lp://staging/~pedro.baeza/openerp-product-attributes/7.0-product_pricelist_fixed_price into lp://staging/~product-core-editors/openerp-product-attributes/7.0

Proposed by Pedro Manuel Baeza
Status: Merged
Approved by: Ronald Portier (Therp)
Approved revision: 232
Merged at revision: 234
Proposed branch: lp://staging/~pedro.baeza/openerp-product-attributes/7.0-product_pricelist_fixed_price
Merge into: lp://staging/~product-core-editors/openerp-product-attributes/7.0
Diff against target: 918 lines (+197/-598)
13 files modified
product_pricelist_fixed_price/AUTHORS.txt (+0/-1)
product_pricelist_fixed_price/__init__.py (+5/-9)
product_pricelist_fixed_price/__openerp__.py (+29/-20)
product_pricelist_fixed_price/i18n/ca.po (+0/-65)
product_pricelist_fixed_price/i18n/de.po (+0/-65)
product_pricelist_fixed_price/i18n/es.po (+35/-52)
product_pricelist_fixed_price/i18n/it.po (+0/-64)
product_pricelist_fixed_price/i18n/product_pricelist_fixed_price.pot (+23/-35)
product_pricelist_fixed_price/model/__init__.py (+19/-0)
product_pricelist_fixed_price/model/product_pricelist_item.py (+51/-0)
product_pricelist_fixed_price/pricelist.py (+0/-211)
product_pricelist_fixed_price/pricelist_view.xml (+0/-76)
product_pricelist_fixed_price/view/product_pricelist_item_view.xml (+35/-0)
To merge this branch: bzr merge lp://staging/~pedro.baeza/openerp-product-attributes/7.0-product_pricelist_fixed_price
Reviewer Review Type Date Requested Status
Ronald Portier (Therp) (community) Approve
Yannick Vaucher @ Camptocamp code review, no tests Approve
Lorenzo Battistini (community) code review Approve
Niels Huylebroeck (community) Approve
Lionel Sausin - Initiatives/Numérigraphe (community) Needs Information
Review via email: mp+205045@code.staging.launchpad.net

Description of the change

This is the module product_pricelist_fixed_price, rewritten from scratch, with another different approach than the current one. Derived from the discussion on this MP:

https://code.launchpad.net/~therp-nl/openerp-product-attributes/7.0_lp1272282_fixed_price/+merge/203348

This only has one drawback: if you install it when you have some pricelists created, when you go to the pricelist form, based on field will be empty for these pricelists (although the behaviour won't break).

To post a comment you must log in.
231. By Pedro Manuel Baeza

[ADD] product_pricelist_fixed_price: New module for fixed prices on pricelists, rewritten from scratch with a new approach.

Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

Dear Pedro Manuel Baeza,
Thanks for your proposal, it's simpler than I expected.

Reading the code I understand that you're still using the "-100% + Price" trick, aren't you?

What happens if on_change() is not executed (for example records are added through XML-RPC)? The 100% discount will not be applied will it?

I'll test it in more depth tomorrow is I can.

Lionel.

review: Needs Information
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Lionel,

Indeed, you have to adjust all fields by XML-RPC, but that's the same flaw of all OpenERP objects (for example, on invoices, you don't get automatically filled all the account related fields when you write partner_id as if you were introducing it on web client).

You have two options:

- Fill complete dictionary with base=1, base_ext=-3, price_discount=-1 and price_surchage=<fixed price>.
- Fill base_ext=-3 and price_surchage=<fixed_price>, and then call XML-RPC on_change method and update dictionary with the returned value.

As you have seen, the "New Price = Base Price * (1 - 1) + price" trick is used.

Regards.

Revision history for this message
Marc Pierlot (mpierlot) wrote :

Bonjour

Est ce que quelqu'un peu me dire ce que je dos faire pour ne plus recevoir
ces messages de Open ERP qui m embetetent merci de ne plus me les envoyer

Tcau.

2014-02-06 11:08 GMT+01:00 Pedro Manuel Baeza <email address hidden>:

> Hi, Lionel,
>
> Indeed, you have to adjust all fields by XML-RPC, but that's the same flaw
> of all OpenERP objects (for example, on invoices, you don't get
> automatically filled all the account related fields when you write
> partner_id as if you were introducing it on web client).
>
> You have two options:
>
> - Fill complete dictionary with base=1, base_ext=-3, price_discount=-1 and
> price_surchage=<fixed price>.
> - Fill base_ext=-3 and price_surchage=<fixed_price>, and then call XML-RPC
> on_change method and update dictionary with the returned value.
>
> As you have seen, the "New Price = Base Price * (1 - 1) + price" trick is
> used.
>
> Regards.
> --
>
> https://code.launchpad.net/~pedro.baeza/openerp-product-attributes/7.0-product_pricelist_fixed_price/+merge/205045
> Your team OpenERP Community is subscribed to branch
> lp:openerp-product-attributes.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~openerp-community
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Niels Huylebroeck (red15) wrote :

Looks very good to me, this is a clean restructuring of this module that avoids copying large chunks of openerp code to change some behaviour.

review: Approve
Revision history for this message
Niels Huylebroeck (red15) wrote :

> What happens if on_change() is not executed (for example records are added
> through XML-RPC)? The 100% discount will not be applied will it?

It's the responsibility of the client to call on_change over XML-RPC (or whatever channel your client is currently using) to get proper behaviour. This is something OpenERP has never been shy about using it in this way (just look at all the voucher and accounting tricks they use)

Revision history for this message
Lorenzo Battistini (elbati) :
review: Approve (code review)
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Linked bug report

LGTM

Good work

As it was completely refactored we will need to change version in __openerp__.py to 2.0

I add Ronald Portier as reviewer so he can have a look at it. As it superseed https://code.launchpad.net/~therp-nl/openerp-product-attributes/7.0_lp1272282_fixed_price/+merge/203348

review: Approve (code review, no tests)
232. By Pedro Manuel Baeza

[IMP] product_pricelist_fixed_price: New version and improved description.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

I have changed version number and improve the module description.

Regards.

Revision history for this message
Ronald Portier (Therp) (rportier1962) wrote :

Hello,

I think it is a pity the code does not work through xml-rpc because in its present form it completely depends on the on-change event. This problem did not exist in my original proposal.

On the other hand, the way a new fixed price type is added by Pedro is quite elegant.

In my proposal there was also a special view for fixed price types. This view is definitely not needed for everyone.

I agree to proceed with merging Pedro's code.

In a later stage - as soon as I have the time - I will propose an update that will take care of xml-rpc calls. But based on Pedro's method.

I also would like to propose a separate module that will add some special views for fixed prices, complete with the functionality requested by some to set the prices from the list.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches