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í
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • 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
    • Služby pro partnery
    • 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

Show fields in invoice report if checkbox ticked on sale order

Odebírat

Get notified when there's activity on this post

This question has been flagged
sale.order.formifinvoicereport
1 Odpovědět
3180 Zobrazení
Avatar
Matija

Hi all,

I'm trying to show some fields on invoice report (pdf) when checkbox is ticked on sale order form. On sales order report I got to show it like this https://ibb.co/rcd7fFD

show_reference_1 is defined here https://ibb.co/VBb8mt3

And it work great on sales order but I can't get it to work on invoice report -> if checkbox is ticked on sales order form if condition should be true and it should show.

I tried to create related fields as described here
https://www.odoo.com/forum/help-1/odoo-10-show-field-of-model-sale-order-in-form-view-of-account-invoice-113470

but got ImportError: cannot import name 'account_invoice' from partially initialized module...

This is inside py file https://ibb.co/QfSzwcg

Maybe this error is due missing import inside __init__.py ? This is what I got inside it https://ibb.co/mt3FRgL

Anyway - does somebody know a way to trigger if condition on invoice report related to sale order form tickbox? Thank you.

0
Avatar
Zrušit
Sunny Sheth

which ODOO Version are you using?

Matija
Autor

v15 - account.move has to be inherited. The problem is when this fields are inherited they aren't ticked - maybe I'm inheriting them wrong. Here is how it's done at the moment https://ibb.co/pWKdGv4

Waleed Ali Mohsen

You need to add sale order id to the form and select the sale order linked to the invoice manually in the form and then the related boolean field will have the values from sale order. You can override the method which create invoice from sale order to pass the sale order id to invoice sale order id and this will avoid you to select the sale order manually in the invoice.

Matija
Autor

@Waleed Mohsen I'm not sure I get it - how to add sale order id to the form to select the sale order linked to the invoice? I'd really appreciate if you can explain.

Waleed Ali Mohsen

You have added sale_order_id many2One field to account.move but the field will be empty in invoice so you need to add it to invoice form and then select the SO linked to the invoice. otherwise the sale_order_id will be false and the your boolean field will not have any value.

Waleed Ali Mohsen

Great. You got it.

Matija
Autor

Sorry - didn't realised that it just saved order ID when I selected it but it is not selected by default. Can you please tell me how to pass sale order id to this field so correct order in it is selected by default?

Waleed Ali Mohsen

You need to override method _prepare_invoice in sale.order model to pass sale order id to account.move sale_order_id field.

def _prepare_invoice(self):
invoice_vals = super(SaleOrder, self)._prepare_invoice()
invoice_vals['sale_order_id'] = self.id
return invoice_vals

So when you create invoice from sale order the sale_order_id will be set automatically. for already created invoice, you have to set it manually or by using export/import.

Matija
Autor

That's it - thank you 🙏 😊

Avatar
Waleed Ali Mohsen
Nejlepší odpověď

f you are using Odoo 13.0 and above, the account.invoice is replaced with account.move so you need to  inheritfrom account.move.

class AccountMove(models.Model)
    _inherit = 'account.move'






2
Avatar
Zrušit
Matija
Autor

Yeah, I tried with account.move - no errors. But it doesn't show fields on invoice when checkbox are ticked. To test it I tried to show them on form and indeed they are not ticked but on sale order form they are ticked.

Here is code used for it https://ibb.co/pWKdGv4

Matija
Autor

Fields are inherited - they show up on account move form but their values (weather its ticked) are not. Do you have any idea how to inherit those values from sale order on account move?

Waleed Ali Mohsen

You added the sale order id field but you have to select the sale order in the form, Or you can pass it once you create invoice from sale order.

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
lock sales confirm
sale.order.form
Avatar
Avatar
1
srp 24
1969
Sale Order Line Form Popup Odoo 14 Vyřešeno
sale.order.form
Avatar
Avatar
1
úno 22
5248
Option Duplicate in DropDown More Vyřešeno
sale.order.form
Avatar
Avatar
Avatar
2
kvě 19
4325
Module to know in Sales Order if order is already shipped? Vyřešeno
sale.order.form
Avatar
Avatar
3
srp 18
5439
Why Quotation 'Send by email' not sending email ?
sale.order.form
Avatar
Avatar
Avatar
Avatar
Avatar
8
úno 16
11844
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