İç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

Change Terms and Conditions inside invoices

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
invoicesales.orderv15
2 Cevaplar
5367 Görünümler
Avatar
Mohamad Ali Chamas

I am trying to change the terms and conditions note inside the invoices. I know that there is a setting that can be updated concerning this field but its not working correctly. I have updated all old invoices to a new T&C note and kept the one in the sales order as is. But, when creating an invoice from an SO, the old terms and conditions are appearing on it and when creating an invoice alone without creating it from the SO then it is taking the new note I identified in the settings. Is there a function I should override in order to fix the terms & conditions? if yes, what is it?

0
Avatar
Vazgeç
Avatar
Malay Khamar (Serpent Consulting Services Pvt. Ltd.)
En İyi Yanıt

Hi , 
If you are creating the Regular Invoice , then you have to customise the below method and change the "narration" field value as per your need. 

Method :  https://github.com/odoo/odoo/blob/15.0/addons/sale/models/sale_order.py#L604

Field value : https://github.com/odoo/odoo/blob/15.0/addons/sale/models/sale_order.py#L618


And if you are creating the Invoices with Down payment functionality,  then you have to customise the below method and change the "narration" field value as per your need


Method: https://github.com/odoo/odoo/blob/15.0/addons/sale/wizard/sale_make_invoice_advance.py#L73

Field Value : https://github.com/odoo/odoo/blob/15.0/addons/sale/wizard/sale_make_invoice_advance.py#L79


Check this demo video to help you. 

     https://uploadnow.io/f/1GDCz3b


Hope it will help you.
Up vote please.

1
Avatar
Vazgeç
Avatar
NISHANT JAIN
En İyi Yanıt

When you create an invoice from SO It will take T&C of SO.

But when creating an invoice alone without creating it from the SO then it will take the default note of setting


So in your case invoice is getting T&C of SO.


If you want to change this existing behaviour you have to override this two methods.

https://github.com/odoo/odoo/blob/15.0/addons/sale/models/sale_order.py#L604​

https://github.com/odoo/odoo/blob/15.0/addons/sale/wizard/sale_make_invoice_advance.py#L73

​

0
Avatar
Vazgeç
Mohamad Ali Chamas
Üretici

I overrided these 2 methods and replaced: 'narration': self.note with 'narration': self.narration and order.narration but still it didn't work, do you have any idea why?

NISHANT JAIN

because sale order doesn't have narration field
narration field is in invoice

can you share your code so that i can help

Mohamad Ali Chamas
Üretici

Yes I want to update the narration field inside invoice and keep it the same in the sales order. I used the same functions but updated from note to narration. Do you have any solution regarding this issue?

Malay Khamar (Serpent Consulting Services Pvt. Ltd.)

HI MohammadShamass, Mohammad Chamass,

If you want that invoice will take the default terms and condition as you configured.
Not the sale order terms and conditions. Then you need to comment or remove the "narration" field in the below method.

Method : https://github.com/odoo/odoo/blob/15.0/addons/sale/models/sale_order.py#L604

By removing the "narration" from the above method, Invoice will take the default
terms and condition.

Mohamad Ali Chamas
Üretici

I commented the narration field from both methods but the problem still persists

Malay Khamar (Serpent Consulting Services Pvt. Ltd.)

I guess you have to check the final dictionary values at the end. It should not contains the "narration" key at all.
Please check the video i have shared in the updated answer.
Thanks

Mohamad Ali Chamas
Üretici

Thanks for the video! But the problem is still persisting, the place you changed the terms and conditions is the same place I changed it. I also changed it from the user-defaults section. I also removed the narration fields in both functions but till now I don't have any solution that helped me.

Malay Khamar (Serpent Consulting Services Pvt. Ltd.)

Then, you have to check wether your custom code has used that method or not.

Mohamad Ali Chamas
Üretici

This is the code, kindly check it:

from odoo import api, fields, models, _
from odoo.exceptions import AccessError, UserError
from odoo.tools import groupby

