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

Modifying product.template from within a module

اشتراك

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

لقد تم الإبلاغ عن هذا السؤال
modulesinheritance
1 الرد
10959 أدوات العرض
الصورة الرمزية
Sandy Pyke

Hi all,

I'm trying to modify product.template from within a module. Specifically I am looking to make the Internal Reference (default_code) field sortable. I've managed to build up a module that modifies an esiting form, but I can't seem to manage to get the changes to product.template to work.

My __init__.py looks like this:

 # -*- coding: utf-8 -*-
from . import addIntRef
My addIntRef.py looks like this:

 
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class product_template2(osv.osv): _name = 'product.template' _inherit = 'product.template' _columns = { 'default_code': fields.related('product_variant_ids', 'default_code', type='char', string='Internal Reference'), } product_template2()
Note: I am only trying to change the field label in the example above. Ultimately I would like this to make this field sortable...

My __openerp__.py looks like this:

 
# -*- coding: utf-8 -*- { 'name': "Add Internal Reference", 'summary': """Add Internal Reference field to standard forms.""", 'description': """ Adds the default internal reference field to forms so it is visible. This is used for internal part numbers so access to this is important. """, 'author': "Peck Tech Consulting Ltd.", 'website': "http://www.pecktech.ca", 'category': 'Tool', 'version': '0.1', 'depends': ['product'], 'data': ['addIntRef.xml'], 'demo': [], }
And my addIntRef.xml looks like this:

 
<?xml version="1.0"?> <openerp> <data> <record id="product.product_template_tree_view2" model="ir.ui.view"> <field name="name">product.template.product.tree2</field> <field name="model">product.template</field> <field name="inherit_id" ref="product.product_template_tree_view"/> <field name="arch" type="xml"> <xpath expr="//field[@name='name']" position="before"> <field name="default_code"/> </xpath> </field> </record> </data> </openerp>
I loadup the module just fine, and the product.template.product.tree2 view is loaded in and replaces the default one as expected. When I look at the module definition under Settings > Modules > product.template however I see no change to this template.

I've tried marking this field as sortable from the web interface, it does not allow me to save those changes. Plus that would be non-upgrade freindly... I think I am close, but just need some help getting over this last hump.

Oh and if it makes a difference I have Odoo 8 running on a Ubuntu server and I am accessing it from my local Windows 10 box with Chrome browser. I just updated Odoo this AM so should be on latest and greatest...

Any help / hints here would be much appreciated! Thanks!!!

0
الصورة الرمزية
إهمال
Sandy Pyke
الكاتب

Thanks for the feedback Groover. What I am trying to achieve here is to have the product.template.product.tree view sortable on Internal Reference (default_code) field that I've added. As it is now, I can click on the Name, Internal Category, Product Type and Status and have the records sorted on those. But the newly added field in the tree view is not sortable. I though it was to do with the product.template default_code value not being set to searchable, but looking at some of those other fields it looks like those are not either... So this leads me to believe that I need to change an attribute on that field that I've added to make that work. I still don't know why my product.template changes are not working, but that's secondary now... By the way I did try your suggestion but that did not work. Thinking it has more to do with my implementation though... Time for some more digging! If I look at the product.template (which is ithe source for this view, I find that those fields

الصورة الرمزية
Simplify it!
أفضل إجابة

Hello

Templates don't change, they are going to be called pn-the-fly and your xpath is going to work there.... So there is nothing that is going to change. About sortable, i'm not sure if I understood your question but that can be solved adding _order = "default_code" to the model definition.

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

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

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
Inherit without changing original module
modules inheritance
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
5
أكتوبر 20
8110
How to change inheritance order of models?
modules inheritance
الصورة الرمزية
0
نوفمبر 24
6156
Inheritance not working in code تم الحل
modules product inheritance
الصورة الرمزية
الصورة الرمزية
2
يونيو 20
5647
how to inherit the timesheet view in my new modul.
modules inheritance odoo8.0
الصورة الرمزية
1
يونيو 16
4142
Inheritance of module odoo in order to change product design
modules product inheritance
الصورة الرمزية
الصورة الرمزية
1
يونيو 15
1182
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "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