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

update a fields.many2one openerp

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
updateopenerpfields.many2one
6463 Görünümler
Avatar
namiri

hi all, i have two objects flot_order_mission and flot_dotation with this implementation:

class flot_order_mission(osv.osv):
    _name = "flot.order"
    _description = "flot_order_Mission"




    _columns = {
                'name': fields.char('Order Reference', size=64, required=True,
            readonly=True, state={'draft': [('readonly', False)]}, select=True),
                'date_order': fields.date('Date', required=True, readonly=True, select=True, state={'draft': [('readonly', False)]}),
                'create_date': fields.datetime('Date Creation', readonly=True, help="La date de la creation de l'ordre de mission"),
                'date_confirm': fields.date('Date Validation', readonly=True, help="La date de la validation de l'ordre de mission"),
                'vers':fields.char('Destination',size=150,help="destination ",required=True),
                'datetimestar':fields.datetime('Date Heure départ',size=10,required=True ,help="La date et l'heure de départ"),
                'datetimeend':fields.datetime('Date Heure Retour',required=True ,help="La date et l'heure de retour"),
                'chauffeur':fields.many2one('flot.chauffeur', 'Chauffeur',required=True),
                'Obj':fields.text('Objet de la mission' ,required=True),
                'carte':fields.many2one('flot.carte', 'carte',required=True),
                'vehicule':fields.many2one('flot.vehicles', 'Vehicule',required=True),
                'user_id': fields.many2one('res.users', 'Editeur', state={'draft': [('readonly', False)]}, select=True),
                'dotation':fields.boolean('avec Dotation',readonly=True,select=True),
                'state': fields.selection([
            ('draft', 'Brouillon'),
            ('cancel', 'Annulé')
            ], 'Etat de l''ordre', readonly=True, help="Etat de l'ordre de mission", select=True),

    }

    _defaults = {
                    'user_id': lambda obj, cr, uid, context: uid,
                    'state': 'draft',
                    'date_order': fields.date.context_today,
                    'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'flot.order'),
                    'dotation' : False
    }   
flot_order_mission()




class flot_dotation(osv.osv):
    _name = "flot.dotation"
    _description = "flot_dotation"
    """
    def write(self, cr, uid, ids, vals, context=None):
        self.pool.get('flot.order').write(cr, uid, 3, {'dotation': True})
        return super(flot_dotation, self).write(cr, uid, id, vals, context=context) 
    """ 
    def write(self, cr, uid, ids, vals, context=None):
        if vals.get('dotation'):
            self.write(cr, uid,vals.get('dotation'),{'custom_field': 'test'},context)
       #if vals.get('dotation'):
         #mydot = self.pool.get('flot.order').browse(cr, uid, vals.get('dotation'), context=context)
        #if mydot.dotation == False:
        #    raise osv.except_osv('Error ! ', "cet order n'est pas dotéé")"""
        return super(flot_dotation, self).write(cr, uid, ids, vals, context)

    _columns = {
                'name': fields.char('dotation Reference', size=64, required=True,
            readonly=True, state={'draft': [('readonly', False)]}, select=True),
                'date_dotation': fields.date('Date', required=True, readonly=True, select=True, state={'draft': [('readonly', False)]}),
                'type_dota':fields.selection([
                        ('in', 'Intrene'),
                        ('out', 'Externe'),
                    ],'Type de la dotation',  help="Type de la dotation",required=True ,select=True),
                'create_date': fields.datetime('Date Creation', readonly=True, help="La date de la creation de l'ordre de mission"),
                'chauffeur':fields.many2one('flot.chauffeur', 'Chauffeur',required=True),
                'date_confirm': fields.date('Date Validation', readonly=True, help="La date de la validation de l'ordre de mission"),
                'order':fields.many2one('flot.order', 'Ordre Mission', domain="[('chauffeur','=',chauffeur),(('dotation','=',False)) ]"),
                'ref':fields.char('Réf Ordre Mission ext', size=64),
                'Obj':fields.text('Objet de la mission' ,required=True),
                'carte':fields.many2one('flot.carte', 'carte',required=True),
                'dotation':fields.float('Dotation',digits=(4,2),required=True),

                'user_id': fields.many2one('res.users', 'Editeur', state={'draft': [('readonly', False)]}, select=True),
                'state': fields.selection([
            ('draft', 'Brouillon'),
            ('donne', 'Valider'),
            ('cancel', 'Annulé')
            ], 'Etat de de la dotation', readonly=True, help="Etat de l'ordre de mission", select=True),

    }

    _defaults = {
                    'user_id': lambda obj, cr, uid, context: uid,
                    'state': 'draft',
                    'date_dotation': fields.date.context_today,
                    'type_dota':'in',
                    'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'flot.dotation'),
    }   
flot_dotation()

when modifying the flot_dotation, i want also update the field dotation in flot_order_mission too.

flot_dotation is related to flot_order_mission by this field 'order':fields.many2one('flot.order', 'Ordre Mission', domain="[('chauffeur','=',chauffeur),(('dotation','=',False)) ]")

can you give me the implementation on write method in the flot_dotation object or a example ?

regards

0
Avatar
Vazgeç
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
restart openerp 7 server on Xubuntu
service update openerp restart
Avatar
0
Mar 15
6092
openerp update Apps
module apps update openerp
Avatar
Avatar
2
Mar 15
5571
Odoo auto updates for on-premises Enterprise version (cloud/ in-house server) - v10 v11 v12 Çözüldü
update
Avatar
Avatar
Avatar
2
May 24
7477
Create selection type field dynamically?
openerp
Avatar
Avatar
Avatar
2
Eyl 23
8519
How to hide the create button dynamical tree view in openerp ? Çözüldü
openerp
Avatar
Avatar
2
Mar 23
47790
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