تخطي للذهاب إلى المحتوى
أودو القائمة
  • تسجيل الدخول
  • جرب مجاناً
  • التطبيقات
    المالية
    • المحاسبة
    • فوترة
    • النفقات
    • جدول البيانات (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 sum of them separate from currencies?

اشتراك

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

لقد تم الإبلاغ عن هذا السؤال
orders
3 الردود
8490 أدوات العرض
الصورة الرمزية
Rick

Hi,guys

we have a difficult question

On same sale order need to show multi currencies,but how to sum of separate from them?

E.g:

Total:

USD 500.00

EUR 200.00

CNY 100

Any good idea?

0
الصورة الرمزية
إهمال
fasluca

Currency comes from price list. you can only select one currency for a price list..then how you are going to set this three currencies in same SO?

in which currency you want the sum??

Rick
الكاتب

Tks for your reply.There is only one currency on the same sales order that does not meet my requirements.I need multi currencies on same sales order.

fasluca

So you may have customized SO line to set different currency in each line..

You have to enable multi currency and one of them should be Base..

you haven't said which one is your base currency? ie in which currency you wan the sum)

Rick
الكاتب

My base currency is CNY, Now I can sum the base currency. In addition I need to sum these foreign currency lines

fasluca

if you have currency field in SO line...then you can calculate total easily

for line in self.order_line:

if line.currency_id.name == USD:

usd_total += line.subtotal

if line.currency_id.name == EUR:

eur_total += line.subtotal

if line.currency_id.name == CYN:

cyn_total += line.subtotal

like this

Rick
الكاتب

super!I'll try it! Thanks

fasluca

Make it as answer if you succeed

Rick
الكاتب

okay.

الصورة الرمزية
Artem
أفضل إجابة

It is really hard to show or I know nothing about Odoo.

Add to your model something like this

@api.one
def _compute_amount_each_currency(self):
sums=dict([(l.currency_id.name,0) for l in self.expense_ticket_line_ids])
for line in self.expense_ticket_line_ids:
sums[line.currency_id.name]+=line.amount_currency
 self.amount_each_currency=json.dumps(sums)
amount_each_currency = fields.Text(compute='_compute_amount_each_currency')

So we have got the field with the sums for each currency. This is the easiest part.

And now show time!

I'm still upset that <templetes> is available only in a kanban view. Am I right?

So in a form view I see only two ways. The first is to add another text field with appropriate text like 'Totals EUR: xxx, CYN: xxx, USD: xxx' in one line and add this field to the view. Baldly but I can't find another way.

A report is more flexible and here we can make it nice looking.  Create a model with the render_html function

class ReportSometing(models.AbstractModel):
    @api.one
    def render_html(self, data=None):
    [...]
    if objects[0]:
     sums=json.loads(objects[0].amount_each_currency)
      sums=[[key,value] for key,value in sums.items()]
    else:
     sums=[]
    docargs = {
        'sums': sums,
    }
    [...]

and convert the field with each currency totals into the list of lists of a currency name and its amount.

Insert into the report something like the following and get the profit.

<t t-foreach="sums" t-as="i">
     <p><t t-esc="i[0]"/><t t-esc="i[1]"/></p>
</t>

Season with any decoration.


Well.. the second way is to create a separate table with sums for each currency like the class AccountInvoiceLine(models.Model). The code is in brief. I did not test the whole idea.

class ExpenseTicket(models.Model):
    expense_ticket_currency_ids = fields.One2many('expense.ticket.currency', 'expenseticket_id')

class ExpenseTicketCurrency(models.Model):
_name = "expense.ticket.currency"
expenseticket_id = fields.Many2one('expense.ticket', string='', ondelete='cascade', index=True)
    currency_id = fields.Many2one('res.currency',string='Currency')
    amount_currency=fields.Monetary(string='Amount', currency_field='currency_id')

In a view we can use 'tree'

<field name="expense_ticket_currency_ids">
 <tree string="">
 <field name="currency_id"/>
 <field name="amount_currency"/>
 </tree>
</field>

The last part is to write functions to store data into ExpenseTicketCurrency.

0
الصورة الرمزية
إهمال
الصورة الرمزية
Rick
الكاتب أفضل إجابة

Question again

 

There are some products(services type) on the sales order line of the same sales order, which are in different currencies.

How to sum them group by different currencies and show on sale order form?

E.g:

Ocean Freight USD 10.00

Truck charge USD 5.00

Documents Fee EUR 50.00

Discharge Fee CNY 100


                                      Total : USD xx.xx

                                                  EUR xx.xx

                                                  CNY xx.xx

                                                                                    

Any good idea?

0
الصورة الرمزية
إهمال
Artem

The answer is below. I do not know your format of invoice lines but referring to invoice lines of the standard accounting module the code should be changed and added to '_compute_amount(self)' of the AccountInvoice.

amount_untaxed_sums=dict([(l.currency_id.name,0) for l in self.invoice_line_ids])

for line in self.invoice_line_ids:

amount_untaxed_sums[line.currency_id.name]+=line.price_subtotal

I did not test the code in Odoo but it should work.

Rick
الكاتب

Tks for your reply.I'll try it .

Artem

The code sums up perfectly, but I have problems with the show part.

Artem

Please check my answer I believe it contains many good ideas.

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

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

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
[newbie] order management only
orders
الصورة الرمزية
2
أكتوبر 25
3292
Odoo 17 Online, how to create purchase orders for non stock goods
orders
الصورة الرمزية
الصورة الرمزية
1
مارس 24
3467
Create a new order line on a sale order with Automated Action تم الحل
orders
الصورة الرمزية
الصورة الرمزية
1
مارس 23
6990
How Can Admin Receive Notification for Order placed in Shop - Odoo 10
orders
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
مارس 21
10638
Creating recurring invoice تم الحل
orders subscription
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
أكتوبر 25
16967
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "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