Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

Pos Orders: add a field from lines

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
posodoo11community
2 Replies
4662 Rodiniai
Portretas
Carlos Cosme

Hi,

    we are working with a standar Odoo 11 POS module, we use two payment methods (cash and card). We know that a pos order can be paid with both methods (50% - 50% por example), but we just need to show in the order header the first payment method used.

Payment lines are stored in the "statement_ids" of "pos.order", and the field we need to show is "journal_id".

We tried:

1. adding a field in the header "<field name="statement_ids.journal_id"/>

2. adding a field in the header "<field name="statement_ids[0].journal_id"/>

3. adding a new field in the pos.order model using the advanced properties (dependencies, etc.)

But no one seems to work.

Another good option could be to simple be able to add a filter in the "Sales Details" report to show the standard information filtered by the payment method. My customer needs to know the information displayed there (productos sold in a period) but they need to know the payment method used (taking into account they only use one method by order).

Hope someone could help me.

Thanks.

0
Portretas
Atmesti
Portretas
Volodymyr
Best Answer

Hi,

I would suggest you to add a new computed field which would be set with statement_ids[0].journal_id in the compute function.

first_journal_id = fields.Many2one('account.journal', compute='_compute_first_journal', store=True)

@api.depends('statement_ids', 'statement_ids.journal_id')
def _compute_first_journal(self):

    for record in self:

        record.first_journal_id = record.statement_ids[0].journal_id.id

Then you can use the new field in the view simply like usual field:

<field name="first_journal_id"/>


PS: be aware - I haven't tested that piece of code above, so please use it as a pre-sample :)

PSPS: if you like the answer - please don't forget to upvote it :) Thanks!

1
Portretas
Atmesti
Portretas
Carlos Cosme
Autorius Best Answer

Hi volodymyr,

    seems to be a good aproach but still didn't reach to solve it, surely is because I'm a functional consultant and only know a bit of technical issues.

Created a new field "x_first_journal_id", type "text".
Base properties: readonly "true", store "false", all others "false"
Advanced properties: dependencies "statement_ids", compute:

x_first_journal_id = fields.Many2one('account.journal', compute='_compute_first_journal', store=True)
@api.depends('statement_ids', 'statement_ids.journal_id')
def _compute_first_journal(self):
    for record in self:
        record.x_first_journal_id = record.statement_ids[0].journal_id.id

Saves OK but when I display in a form I get this error:

File "/usr/lib/python3/dist-packages/odoo/tools/safe_eval.py", line 189, in assert_valid_codeobj
    raise ValueError("forbidden opcode(s) in %r: %s" % (expr, ', '.join(opname[x] for x in codes)))
ValueError: forbidden opcode(s) in 'lambda': STORE_ATTR

Tried:
1. changing "store=true"
2. changing the last line for: "record.x_first_journal_id = record.statement_ids[0].journal_id", because I'm not sure about the ".id"

But get the same error, I don't still feel comfortable with the technical-code part. Any idea with this error?.
Thanks for your help ! 



0
Portretas
Atmesti
Volodymyr

Carlos, I would advise to use a bit of technical support for this issue, because the way you've done it is not correct.

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

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

Registracija
Related Posts Replies Rodiniai Veikla
POS cash rounding Odoo 11
pos odoo11community
Portretas
Portretas
2
vas. 20
3442
Can not close POS session. Odoo11
pos odoo11community
Portretas
Portretas
1
gruod. 19
3176
Kitchen printing printer other than odoo provided list
pos
Portretas
Portretas
1
lapkr. 25
187
POS Table Synchronization Issue Between Devices in Odoo v17 CE
pos
Portretas
Portretas
Portretas
2
lapkr. 25
2619
Refund and Discount access to admin user only for Pos selling
pos
Portretas
Portretas
1
lapkr. 25
447
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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