Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Create multiple fixed price pricelists

Subscribe

Get notified when there's activity on this post

This question has been flagged
pricelist
3 Replies
22965 Views
Avatar
mamak111

I have 3 pricelists for a company as follows:

  1. Wholesale bulk (Whole cases are sold to large retailers)
  2. Wholesale less than a case( Cases are broken up for smaller retailers)
  3. Retail (price direct to consumer)

My question is this, how do I define the different price lists as I have to do a CSV import of over 2400 items? Normally pricelists have rules that define the markup as a formula from the cost or the previous pricelist. The problem is that the difference in pricing does not follow a fixed markup across the entire product range. For eg. lists will have the following price structure:

  • Item A- Cost $1.00 Price 1: $1.50 Price 2: $1.75 Price 3: $2.25
  • Item B- Cost $2.00 Price 1: $2.50 Price 2: $2.75 Price 3: $3.25
  • Item C- Cost $6.00 Price 1: $8.50 Price 2: $9.75 Price 3: $12.25
  • Item D- Cost $4.00 Price 1: $5.50 Price 2: $6.75 Price 3: $8.25

As you can see there is no fixed %markup. Pricing is done according to market dictates. It is a competitive market with price fluctuations according to supply and demand.

4
Avatar
Discard
Avatar
Yannick Payot
Best Answer

If you have multiple prices without any kind of relation between them, what you need to do is adding multiple price fields on your product object.

Then you create a price type setting Product Field for each product Sale price field you created.

Sales -> Configuration -> Pricelist -> Price type

And in your pricelists you select the price type and then it will be based on the field.

This way you will have independent pricelists.

So you will have:


  • Product1

    • Sale price1: 1$
    • Sale price2: 42$

  • Price Type1

    • Product Field: Sale price1

  • Price Type2

    • Product Field: Sale price2

  • Pricelist1

    • Pricelist Type: Price Type 1

  • Pricelist2

    • Pricelist Type: Price Type 2
4
Avatar
Discard
mamak111
Author

Thanks will give it a go

mamak111
Author

I am having a bit of trouble creating the fields. I have browsed the fields in the database structure. There are several relationships that need to be defined. Also which are the specific default files that I need to duplicate. Obviously I will have to rename and relabel the fields. I also need to know how many and which different types of fields to create per price. I would really appreciate the help. Thanks in advance.

Yannick Payot

Hello mamak111, in my exemple, Sale price1 and Sale price2 are 2 fields. But as you already have an existing Sale price you just need to create one. And for one field you will have one Price Type.

Yannick Payot

I just corrected a typo. You will have 2 resulting pricelists not only one.

Avatar
Matthew Laney
Best Answer

There is an easy way to accomplish this using the built in pricing formula. The first option in the formula is a discount off the base price. Just enter a -1 (negative 1) in this box. By doing this you get Base Price * (1 + -1), so it multiplies by 0 and the Base Price is removed from the equation.

3
Avatar
Discard
mamak111
Author

Dear Mathew

mamak111
Author

Hi Mathew. Could you please explain this a bit more. How will I then add Price 2 and price 3 to the product?

Matthew Laney

You create a different pricelist version for each. Within each CSV import, you want to have items_id/price_discount be -1 for everything and have items_id/price_surcharge be the fixed price. That is how you prevent each pricelist version from be dependent on the others, because it does (1 + -1) * base price + surcharge, so it multiplies by 0 and you are left with only the surcharge.

To get a good idea, manually create two pricelist versions with just 3 or 4 products in each then export them so you can see the correct format.

Dale

Great Matthew. Thanks for this, useful, simple advice

Avatar
patrick
Best Answer

Another way is to use scripts, which will add the prices to the correct pricelist (and ignoring all prices on the product). This way, you can specify the period the price(s) is/are valid, so you can keep track of the history.

Script

To use the script, I have installed openerp-client-lib

I use a CSV-file, which has at least the productcode (unique), and the new price

import openerplib
import datetime

################################################################################
## default values
################################################################################
# To store data
h = "192.168.1.1"
db= "database_name"
u = "admin"
p = "adminpw"

line = '-' *45 + '\n'
file_prijslijst = 'pricelist.csv'
f_error = 'importError.csv'
f_result = 'importResult.txt'
namePartner = 'name of the partner/pricelist'

################################################################################
## VARIOUS ROUTINES
################################################################################
def printHeading():
  f_res.write(line)
  dateX = str(datetime.datetime.now())
  f_res.write('-' * 10 + dateX+'\n')

def initConnection(h, db, u, p):
  printHeading()
  f_res.write('Connecting to %s \nuser: %s\ndatabase: %s\n' %(h, u, db))
  return openerplib.get_connection(
    hostname=h, database=db, login=u, password=p)

