콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
4 답글
7735 화면

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}" />
아바타
취소
관련 게시물 답글 화면 활동
2
12월 15
4070
0
12월 15
123
0
12월 15
76
0
9월 15
4103
2
7월 25
7328