Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Food & Hospitality
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Guest House
    • Distributor nápojů
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Trades
    • Údržbář
    • IT hardware a podpora
    • Solar Energy Systems
    • Výrobce obuvi
    • Úklidové služby
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

How can I select a single price from pricelist_partnerinfo and place in custom model field?

Odebírat

Get notified when there's activity on this post

This question has been flagged
one2manyselectionpricelistone2many_listodoo8
4465 Zobrazení
Avatar
R.Wouters

In product.supplierinfo I can create multiple suppliers with multiple unit prices:product.supplierinfo Supplier: JDoe (sequence: 1)

**pricelist.partnerinfo**
    Quantity: 200 Unit price: 250
    Quantity  300 Unit price  235
    Quantity  500 Unit price  215

In a custom model, I want to use the unit price, based on condition: e.g.

If quantity = 299 or less select unit price 250,
Elif quantity => 300 and <= 500 unit price 235,
Elif quantity => 500 unit price 215

Without the use of pricelists, I want to be able to use pricelist.partnerinfo prices for further calculations in a new product.

#-------------------------------------------------------------------------------
#  paper qualities e.g: product.template
#-------------------------------------------------------------------------------

class qualities(models.Model):
    _name = 'qualities'
    _description = 'Sheet Qualities'

name = fields.Char('Kwaliteit', required=True, help='Kwaliteit naam')
code_id = fields.Char('Interne code')
marge = fields.Integer('Marge (%)', help="Marge in % = inkoopprijs vs werkprijs")
samenstelling = fields.Char('Samenstelling')
golfdikte = fields.Float('Golfdikte in mm', digits=(3, 1))
golftype = fields.Char('Golf type code')
gramsgewicht = fields.Float('Gramsgewicht / m2', digits=(3, 1))
state = fields.Boolean('active', default=True)
quality_oms = fields.Text('Opmerkingen')
reseller_ids = fields.One2many('kwaliteitinfo', 'product_qual_id', 'Quality Supplier')   
#-------------------------------------------------------------------------------
# Quality supplier e.g.: product.supplierinfo
#------------------------------------------------------------------------------- 
class kwaliteitinfo(models.Model):
_name = 'kwaliteitinfo'
_description = "Information about a quality supplier"
name = fields.Many2one('res.partner', 'Supplier', required=True,domain = [('supplier','=',True)], ondelete='cascade')
product_name = fields.Char('Supplier Product Name')
product_code = fields.Char('Supplier Product Code')
sequence = fields.Integer('Sequence')
min_qty = fields.Float('Minimal Quantity', required=True)
qty = fields.Float(compute=_calc_qty, store=True, string='Quantity', multi="qty")
product_qual_id = fields.Many2one('qualities', 'Quality Template', ondelete='cascade', select=True)
delay = fields.Integer('Delivery Lead Time', required=True)
pricelist_ids = fields.One2many('qualitylist.partnerinfo', 'suppinfo_id', 'Supplier Pricelist', copy=True)
company_id = fields.Many2one('res.company','Company',select=1)

#-------------------------------------------------------------------------------
# Quality suppliers prices E.g.: Pricelist.partnerinfo
#-------------------------------------------------------------------------------  
class qualitylist_partnerinfo(models.Model):
_name = 'qualitylist.partnerinfo'

name = fields.Char('Description')
suppinfo_id = fields.Many2one('kwaliteitinfo', 'Partner Information',       required=True, ondelete='cascade')
min_quantity = fields.Float('Quantity', required=True)
price = fields.Float('Unit Price', required=True)

_order = 'min_quantity asc'

How can I: 

1: select  supplier by sequence : set relation 

2: Based on conditions (quantity) select the price 

3: fill price into custom field for further calculations



0
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
How to add records to one2many_list either by creating them, or selecting them ? Vyřešeno
one2many selection one2many_list
Avatar
Avatar
1
bře 15
5377
Odoo 10 : Display a tree view to select values from a one2many field Vyřešeno
treeview one2many selection one2many_list odoo10
Avatar
Avatar
1
říj 20
11057
tree view for one2Many not populating
one2many one2many_list
Avatar
Avatar
2
říj 20
3805
how get value from one2many field? Vyřešeno
one2many one2many_list
Avatar
Avatar
1
srp 19
11282
Sale pricelist with fixed prices
pricelist odoo8
Avatar
Avatar
2
bře 15
5879
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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