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

"Undefined get method" error after installing unrelated model

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
errorcustomsale.order
2 Cevaplar
4890 Görünümler
Avatar
Travis Waelbroeck

I have one custom module, which makes some changes to totals for my sales orders.

It works exactly as it is designed.


However, when I make another change to the sale order (such as adding a domain value to the product ID) from a different custom module, I end up getting an "Undefined get method" error.


I can manually upgrade the 1st (complex) module and both features work appropriately.


1) Why do I need to manually upgrade the 1st module? 
2) Can I make it such that I don't need to?

0
Avatar
Vazgeç
Prakash

please post your code here

Travis Waelbroeck
Üretici

I created an answer with relevant code (unable to edit original question). Thanks.

Avatar
Travis Waelbroeck
Üretici En İyi Yanıt

Update:

I'm unable to edit my original question (403 Forbidden Error), so here is the relevant code from our custom modules.

Complex Module

openerp.py

...

'depends': ['base', 'account', 'account_accountant', 'sale', 'sale_order_travis'],

'installable': True,

'auto_install': False,

'application': True,

...

sale_discount.py

from __future__ import division

from openerp import fields, models, api, osv

import openerp.addons.decimal_precision as dp

import math

class saleorder_discount(models.Model):

_inherit = 'sale.order'

fee_type = fields.Selection([('Blind Ship', 'Blind Ship'), ('Blind Ship Rush', 'Blind Ship Rush')], string='Fee Type',

states={'draft': [('readonly', False)]},

help='Fee is percentage of subtotal plus fixed fee')

minimum_order_fee_exempt = fields.Boolean('Exempt from Minimum Order Fee', help='If checked, customer will not be charged any fees even if the order is under the minimum.')

discounted_amount = fields.Float(string='Fees', store=True, readonly=True, compute='compute_amounts')

amount_total = fields.Float(string='Total', digits=dp.get_precision('Account'),

store=True, readonly=True, compute='compute_amounts')

def _prepare_invoice(self, cr, uid, order, lines, context=None):

res = super(saleorder_discount, self)._prepare_invoice(cr, uid, order, lines, context=context)

res.update({'fee_type' : order.fee_type,

'minimum_order_fee_exempt' : order.minimum_order_fee_exempt})

return res

@api.one

@api.onchange('minimum_order_fee_exempt','fee_type')

@api.depends('order_line.price_subtotal', 'discounted_amount', 'fee_type', 'minimum_order_fee_exempt')

def compute_amounts(self):

self.amount_untaxed = sum(line.price_subtotal for line in self.order_line)

# Get "order amount" without shipping charges because they don't count towards the minimum

price_shipping = 0

for line in self.order_line:

if line.product_id.default_code in ['mage_shipping','Shipping Charge'] or line.name in ['Magento Shipping','Shipping Charge']:

price_shipping += line.price_subtotal

elif line.name in ['Discount - Low Order Fee']:

self.minimum_order_fee_exempt = True

price_subtotal_excluding_shipping = self.amount_untaxed - price_shipping

val = 0

minimum_order_amt = 25.00

if self.name.count('-') >= 2:

self.minimum_order_fee_exempt = True

if price_subtotal_excluding_shipping < minimum_order_amt and not self.minimum_order_fee_exempt:

low_order_fee = 10.00

else:

low_order_fee = 0.00

for line in self.order_line:

val += self._amount_line_tax(line)

print "Fee Type: " + str(self.fee_type)

if self.fee_type == 'Blind Ship Rush':

fee_fixed = 20.00

fee_percentage = 0.05

amount_to_dis = round( (price_subtotal_excluding_shipping) * (fee_percentage) , 2)

self.discounted_amount = amount_to_dis + fee_fixed + low_order_fee

self.amount_total = self.amount_untaxed + val + amount_to_dis + fee_fixed + low_order_fee

elif self.fee_type == 'Blind Ship':

fee_fixed = 10.00

fee_percentage = 0.035

amount_to_dis = round( (price_subtotal_excluding_shipping) * (fee_percentage) , 2)

self.discounted_amount = amount_to_dis + fee_fixed + low_order_fee

self.amount_total = self.amount_untaxed + val + amount_to_dis + fee_fixed + low_order_fee

elif price_subtotal_excluding_shipping < minimum_order_amt and not self.minimum_order_fee_exempt:

self.discounted_amount = low_order_fee

self.amount_total = self.amount_untaxed + val + low_order_fee

else:

self.discounted_amount = 0

self.amount_total = self.amount_untaxed + val

print "Fees: $" + str(self.discounted_amount)

print "Amount Total: $" + str(self.amount_total)

Simple Module

It is changing position of a field on the product view. Completely unrelated from sales order.

...

<record id="product_mpn_search_view" model="ir.ui.view">

<field name="name">Search for MPN (Supplier Default Code)</field>

<field name="model">product.template</field>

<field name="inherit_id" ref="product.product_template_search_view"/>

<field name="arch" type="xml">

<field name="name" position="after">

<field name="seller_ids" string="MPN" filter_domain="[('seller_ids.product_code','ilike',self)]" />

</field>

</field>

</record>

...

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
how to solve product.uom error
error custom
Avatar
Avatar
2
Mar 15
12894
how to use domain defferent fields of object in odoo v14 , blow my code...
custom sale.order stock.tracking
Avatar
Avatar
1
Oca 23
2929
Custom field in Sale Order?
field custom sale.order
Avatar
0
Mar 15
4240
Can´t install custom modules odoo 8.0
error module custom
Avatar
Avatar
2
Mar 15
7373
Record does not exist or has been deleted (Record: sale.order(145723,), User: 2) 
error delete sale.order needhelp
Avatar
0
Şub 24
1683
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