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

Developing a new popup in stock_picking, basic doubts about how to generate the popup

اشتراك

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

لقد تم الإبلاغ عن هذا السؤال
stock_pickingpopuppopupwindowodooV8
1 الرد
9084 أدوات العرض
الصورة الرمزية
E.M.

I am trying to develop a new popup for stock_picking which will display the move.lines and allow user to select them and print a custom report with selected ones.

As a first try I want to generate the popup with just a couple of fields of the stock.picking.


- Do I have to use models.Transient or models.Model?

- Do I have to give it a different _name="label.picking" or just extend "stock.picking" and use it?

- Do I have to use view_id field in the button controller?


This is the model:


# -*- coding: utf-8 -*-
from openerp import models, fields
class LabelPicking(models.TransientModel):
_name = "label.picking"
_inherit = "stock.picking"
def view_tree_print_dispatch_items(self):
return {
'type': 'ir.actions.act_window',
'name': 'view_tree_print_dispatch_items',
'view_type': 'tree',
'view_mode': 'tree',
'res_model': 'label.picking',
'target': 'new',
}


And this is the XML:

<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<record model="ir.ui.view" id="stock.view_picking_form_item_labels">
<field name="name">stock.picking.form.item_labels</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="before">
<button name="view_tree_print_dispatch_items" string="Imprimir Items" type="object"/>
</xpath>
</field>
</record>

<record id="view_tree_print_dispatch_items" model="ir.ui.view">
<field name="name">Labels Dispatch Items Tree</field>
<field name="model">stock.picking</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>-
<field name="origin"/>-
</tree>
</field>
</record>

</data>
</openerp>
 
2
الصورة الرمزية
إهمال
الصورة الرمزية
Jose M. González
أفضل إجابة

Hi, 

this example may help, in my case i use popup to update other model and return the original view. (this popup is launched from button)

#modelo temporal para popup.

class refuse_leave(osv.osv_memory):

_name = "refuse.leave"

_description = "Reason that order is not delivered"

_columns = {

'refusal_explanation': fields.text('Refusal explanation', required=True),

'return_reasons_type': fields.many2one('delivery.return.reasons.type','Return type', required=True),

}

     

     #botón de guardar la información introducida en el popup

def refuse_leave(self,cr, uid, ids, context=None):

data = self.read(cr,uid,ids)[0] 

return_reason = data['refusal_explanation']

return_type = data['return_reasons_type'][0]

if return_reason == "" or( len(return_reason)< 5):

raise osv.except_osv(_('Error'), _('Motivo no válido'))

else:

delivery_route_line_obj = self.pool.get('delivery.route.line')

record_id = context.get('delivery_line_id')

tipo_incidencia = context.get('tipo_entrega')     

[ operaciones que tenga que realizar ]

return True

refuse_leave()


<!-- xml con el modelo del popup --> <?xml version="1.0" encoding="utf-8"?>

<openerp>

<data>

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

<field name="name">Leave Refuse</field>

<field name="model">refuse.leave</field>

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

<form string="Refuse_Leave"> <!-- position="attributes"-->

<separator string="Información de recepción de pedido" />

<attribute name="string"> Seleccione el motivo por el cual el pedido no se entregó correctamente del siguiente desplegable:<br></br></attribute>

<!-- <div style="float:left; widht:30%;">

<field name="return_reasons_type" />

</div> -->

<group colspan="0" col="0">

<div><b>Razones</b> </div><newline />

<field name="return_reasons_type" nolabel="1" />

<field name="refusal_explanation" nolabel="1" placeholder="Indique el motivo por el que no se pudo entregar es pedido..." />

<small>

<b>Información</b><br></br>

Es obligatorio que indique algún texto de por qué este pedido no fue entregado correctamente.

</small>

</group>

<footer>

<button string="Guardar motivo" class="oe_highlight" type="object" name="refuse_leave" />

<button string="Salir" special="cancel" /> <!-- class="oe_link" -->

</footer>

</form>

</field>

</record>

<record id="action_view_refuse_leave" model="ir.actions.act_window">

<field name="name">Leave Refuse</field>

<field name="type">ir.actions.act_window</field>

<field name="res_model">refuse.leave</field>

<field name="view_type">form</field>

<field name="view_mode">form</field>

<field name="target">new</field>

</record>

</data>

</openerp>

<!-- xml que lanzará el popup -->

...

<button name="action_received_with_exception" string="Received with exception"

type="object" states="delivered" />



#python desde donde lanza la acción del botón

def action_received_with_exception (self, cr, uid, ids, context=None):

context.update({

'tipo_entrega' : 'ok_con_incidencias',

'delivery_line_id': ids[0],

})

try:

return {

'name': 'Causas de devolución de pedido',

'view_type': 'form',

"view_mode": 'form',

'res_model': 'refuse.leave',

'type': 'ir.actions.act_window',

'target': 'new',

'flags': {'action_buttons': False},

'context': context,

}

except ValueError:

raise osv.except_osv(_('Error'))

1
الصورة الرمزية
إهمال
E.M.
الكاتب

It helps, now I am trying a transient model which inherits from stock_picking, how do you move a given ID (or parameter) from stock_picking to the popup model/form when you click the button?

Jose M. González

with that question I have also fought x-D with this code: [code] context.update({ 'tipo_entrega' : 'ok_con_incidencias', 'delivery_line_id': value that you want, }) [/code] you can pass the info in the context to popup because you add param 'context': context ( see -> #python desde donde lanza la acción del botón). And you obtain the pass value in this line: record_id = context.get('delivery_line_id') ( see -> #modelo temporal para popup.). May the Force be with you !!!

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

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

تسجيل
المنشورات ذات الصلة الردود أدوات العرض النشاط
Press a button and display a form in a popup, how? تم الحل
qweb popup popupwindow odooV8
الصورة الرمزية
الصورة الرمزية
الصورة الرمزية
2
ديسمبر 23
39132
Popup Form, do i need to create a new model? تم الحل
models popup popupwindow odooV8
الصورة الرمزية
الصورة الرمزية
1
فبراير 16
8770
Odoo pop up
time popup popupwindow
الصورة الرمزية
0
أبريل 24
2548
Can't validate stock.picking with product on multi-location
stock_picking validateerror odooV8
الصورة الرمزية
0
سبتمبر 19
71
Launch popup to select a certain type of product in the sale.order.line view
sale.order.line popup popupwindow
الصورة الرمزية
0
مايو 24
4347
المجتمع
  • دروس
  • التوثيق
  • المنتدى
مصدر مفتوح
  • تحميل
  • جيت هاب "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