Skip to content

[9.0][IMP] product: migrate simple purchase pricelists #2736

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

Open
wants to merge 3 commits into
base: 9.0
Choose a base branch
from

Conversation

hbrunn
Copy link
Member

@hbrunn hbrunn commented May 20, 2021

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@hbrunn hbrunn added this to the 9.0 milestone May 20, 2021
@hbrunn hbrunn changed the title [IMP] product: migrate simple purchase pricelists [9.0][IMP] product: migrate simple purchase pricelists May 20, 2021
@hbrunn hbrunn marked this pull request as ready for review May 20, 2021 12:23
select
partner_id, min_quantity, currency_id, p2i.date_start, p2i.date_end,
p2i.company_id, p2i.product_id, p2i.product_tmpl_id,
coalesce(pt1.%(field_name)s, pt2.%(field_name)s) *
Copy link
Member

@astirpe astirpe Aug 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case %(field_name)s is standard_price (and this should be the only case IMO) we should take in consideration that in V9 standard_price is a property of product.product (and not of product.template).

To retrieve the proper product prices this should work:

	select
	    split_part(res_id, ',', 2)::int product_id,
	    value_float amount,
	    company_id
	from ir_property
	where
	    fields_id in (
		    select res_id from ir_model_data
		    where name like 'field_product_product_standard_price'
	    ) and res_id is not null and value_float is not null

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your input, the moving of the property to product.product happens indeed before this happens. Now this should be finr

@hbrunn hbrunn force-pushed the 9.0-product_purchase_pricelists branch 2 times, most recently from 52f9244 to a0dd0d5 Compare August 10, 2021 15:19
@hbrunn hbrunn force-pushed the 9.0-product_purchase_pricelists branch from e4c6cbc to 61a3bc5 Compare August 10, 2021 16:45
@StefanRijnhart
Copy link
Member

@hbrunn given that we had something of a flood of vendor prices after the migration, there may be room for improvement.

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.

4 participants