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

I need help converting my code 17 to 18

اشتراك

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

لقد تم الإبلاغ عن هذا السؤال
help
1 الرد
2885 أدوات العرض
الصورة الرمزية
bekoinettien@gmail.com

Good evening Odoo community, I have my code from version 17 that I want to migrate to version 18, but I'm encountering an error that you'll see in point 4.

I remind you that it works fine in version 17, except that instead of using tree in version 17, I changed it to list.



1-MODEL FARMER

class Farmers(models.Model):

    _name = 'res.partner'

    _inherit = 'res.partner'

    _description = 'Planteurs'


    plantation_ids = fields.One2many('plantation.plantation', 'partner_id', 'Plantations')

    farmer = fields.Boolean('Planteur')

    myp_id = fields.Many2one('plantation.myp', string="Mode Reglement", )

    struct_id = fields.Many2one('planting.payroll.structure', string="Structure Salariale",)

    type_id = fields.Many2one('type.farmer', string="Type Planteur",)

    group_id = fields.Many2one('group.group', required=True, string="Groupe Tarification Planteur",)

    birthday = fields.Date(string='Date Immatriculation', required=False)

    number_aprocmac = fields.Char(string='Numero identification aprocmac', required=False)

    code_farmer = fields.Char(string='Code Planteur', required=True, index=True)

    prime_id = fields.Many2one('prime.prime', string="Groupe",required=False)


   


2-MODEL PLANTAPLANTATION 

# Plantations


class Plantation(models.Model):

    _name = 'plantation.plantation'

    _description = 'Plantations'

    _inherit = ['mail.thread', 'mail.activity.mixin']


    name = fields.Char('Identification plantation',required=True)

    number_geo = fields.Char('Numero Géolocalise')

    partner_id = fields.Many2one("res.partner", string="Planteur", required=False,ondelete="cascade", domain=[('farmer', '=', True)])

    frequency_id = fields.Many2one('frequency.payroll', string="Frequence de paie", required=True)

    area = fields.Char(string='Superficie',required=False)

    locality_id = fields.Many2one("locality.locality","Région",required=False)

    sector_id = fields.Many2one("sector.sector","Département",required=False)

    village_id = fields.Many2one("farmer.village","Village",required=False)

    date = fields.Char("Date Immatriculation",required=False)

    code_farmer = fields.Char(string='Code Planteur', required=False)



3-VIEWS FORM FARMER



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

            <field name="name">plantation.res.partner.inherit</field>

            <field name="model">res.partner</field>

            <field name="inherit_id" ref="base.view_partner_form"/>

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

                 <sheet>

                    <group>

                        <field name="farmer" invisible="1" string="Est un Planteur ?"/>

                       <field name="struct_id" required ="farmer == True"/>

            <field name="group_id" required="1"/>

            <field name="type_id" required = "farmer == True" options="{'no_create': True}"/>

                    </group>

                    <group>

                        <field name="myp_id" required = "farmer == True "/>

            <field name="number_aprocmac"/>

                         <field name="code_farmer"/>

<!--                        <field name="prime_id"/>-->

                    </group>

                </sheet>

<notebook position="inside">

                    <page string="Plantations">

                        <field name="plantation_ids">

​ ​ ​<list string="Plantations" editable="bottom">

​                                <field name="name" />

​                                <field name="village_id"  />

​                                <field name="frequency_id" />

​                                <field name="date" />

​                                <field name="area"/>

                            </list>

                        </field>

                    </page>

                </notebook>



            </field>

        </record>





4-ERROR


odoo.tools.convert.ParseError: while parsing file:/d:/odoo18/server/odoo/addons_bekoin/fond_de_tasse/views/partner.xml:14

Erreur lors de la validation de la vue :


                                <field name="currency_id" invisible="1"/>

                                <field name="total_invoiced" widget="monetary" options="{'currency_field': 'currency_id'}"/>

                            </span>

                            <span class="o_stat_text">Invoiced</span>

                        </div>


Le champ "village_id" n'existe pas dans le modèle "res.partner"


View error context:

{'file': 'd:\\odoo18\\server\\odoo\\addons_bekoin\\fond_de_tasse\\views\\partner.xml',

'line': 20,

'name': 'plantation.res.partner.inherit',

'view': ir.ui.view(2158,),

'view.model': 'res.partner',

'view.parent': ir.ui.view(126,),

'xmlid': 'plantation_res_partner_inherit'}



The above server error caused the following client error:

RPC_ERROR: Odoo Server Error

    RPC_ERROR

        at makeErrorFromResponse (http://localhost:8069/web/assets/6b047a9/web.assets_web.min.js:3148:163)

        at XMLHttpRequest.<anonymous> (http://localhost:8069/web/assets/6b047a9/web.assets_web.min.js:3153:13)

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

You're seeing this error:


Le champ "village_id" n'existe pas dans le modèle "res.partner"


This means that Odoo is trying to validate the field village_id on the res.partner model, even though you meant it to refer to the plantation_ids One2many list, whose target model does include village_id.


Why It Worked in Odoo 17 but Fails in Odoo 18

In Odoo 18, there are stricter XML view validations. Specifically:


When you define <field name="plantation_ids"> and nest a <list>, Odoo expects the nested fields like village_id to exist only in the target model (plantation.plantation).


If Odoo mistakenly thinks the list content belongs to the parent model (res.partner), it will raise an error.


How to Fix It

Ensure your <field name="plantation_ids"> is a proper One2many with a nested list (not tree), and avoid indentation/formatting that may confuse the XML parser.


Update this part of your view like so:


xml

Copy

Edit

<field name="plantation_ids" mode="tree" context="{'default_partner_id': active_id}">

    <tree editable="bottom">

        <field name="name"/>

        <field name="village_id"/>

        <field name="frequency_id"/>

        <field name="date"/>

        <field name="area"/>

    </tree>

</field>

Or, if you want to use <list>, ensure Odoo 18 understands it as a valid container:


xml

Copy

Edit

<field name="plantation_ids">

    <tree string="Plantations" editable="bottom">

        <field name="name"/>

        <field name="village_id"/>

        <field name="frequency_id"/>

        <field name="date"/>

        <field name="area"/>

    </tree>

</field>


Do not use <list> directly — in standard Odoo XML views, use <tree> for list-style sub-record display.


If You Need Help Migrating More Code


I'd be happy to assist further or even help optimize your module for Odoo 18.


You can contact me directly at  – sagar@yalabs in at Yandtradhigham, we specialize in custom Odoo solutions and enterprise migrations.


Let me know if you also want a checklist for Odoo 18 migration, guidance on One2many field usage, or help setting up a developer debug environment for smoother error tracking.

0
الصورة الرمزية
إهمال
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!

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

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
[UA GuíA pArA ApOyo^@]¿Cómo hablo con alguien de United? #UAA TELEFONO
help
الصورة الرمزية
0
نوفمبر 25
3
request for information
help
الصورة الرمزية
الصورة الرمزية
1
سبتمبر 25
690
Hello everyone, I need your help; I want to make a custom header to print my pdf reports.
help
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
4
يونيو 25
3042
Give a discount to a product for every customer and show it in the website pricetag?
help
الصورة الرمزية
0
فبراير 25
1385
Hello everyone, I have just installed odoo17 community but I want to switch to the enterprise version for which I already have the license key.
help
الصورة الرمزية
الصورة الرمزية
1
نوفمبر 24
2603
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "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