def addValsToDB(c, m, vals):
  printHeading()
  f_res.write('Adding data to %s\n' %(m))
  print 'Adding data to', m
  model = c.get_model(m)
  result = []
  i = 0
  for v in vals:
    result.append(model.create(v))
    i += 1
    x, y = divmod(i, 100)
    if y == 0:
      f_res.write('Added already %d records to %s\n' %(x*100, m))
      print 'Added already %d records to %s' %(x*100, m)
  f_res.write('Number of records added: %d\n' %(len(result)))
  print 'Number of records added: %d' %(len(result))
  return result

################################################################################
## Start of the script
################################################################################
f_res = open(f_result,'w')
f_fout = open(f_error, 'w')

connection = initConnection(h, db, u, p)

f_fout.write('Code;Omschrijving\n')

################################################################################
## PRODUCT.PRICELIST
## PRODUCT.PRICELIST.VERSION
## PRODUCT.PRICELIST.ITEM
################################################################################
f_lijst = open(file_prijslijst)
heading = f_lijst.readline()

# pricelist for namePartner
m = "product.pricelist"
print 'Creating', m, namePartner

vals = []
vals.append({
'name': namePartner,
'company_id': 1,
'version_id': [],
'currency_id': 1, #this is EURO
'commrate': 0,
'active': True,
'type': 'sale'
})
myPriceList = addValsToDB(connection, m, vals)
myPriceList = myPriceList[0] #to get the ID, instead of [id]

# Pricelist Version
m = "product.pricelist.version"
vals = []
vals.append({
'items_id': [],
'name': namePartner + ' - version',
'date_end': '2013-12-31',
'date_start': '2013-01-01',
'active': True,
'pricelist_id': myPriceList,
})
res = addValsToDB(connection, m, vals)

# Pricelist item
m = "product.pricelist.item"

prod_obj = connection.get_model('product.product')
vals = []
for l in f_lijst:
  res = l.replace('\n','').split(';')
  #zoek productID, adhv code
  prodID = prod_obj.search([('default_code', '=', res[1])])
  if prodID == []:
#    print 'ERROR, niet te vinden:', l
    f_fout.write('ERROR;product %s-%s, %s niet te vinden\n' %(res[1], res[2],res[4]))
    continue
  vals.append({
  'price_round': 0.0,
  'price_discount': -1.0,
  'base_pricelist_id': 1,
  'sequence': 25,
  'price_max_margin': 0.0,
  'product_tmpl_id': False,
  'product_id': prodID[0], #Product to use
  'base': 1,
  'price_version_id': myPriceList,
  'min_quantity': 0,
  'price_surcharge': float(res[8]), # 0.0, #From the file
  'price_min_margin': 0.0,
  'categ_id': False,
  'name': '%s-%s, %s' %(res[1], res[2], res[4]),
  })
# add a reference to DEFAULT pricelist, so articles which are not defined are used from DEFAULT
vals.append({
  'price_round': 0.0,
  'price_discount': 0.0,
  'base_pricelist_id':  1, #DEFAULT
  'sequence': 50,
  'price_max_margin': 0.0,
  'product_tmpl_id': False,
  'base': -1,
  'price_version_id': myPriceList,
  'min_quantity': 0,
  'price_surcharge': 0,
  'price_min_margin': 0.0,
  'categ_id': False,
  'name': 'Alle andere producten',
})
res = addValsToDB(connection, m, vals)

f_lijst.close()

################################################################################
## END OF THE SCRIPT
################################################################################
f_res.write(line)
printHeading()
f_res.close()
f_fout.close()
print line
print 'Einde'
# vim:expandtab:smartindent:tabstop=2:softtabstop=2:shiftwidth=2:
2
Avatar
Discard
mamak111
Author

Thanks I will really appreciate having a sample to work with.

patrick

Example will be posted after my holidays.... I'll change my answer to include it.

mamak111
Author

Thanks in advance

mamak111
Author

Thanks for the sample script. However I fear that this is a bit above my skill set. I am trying to work with it in a demo company and will hopefully understand it. Appreciate the effort, thanks

patrick

@Mamak, feel free to contact me directly if you need help. Can tell you more by email.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Price list update
pricelist
Avatar
Avatar
1
Jun 25
1555
'Discount' Pricelist not show up in Product detail page
pricelist
Avatar
2
Apr 25
1711
Pricelist Changes Unexpectedly During Contact Duplication in Multi-Company Setup
pricelist
Avatar
0
Jan 25
1731
Update the default pricing list for a company in Sales Solved
pricelist
Avatar
Avatar
1
Dec 24
3307
how to add product category field into product pricelist report in odoo
pricelist
Avatar
0
Apr 24
1781
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now