Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

How to alert if user sell product bellow cost?

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
posinventorysales.orderwarning13.0
3 Răspunsuri
6692 Vizualizări
Imagine profil
Lima Saudara

I using Odoo13 in retail stores, and customers can do negotiate the product that they want.


But, sometimes a cashier can sell the product from POS or sometimes trough sales.order bellow its product Cost which the cost has been set from Inventory.


So I want to give an alert or whatever that will give a warning whenever a user do some mistake when they sell a product bellow it cost.
The alert can just change the product name or the price to be red color.


So, any clue, tutorial or whatever to do that?

Please, any help would be appreciated :)

0
Imagine profil
Abandonează
Imagine profil
Paresh Wagh
Cel mai bun răspuns

Hi Lima:

You can display the Sales Order Lines in red color if the unit price is less than the cost by adding a custom boolean field to the Sales Order Line model and using it to change the color of the text in that row. The boolean field will compare the value of the unit price and the cost and return a True or a False as it's value which can then be used in the QWeb view.

a. Add a computed boolean field to the Sales Order Line model like so.

 

b. Inherit and extend the sale.view_order_form to use the value of the custom field to change the color of the rows where the unit price is less than the cost like so.


Code in Architecture field:

<data>
    <xpath expr="//page[@name='order_lines']//tree[1]">
        <field name="x_price_below_cost" invisible="1"/>
    </xpath>
    <xpath expr="//page[@name='order_lines']//tree[1]" position="attributes">
        <attribute name="decoration-danger">(x_price_below_cost)</attribute>
    </xpath>
</data>

The result in the Sales Order form. The cost of the first line item is $190. The entered unit price is $150 so the row is displayed in red. The cost of the second line item is $85 so it is displayed in the normal color.


4
Imagine profil
Abandonează
Lima Saudara
Autor

Thank you very much :)

This is perfect the answer, I'll think about the POS for now.

Imagine profil
Fady Milad
Cel mai bun răspuns

thank you so much

but this code not working in v 18

how update this

0
Imagine profil
Abandonează
Imagine profil
Moustafa Ebada
Cel mai bun răspuns

Any Idea how to prevent the sale if the value is lower than cost? in the given answer it just alerts.

0
Imagine profil
Abandonează
Paresh Wagh

Hi Moustafa: You can extend the model, perform a similar check in the "create" method and raise a ValidationError to prevent the user from saving the order.

Paresh Wagh

If writing a custom module is not an option, you can implement something similar using an automated action/automation rule.

Moustafa Ebada

Thanks Paresh, this really helps

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

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Auto-send Website Orders to Kitchen Screen via POS
pos sales.order
Imagine profil
Imagine profil
1
aug. 25
1267
Warning on the Picking
inventory warning
Imagine profil
Imagine profil
Imagine profil
2
iun. 24
5562
when i create a sales order in sales wont show up in POS?
pos sales.order
Imagine profil
Imagine profil
2
iun. 23
2604
[Odoo 15]PoS Sale without immediate payment + Later delivery
pos sales.order
Imagine profil
0
aug. 22
2358
POS poor performance while inventory is (in real time)
pos inventory
Imagine profil
Imagine profil
1
iul. 22
4306
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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