Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • 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 Managament
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and 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
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Help

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

How to Import Updated Price List? v12

Odoberať

Get notified when there's activity on this post

This question has been flagged
pricelistpricelist_idodoo12
1 Odpoveď
5045 Zobrazenia
Avatar
Lindari Solutions

Our client has dynamic market pricing which changes on a weekly basis. We have two price lists: Retail and Wholesale.

When I import the updated price lists into the product.template via .csv file, it creates a duplicate entry instead of overriding the value. Is there a way to override a Price List price?

We started investigated other means of doing this and came across an app that updates the Sale Price and Cost Price, can any one give me suggestions on how I could apply this to our price lists?

class ProductPrice(models.TransientModel):

_name = 'product.price'

name = fields.Many2one('product.template', string="Product", required=True)
sale_price = fields.Integer(string="Sale Price", required=True)
cost_price = fields.Integer(string="Cost Price", required=True)
retail_price = fields.Integer(string="Retail Price", required=True)

def change_product_price(self):
prod_obj = self.env['product.template'].search([('id', '=', self.name.id)])
prod_value = {'list_price': self.sale_price, 'standard_price': self.cost_price, 'product_pricelist.id.fixed_price': self.retail_price}
prod_obj.write(prod_value)
return {
'name': _('Products'),
'view_type': 'form',
'view_mode': 'form',
'res_model': 'product.template',
'type': 'ir.actions.act_window',
'res_id': prod_obj.id,
'context': self.env.context
}

@api.onchange('name')
def get_price(self):
self.sale_price = self.name.list_price
self.cost_price = self.name.standard_price
self.retail_price = self.name.product_pricelist.id.fixed_price
0
Avatar
Zrušiť
Avatar
Lindari Solutions
Autor Best Answer

Hope this may be helpful to the community, here's how we solved it:

from odoo import models, fields, api, _
from odoo.addons import decimal_precision as dp
import logging

_logger = logging.getLogger(__name__) class ProductPrice(models.TransientModel): _name = 'product.price' name = fields.Many2one(
'product.template',
string="Product",
required=True,
)
sale_price = fields.Float( string="Sale Price", digits=dp.get_precision('Product Price'), required=True, ) does_retail_exist = fields.Boolean( string="Is there a retail price for this product", default=False, ) retail_price = fields.Float( string="Retail Price", digits=dp.get_precision('Product Price'), required=True,
) does_wholesale_exist = fields.Boolean( string="Is there a wholesale price for this product", default=False,
) wholesale_price = fields.Float( string="Wholesale Price", digits=dp.get_precision('Product Price'), required=True, )
def change_product_price(self): _logger.info('[CHANGE PRICE]') prod_obj = self.env['product.template'].search([('id', '=', self.name.id)]) # Set list price if self.does_retail_exist == False: prod_value = {'list_price': self.sale_price} prod_obj.write(prod_value) else: prod_value = {'list_price': self.retail_price} prod_obj.write(prod_value)
# Set retail and wholesale price if they exist for child in prod_obj.item_ids: _logger.info('[CHANGE PRICE] - Name: %s Value: %f', child.pricelist_id.name, child.fixed_price) if child.pricelist_id.name == 'Retail Price': 
child.write({'fixed_price': self.retail_price}) elif child.pricelist_id.name == 'Wholesale Price': 
child.write({'fixed_price': self.wholesale_price}) return { 'name': _('Products'), 'view_type': 'form', 'view_mode': 'form', 'res_model': 'product.template', 'type': 'ir.actions.act_window', 'res_id': prod_obj.id, 'context': self.env.context } @api.onchange('name') def get_price(self): _logger.info('[GET PRICE]') self.does_retail_exist = False self.does_wholesale_exist = False self.sale_price = self.name.list_price for child in self.name.item_ids: _logger.info('[PRODUCT PRICE] - Name: %s Value: %f', child.pricelist_id.name, child.fixed_price) if child.pricelist_id.name == 'Retail Price': 
self.does_retail_exist = True self.retail_price = child.fixed_price elif child.pricelist_id.name == 'Wholesale Price': 
self.does_wholesale_exist = True self.wholesale_price = child.fixed_price
0
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
Promotion program: filter based on pricelist id (V13)
filter pricelist pricelist_id
Avatar
Avatar
1
dec 20
2325
How to have a primary price list that applies to everyone that hasn't any other price list added?
ecommerce pricelist odoo12
Avatar
0
nov 20
2662
Odoo pricelist items - apply on product subselection Solved
community sale pricelist odoo12
Avatar
Avatar
1
nov 19
8457
Price list update
pricelist
Avatar
Avatar
1
jún 25
1403
'Discount' Pricelist not show up in Product detail page
pricelist
Avatar
2
apr 25
1612
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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