تخطي للذهاب إلى المحتوى
أودو القائمة
  • تسجيل الدخول
  • جرب مجاناً
  • التطبيقات
    المالية
    • المحاسبة
    • فوترة
    • النفقات
    • جدول البيانات (BI)
    • المستندات
    • توقيع إلكتروني
    المبيعات
    • إدارة علاقات العملاء
    • المبيعات
    • نقطة البيع للمتاجر
    • نقطة البيع للمطاعم
    • الاشتراكات
    • تأجير
    المواقع الإلكترونية
    • أداة بناء المواقع الإلكترونية
    • متاجر إلكترونية
    • مدونة
    • المنتدى
    • دردشة مباشرة
    • التعليم الإلكتروني
    سلسلة التوريد
    • المستودعات
    • التصنيع
    • إدارة دورة حياة المنتج
    • المشتريات
    • الصيانة
    • الجودة
    الموارد البشرية
    • موظفون
    • التوظيف
    • إجازة عمل
    • التقييمات
    • الإحالات
    • تطبيق الأسطول
    التسويق
    • التسويق الإجتماعي
    • التسويق عبر البريد الإلكتروني
    • التسويق عبر الرسائل النصية
    • فعاليات
    • أتمتة التسويق
    • الاستطلاعات
    الخدمات
    • المشاريع
    • الجداول الزمنية
    • الخدمة الميدانية
    • مكتب المساعدة
    • التخطيط
    • مواعيد
    اﻹنتاجية
    • مناقشة
    • الموافقات
    • إنترنت الأشياء "IoT"
    • بروتوكول ربط المحادثات الصوتية عبر الإنترنت
    • المعرفة
    • WhatsApp
    التطبيقات الخارجية ستوديو أودو منصة أودو السحابية
  • قطاعات الأعمال
    البيع بالتجزئة
    • متجر كتب
    • متجر ملابس
    • متجر أثاث
    • متجر بقالة
    • متجر معدات
    • متجر ألعاب
    الطعام والضيافة
    • بار وحانة
    • المطعم
    • مطعم للوجبات السريعة
    • نزل للضيوف
    • موزّع مشروبات
    • فندق
    العقارات
    • وكالة عقارات
    • شركة هندسة معمارية
    • البناء
    • إدارة العقارات
    • العناية بالحدائق
    • اتحاد مُلاّك العقارات
    استشارة
    • مؤسسة محاسبية
    • شريك أودو
    • وكالة تسويقية
    • منشأة قانونية
    • استقطاب المواهب
    • التدقيق والتوثيق
    التصنيع
    • الأقمشة
    • معدني
    • الأثاث
    • الطعام
    • مصنع خمور
    • هدايا الشركات
    الصحة واللياقة البدنية
    • نادي رياضي
    • متجر نظارات
    • مركز لياقة بدنية
    • الممارسون الصحيون
    • صيدلية
    • صالون تصفيف الشعر
    التجارة
    • عامل صيانة
    • الأجهزة والمعدات التقنية ودعمها
    • أنظمة الطاقة الشمسية
    • صانع أحذية
    • خدمات التنظيف
    • خدمات التكييف (HVAC)
    غير ذلك
    • منظمة غير ربحية
    • وكالة بيئية
    • تأجير لوحات إعلانية
    • تصوير
    • تأجير دراجات
    • بائع وسيط للبرمجيات
    تصفح كافة قطاعات الأعمال
  • مجتمع أودو
    تعلم
    • دروس
    • التوثيق
    • شهادات
    • التدريب
    • مدونة
    • بودكاست
    قم بتعزيز التعليم
    • برنامج تعليم
    • Scale UP! لعبة الأعمال
    • قم بزيارة أودو
    احصل على البرنامج
    • تحميل
    • قارنْ الإصدارات
    • إطلاق
    تعاون
    • جيت هاب "Github"
    • المنتدى
    • فعاليات
    • الترجمات
    • كنْ شريكاً
    • خدمات الشركاء
    • سجل مكتب المحاسبة الخاص بك
    احصل على الخدمات
    • اعثر على شريك
    • اعثر على محاسب
    • قابل أحد مرشدي الأعمال
    • خدمات التنفيذ
    • مراجع العملاء
    • الدعم
    • الترقيات
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    الحصول على عرض توضيحي
  • الأسعار
  • المساعدة

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

  • إدارة علاقات العملاء
  • e-Commerce
  • المحاسبة
  • المخزون
  • PoS
  • المشروع
  • MRP
All apps
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
يجب أن تكون مسجلاً حتى تتفاعل مع المجتمع.
كافة المنشورات الأفراد الشارات
علامات التصنيف (عرض الكل)
odoo accounting v14 pos v15
حول هذا المنتدى
المساعدة

How to recalculate a residual?

اشتراك

تسلم الإشعارات عندما يكون هناك نشاط في هذا المنشور

لقد تم الإبلاغ عن هذا السؤال
python2.7openerp7overridingresidualmakeOrder
7266 أدوات العرض
الصورة الرمزية
Anirudh Lou

