Contributors mailing list archives

Browse archives


Re: Vendor Pricelist records for Product Variants - what am I missing?

MoaHub, Graeme Gellatly
- 20/01/2022 20:50:36
In general when you do lots of seller pricelist you enable Vendor Pricelists and import from there. The end date problem is still a problem. You can kind of get around it with sequences, start dates on new records and then find dups after. It would be good to have a specific module to do everything.

But supplierinfo is straightforward. Those are the fields you care about. Not product template relational references. Do it via vendor pricelists and much easier.

product_id = fields.Many2one(
'product.product', 'Product Variant', check_company=True,
help="If not set, the vendor price will apply to all variants of this product.")
product_tmpl_id = fields.Many2one(
'product.template', 'Product Template', check_company=True,
index=True, ondelete='cascade')

On Thu, Jan 20, 2022 at 10:27 PM Radovan Skolnik <> wrote:

What's more the field variant_seller_ids is never used anywhere besides that view.

It was introduced into 11.0 by this PR:


On štvrtok 20. januára 2022 8:32:15 CET Radovan Skolnik wrote:

> Hello,


> as New Year came it fell upon me to update lots of pricelists. As we use

> Product Variants (product.product) quite a bit I am invalidating (i.e.

> setting date_end) on existing Supplier Pricelist (product.supplierinfo)

> records and creating new ones. Using base_import_match to match the correct

> product variant by internal reference (default_code) and trying to import

> related product.supplierinfo record. Originally I wanted to create small

> helper that would invalidate all existing records (no end date, same

> variant, same template, same supplier, same company) when creating new one.

> Just to save time updating existing records and creating new ones. However

> it never works (more on that below).


> Now there are 2 fields defined for product.template and none for

> product.product that would serve what I am wanting to do. Here's what's

> defined for product.template (in 13.0, 14.0 and 15.0 as well): seller_ids =

> fields.One2many('product.supplierinfo', 'product_tmpl_id', 'Vendors',

> depends_context=('company',), help="Define vendor pricelists.")

> variant_seller_ids = fields.One2many('product.supplierinfo',

> 'product_tmpl_id')


> In Purchase there is this for product.template view:

> <field name="seller_ids"

> context="{'default_product_tmpl_id':context.get('product_tmpl_id',active_id

> ), 'product_template_invisible_variant': True}" nolabel="1"

> attrs="{'invisible': [('product_variant_count','&gt;',1)]}"/> <field

> name="variant_seller_ids" context="{'default_product_tmpl_id':

> context.get('product_tmpl_id', active_id)}" nolabel="1"

> attrs="{'invisible': [('product_variant_count','&lt;=',1)]}"/>


> Just for clarity, here's part from product.supplierinfo:

> product_id = fields.Many2one('product.product', 'Product Variant',

> check_company=True, help="If not set, the vendor price will apply to all

> variants of this product.") product_tmpl_id =

> fields.Many2one('product.template', 'Product Template', check_company=True,

> index=True, ondelete='cascade')


> Am I missing something here or are these the same besides the context and

> some witchcraft in views? While trying to import the product.product

> records when creating product.supplierinfo records there's always

> product_tmpl_id but never product_id. Shouldn't the definition of variant_s

> be like this and defined in product.product model: variant_seller_ids =

> fields.One2many('product.supplierinfo', ' *product_id* ')


> What is the purpose of current design? Would anyone be willing to shed some

> light here? Hope such post fits in the mailing list.


> Thank you very much.Best regards


> Radovan Skolnik


> _______________________________________________

> Mailing-List: [1]

> Post to:

> Unsubscribe: [2]




> [1]

> [2]

Post to: