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

Pos Orders: add a field from lines

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
posodoo11community
2 Cevaplar
4676 Görünümler
Avatar
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
Avatar
Vazgeç
Avatar
Volodymyr
En İyi Yanıt

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
Avatar
Vazgeç
Avatar
Carlos Cosme
Üretici En İyi Yanıt

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
Avatar
Vazgeç
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!

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
POS cash rounding Odoo 11
pos odoo11community
Avatar
Avatar
2
Şub 20
3446
Can not close POS session. Odoo11
pos odoo11community
Avatar
Avatar
1
Ara 19
3190
Kitchen printing printer other than odoo provided list
pos
Avatar
Avatar
1
Kas 25
234
POS Table Synchronization Issue Between Devices in Odoo v17 CE
pos
Avatar
Avatar
Avatar
2
Kas 25
2635
Refund and Discount access to admin user only for Pos selling
pos
Avatar
Avatar
1
Kas 25
461
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