Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
7671 มุมมอง

Hello!!

Please, i want to know how can we pass some values to a popup open through a button.

Is here any suggestion.

Best Regards.

อวตาร
ละทิ้ง

What is the type of your button (object or action)?

ผู้เขียน

my button' type is "OBJECT"

คำตอบที่ดีที่สุด

Dear Drees Far,

Using below code you will pass the value in pop-up

write this code inside your button function if your button type is object

raise osv.except_osv(_('Warning'), _('Your message %s.') % (fetching value))

For example:

first import the library

1.from openerp.tools.translate import _

2. Define your function like below.

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

    product_obj = self.pool.get('product.product')

    for data in self.browse(cr, uid, ids, context=None):

        for line_data in data.invoice_line:

            if line_data.quantity < line_data.product_id.qty_available:

                pass

            else:

                raise osv.except_osv(_('Warning'), _('Your total available products are %s.') % (line_data.product_id.qty_available))

    return True

อวตาร
ละทิ้ง
ผู้เขียน

sorry but are you talking about POPUP????

ผู้เขียน

@Ankit my friend, i have a button to click. And when i click on this button i call an other menu so that i want to define some values in the other menu. i am asking how can i do it ???

คำตอบที่ดีที่สุด

Use the context attribute of the button tag. Example

<button name="method" string="clic me" type="object" context="{'key': 'value', 'field_key': field}" />
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ธ.ค. 15
4018
0
ธ.ค. 15
123
0
ธ.ค. 15
76
0
ก.ย. 15
4002
How to make pop ups after actions? แก้ไขแล้ว
2
ก.ค. 25
6873