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

Odoo 15 add custom value before invoice total

Odebírat

Get notified when there's activity on this post

This question has been flagged
invoiceinheritaccount.moveformviewv15
2 Odpovědi
7832 Zobrazení
Avatar
Zied dams

Im using _inherit and adding new field in 'account.move'

in the view 

The problem is that 'tax_totals_json' variable is holding all the taxes and totals So that when I use position 'before' or 'after' it doesn't work I want my custom variable to be Before total value,

 I mean inside that Json variable 


any help please !




0
Avatar
Zrušit
Zied dams
Autor

Hi and thank you , my problem is that tax_totals_json contains all the taxes and final total , and i want to add my custom value between the taxes values and the final amount value

Avatar
Fazle Rabbi Ferdaus
Nejlepší odpověď

Hi Zied dams,
tax_totals_json is a computed field and the method that computes the value is "_compute_tax_totals_json". You need make the following changes to add field inside tax_totals_json field.

  • You need to change this method and append your key, value pair in the tax_total_json. here is an example: 


    import json

    class AccountMove(models.Model):
    _inherit = "account.move"

    your_field = ....

    def _compute_tax_totals_json(self):
    super(SaleOrder, self)._compute_tax_totals_json()
    for rec in self:
    tax_totals_json_dict = json.loads(rec.tax_totals_json)
    tax_totals_json_dict.update(
    {'your_field': rec.your_field})
    rec.tax_totals_json = json.dumps(tax_totals_json_dict)

  • Now you have to inherit the "account.TaxtotalsField" template  in extension mode.this xml file should under  "static/src/xml/"
  • Then using xpath add your desired field in the position you prefer. here is an example for steps 2,3:
     


    Sorry unable to incule the example, Dosen't let me add it here


     
  • Lastly, you have to include the xml in the menifest as 'asstes'.  Add the following key, values to your manifest dict```
    'assets': {
    'web.assets_qweb': [
    'you_moduel_name/static/src/xml/your_xml_file_name.xml',
    ],
    },
    ``` 

Hope this helps.

2
Avatar
Zrušit
Abdulwahed Freaa

Thanks alot it worked for me

Avatar
Jainesh Shah(Aktiv Software)
Nejlepší odpověď

Hello, Zied dams

I hope you are doing well.

You can add the any custom field after or before the field 'tax_totals_json', I think you didn't give the xpath in correct way.

You can try this,

Please find code in comment. 

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

0
Avatar
Zrušit
Jainesh Shah(Aktiv Software)

--> py:

class AccountMove(models.Model):
_inherit = "account.move"

custom_field = fields.Char()

--> xml:

<record id="view_invoice" model="ir.ui.view">
<field name="name">view.invoice</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='tax_totals_json']" position="pos"> # pos = before / after
<field name="custom_field"/>
</xpath>
</field>
</record>

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 get all the invoice group to custom module in odoo 15?
development invoice newmodule inherit v15
Avatar
Avatar
Avatar
2
čvc 23
4101
how to count invoice in smart button in odoo 15 ? Vyřešeno
invoice v15
Avatar
Avatar
Avatar
2
led 23
5568
inherit sale.order form to new module Vyřešeno
inherit formview
Avatar
Avatar
Avatar
4
pro 22
8572
how is working invoice count smart button in odoo
invoice v15
Avatar
Avatar
1
čvn 22
3888
How to know which invoice a payment belong to?
invoice v15
Avatar
Avatar
1
kvě 22
4185
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