I think this gonna be the most hard situation i am facing, in my minisystem it involves a selling of an item where a customers need to make downpayment. So what i did were these:

  • For a customers to make downpayment i used (Customer Payment, however i did not make any entry on it's Payment Information 'account_move_line'. The next thing i did was validate it, so it created a journal items)

  • In my crm_lead, i add some field (many2one on account_voucher) that point to the customer payment

  • I created a class named account_sale_line (many2one to both sale_order and account_invoice)

  • In account_invoice i modified method _amount_all (because i add some field in account_invoice) this is how i modified it:

  •    
    def _amount_residual(self, cr, uid, ids, name, args, context=None):
    _logger.info("\n\t\t\tI was called, my ids is ... %s"%(str(name)))
    result = super(account_invoice,self)._amount_residual(cr, uid, ids, name, args)
    #result = {}
    for invoice in self.browse(cr, uid, ids, context=context):
    result[invoice.id] = 0.0
    if invoice.move_id:
    for m in invoice.move_id.line_id:
    if m.account_id.type in ('receivable','payable'):
    result[invoice.id] += m.amount_residual_currency
    result[invoice.id] = result[invoice.id] - invoice.so_ai_amount
    #prevent the residual amount on the invoice to be less than 0
    result[invoice.id] = max(result[invoice.id], 0.0)
    return result

          

    def _get_invoice_factor(self, cr, uid, ids, context=None):
    result = {}
    for line in self.pool.get('sale.order.invoice').browse(cr, uid, ids, context=context):
    result[line.order_id.id] = True
    return result.keys()


    'residual': fields.function(_amount_residual, digits_compute=dp.get_precision('Account'), string='Balance',
    store={
    'account.invoice': (lambda self, cr, uid, ids, c={}: ids, ['invoice_line','move_id','so_ai_lines'], 50),
    'account.invoice.tax': (_get_invoice_tax, None, 50),
    'account.invoice.line': (_get_invoice_line, ['price_unit','invoice_line_tax_id','quantity','discount','invoice_id'], 50),
    'account.move.line': (_get_invoice_from_line, None, 50),
    'account.move.reconcile': (_get_invoice_from_reconcile, None, 50),
    'sale.order.invoice': (_get_invoice_from_so_ai, ['amount'], 50),
    },
    help="Remaining amount due."),


What problem i am facing is when i click the button Convert to Qoutation in class crm_sale, it says:

AttributeError: 'Field move_id not found in browse_record(account.invoice, 102)' . Here is what the log says:

  File "/opt/openerp/custom_addons/mini_shop/account_invoice.py", line 74, in _amount_residual
    result = super(account_invoice,self)._amount_residual(cr, uid, ids, name, args)
File "/opt/openerp/custom_addons/mini_shop/account_invoice.py", line 126, in _amount_residual
if invoice.move_id:
File "/opt/openerp/server-7/openerp/osv/orm.py", line 504, in __getattr__
raise AttributeError(e)
AttributeError: 'Field move_id not found in browse_record(account.invoice, 102)'

I cannot understand why it point to account_invoice and i don't know why the id being pointed out is 102, if my guess is right this id is the supposed id of sale_order.


Any help is much appreciated










0
الصورة الرمزية
إهمال
Serpent Consulting Services Pvt. Ltd.

Hi, I guess your line has invoice id, other than order id. Try by result[line.invoice_id.id] = True

هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!

أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
How do I create a message box/ dialog box in openerp 7 with 'Ok' and 'Cancel' buttons in it
python2.7 openerp7
الصورة الرمزية
الصورة الرمزية
3
سبتمبر 18
6365
Hide edit button according to status in openerp
python2.7 openerp7
الصورة الرمزية
0
فبراير 16
4466
How to get the sum of field in a column?
python2.7 openerp7
الصورة الرمزية
0
أغسطس 15
6393
How to show two fields from the same table whith on change
python2.7 openerp7
الصورة الرمزية
الصورة الرمزية
1
مارس 15
1313
Currency by defaults تم الحل
python2.7 openerp7
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
3
مارس 15
1099
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "Github"
  • المشغل الآلي رنبوت
  • الترجمات
خدماتنا
  • استضافة أودو إس إتش
  • الدعم
  • الترقية
  • التطويرات المخصصة
  • التعليم
  • اعثر على محاسب
  • اعثر على شريك
  • كنْ شريكاً
معلومات عنا
  • شركتنا
  • أصول العلامة التجارية
  • اتصلْ بنا
  • الوظائف
  • فعاليات
  • بودكاست
  • مدونة
  • عملاء
  • قانوني • الخصوصية
  • الحماية
الْعَرَبيّة 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

أودو هو عبارة عن مجموعة من تطبيقات الأعمال مفتوحة المصدر التي تغطي جميع احتياجات شركتك، مثل: إدارة علاقات العملاء والتجارة الإلكترونية والمحاسبة والمخزون ونقاط البيع وإدارة المشاريع وما إلى ذلك.

ما يجعل من أودو مميزاً هو هدفه بأن يكون سهل الاستخدام للغاية ومتكاملاً تمامًا في الوقت ذاته.

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