İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

Custom Field "Service Fee %" in Sales Order Line

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
sale.order.linestudio18.0automation-rules
4 Cevaplar
1601 Görünümler
Avatar
Zulfikri

Hi,

i need custom that named "Service Fee %" in sales order line like image below,


i noticed the service fee that i input didn't automatically change the total amount(field : subtotal) of in sales order line, i think i need an automation rule so the total amount change when i input the service fee. So, i did like this

BUT, when i make new sales order and input the quantity, price, etc and save it. Seem like an error appear and my Odoo frezeed. Any solution of this or the best approach for this case? 

0
Avatar
Vazgeç
Avatar
D Enterprise
En İyi Yanıt

Hii,

Solution (No Code, No Studio)

1. Stop updating price_subtotal — it's a computed field.

2. Do this instead:

  • Create a new float field: x_service_fee_percent on sale.order.line
  • Create a new monetary field: x_adjusted_subtotal on sale.order.line (linked to currency_id)
  • Automation Rule (Safe Calculation)
  • Go to Settings → Technical → Automation → Automated Actions → Create:
    • Model: Sale Order Line
    • Trigger: On Creation & Update
    • Trigger Fields: x_service_fee_percent, price_unit, product_uom_qty, discount
    • Action To Do: Update the Record
  • Field to update:
  • x_adjusted_subtotal → Use this expression:

add this code in automation rule:

((record.price_unit * record.product_uom_qty) * (1 - (record.discount or 0)/100.0)) * (1 + (record.x_service_fee_percent or 0)/100.0)
i hope it is usefull

1
Avatar
Vazgeç
Zulfikri
Üretici

Hi, Thank you so much that work really well, but i still have an issue. Please check my new reply, i hope u can help

Avatar
Jainesh Shah(Aktiv Software)
En İyi Yanıt

Hello @Zulfikri,

 

Add the Action named 'Execute Python code' in Your Automated Action as shown in below image.

 



After that add below Python code in your automated action.

 

# Step-by-step safe evaluation of subtotal with service fee

 

# Step 1: Get quantity

qty = record.product_uom_qty or 0.0

 

# Step 2: Get unit price

price = record.price_unit or 0.0

 

# Step 3: Get service fee (as percentage, e.g. 0.10 = 10%)

fee = record.x_studio_service_fee or 0.0

 

# Step 4: Compute multiplier

multiplier = 1.0 + fee

 

# Step 5: Calculate total with service fee

total_with_fee = qty * price * multiplier

 

# Step 6: Store in custom field

record.write({'x_studio_service_fee' : total_with_fee})

 

If you have any questions or need further assistance, feel free to reach out.


Thanks & Regards,

Email:  odoo@aktivsoftware.com           

Skype: kalpeshmaheshwari

0
Avatar
Vazgeç
Zulfikri
Üretici

Hi, thank you so much, i have tried something like that, seems like it only make an change visually, am i right?. I still cant change the total on the bottom of the order line, invoice, and for the journal item as well

Avatar
Zulfikri
Üretici En İyi Yanıt

Hi Desk Enterprise,

Thank you so much that work really well, but i still have an issue. How to change the "Total" (which I marked with a red box) below the sales order line so it can updated based on "Total Amount" that we already customized?


0
Avatar
Vazgeç
D Enterprise

Override price_subtotal (Recommended for direct integration)
Instead of using x_adjusted_subtotal, override the standard field price_subtotal with your formula.
Update your Automation Rule:
Model: Sale Order Line

Trigger: On Update & Create

Trigger Fields: x_service_fee_percent, price_unit, discount, product_uom_qty

Action: Update the Record

Update Field: price_subtotal

Value:
((record.price_unit * record.product_uom_qty) * (1 - (record.discount or 0)/100.0)) * (1 + (record.x_service_fee_percent or 0)/100.0)
i hope this is solve the error

Avatar
Piyush H
En İyi Yanıt

Dear Zulfikri,

here's how to implement this entirely through the Odoo interface:

Method 1: Using Studio (Recommended)
  1. Install Studio
    • Go to Settings → Apps → Search for "Studio" → Install
  2. Add the Service Fee % Field
    • Open any Sales Order
    • Click the "Edit Form" button (pencil icon) in top-right
    • Click "+" to add a new field
    • Field Name: x_service_fee_percent
    • Field Label: "Service Fee %"
    • Field Type: Float
    • Widget: Percentage (or Monetary if you prefer currency format)
    • Save the field
  3. Create an Automated Action
    • Go to Settings → Technical → Automation → Automated Actions
    • Create a new record:
      • Name: "Update Subtotal with Service Fee"
      • Model: Sales Order Line
      • Trigger: On Update
      • Apply On: [Your specific domain if needed, or leave blank]
    • In "Actions To Do" tab:
      • Add Action → Execute Python Code
      • Paste this (simplified version that won't cause recursion):

python

for line in records:
    price = line.price_unit * (1 - (line.discount or 0.0) / 100.0)
    fees = line.x_service_fee_percent or 0.0
    line.price_subtotal = price * line.product_uom_qty * (1 + fees / 100.0)
Method 2: Using Only Standard Features

If you can't use Studio, try this workaround:

  1. Create a Discount Field Workaround
    • Go to Settings → Technical → Database Structure → Fields
    • Create a new field:
      • Model: sale.order.line
      • Field Name: x_service_fee_percent
      • Field Type: Float
      • Label: "Service Fee %"
  2. Modify the Sales Order Line View
    • Go to Settings → Technical → User Interface → Views
    • Find the sale.order.line form view
    • Click "Edit" and add your field after price_unit
  3. Use a Computed Field (Still no-code)
    • In the same Fields section, edit your x_service_fee_percent field
    • Check "Computed"
    • For the compute method, use:
      python
      def _compute_service_fee(self):
          for line in self:
              line.x_service_fee_percent = line.price_subtotal * 0.10  # Example 10% fee
Important Notes
  1. Performance Warning: No-code solutions may be less efficient than proper code implementations
  2. Backup First: Always backup your database before making structural changes
  3. Testing: Try this in a test environment first

Alternative: Consider using the "Margin" field that already exists in Sales if it meets your needs

🚀 Did This Solve Your Problem?

If this answer helped you save time, money, or frustration, consider:

✅ Upvoting (👍) to help others find it faster

✅ Marking as "Best Answer" if it resolved your issue

Your feedback keeps the Odoo community strong! 💪

(Need further customization? Drop a comment—I’m happy to refine the solution!)

0
Avatar
Vazgeç
Enjoying the discussion? Don't just read, join in!

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
How to set default view to list view globally
configuration studio 18.0
Avatar
Avatar
1
Nis 25
1714
Sale order to purchase order with all line of Sale order
sale.order.line purchase_order studio
Avatar
Avatar
Avatar
2
Ara 23
2474
Odoo 18: Create/Override Odoo studio
create studio path components 18.0
Avatar
0
Eyl 25
532
Carry over data and content from CRM card to Project card
opportunities project crm studio won 18.0
Avatar
Avatar
1
Kas 25
269
debit and credit in currency
studio
Avatar
Avatar
1
Kas 25
2134
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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