class AccountMoveInh(models.Model):
_inherit = 'account.move'

def _prepare_invoice(self):
"""
Prepare the dict of values to create the new invoice for a sales order. This method may be
overridden to implement custom invoice generation (making sure to call super() to establish
a clean extension chain).
"""
self.ensure_one()
journal = self.env['account.move'].with_context(default_move_type='out_invoice')._get_default_journal()
if not journal:
raise UserError(_('Please define an accounting sales journal for the company %s (%s).', self.company_id.name,
self.company_id.id))

invoice_vals = {
'ref': self.client_order_ref or '',
'move_type': 'out_invoice',
'currency_id': self.pricelist_id.currency_id.id,
'campaign_id': self.campaign_id.id,
'medium_id': self.medium_id.id,
'source_id': self.source_id.id,
'user_id': self.user_id.id,
'invoice_user_id': self.user_id.id,
'team_id': self.team_id.id,
'partner_id': self.partner_invoice_id.id,
'partner_shipping_id': self.partner_shipping_id.id,
'fiscal_position_id': (self.fiscal_position_id or self.fiscal_position_id.get_fiscal_position(
self.partner_invoice_id.id)).id,
'partner_bank_id': self.company_id.partner_id.bank_ids.filtered(
lambda bank: bank.company_id.id in (self.company_id.id, False))[:1].id,
'journal_id': journal.id, # company comes from the journal
'invoice_origin': self.name,
'invoice_payment_term_id': self.payment_term_id.id,
'payment_reference': self.reference,
'transaction_ids': [(6, 0, self.transaction_ids.ids)],
'invoice_line_ids': [],
'company_id': self.company_id.id,
}
invoice_vals=super(AccountMoveInh)._prepare_invoice(self)
return invoice_vals

def _prepare_invoice_values(self, order, name, amount, so_line):

invoice_vals = {
'ref': order.client_order_ref,
'move_type': 'out_invoice',
'invoice_origin': order.name,
'invoice_user_id': order.user_id.id,
'partner_id': order.partner_invoice_id.id,
'fiscal_position_id': (
order.fiscal_position_id or order.fiscal_position_id.get_fiscal_position(order.partner_id.id)).id,
'partner_shipping_id': order.partner_shipping_id.id,
'currency_id': order.pricelist_id.currency_id.id,
'payment_reference': order.reference,
'invoice_payment_term_id': order.payment_term_id.id,
'partner_bank_id': order.company_id.partner_id.bank_ids[:1].id,
'team_id': order.team_id.id,
'campaign_id': order.campaign_id.id,
'medium_id': order.medium_id.id,
'source_id': order.source_id.id,
'invoice_line_ids': [(0, 0, {
'name': name,
'price_unit': amount,
'quantity': 1.0,
'product_id': self.product_id.id,
'product_uom_id': so_line.product_uom.id,
'tax_ids': [(6, 0, so_line.tax_id.ids)],
'sale_line_ids': [(6, 0, [so_line.id])],
'analytic_tag_ids': [(6, 0, so_line.analytic_tag_ids.ids)],
'analytic_account_id': order.analytic_account_id.id if not so_line.display_type and order.analytic_account_id.id else False,
})],
}
invoice_vals=super(AccountMoveInh)._prepare_invoice_values(self, order, name, amount, so_line)
return invoice_vals

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 count invoice in smart button in odoo 15 ? Çözüldü
invoice v15
Avatar
Avatar
Avatar
2
Oca 23
5524
Connect sales order with already confirmed invoice Çözüldü
invoice sales.order
Avatar
Avatar
2
Ara 22
3900
how is working invoice count smart button in odoo
invoice v15
Avatar
Avatar
1
Haz 22
3855
How to know which invoice a payment belong to?
invoice v15
Avatar
Avatar
1
May 22
4150
Change invoice prefix in V15 (Community edition)
invoice v15
Avatar
Avatar
1
Ara 21
3372
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