Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

How to pass values to a popup

By
Drees Far
on 12/1/15, 10:24 AM 637 views

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)?

Sudhir Arya (SA)
on 12/1/15, 12:30 PM

my button' type is "OBJECT"

Drees Far
on 12/2/15, 3:21 AM
0

Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--
996
| 5 3 6
Rajkot, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 12/2/15, 5:27 AM

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????

Drees Far
on 12/2/15, 5:34 AM

@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 ???

Drees Far
on 12/2/15, 5:35 AM
0

Axel Mendoza

--Axel Mendoza--
10318
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 12/1/15, 1:40 PM

Use the context attribute of the button tag. Example

<button name="method" string="clic me" type="object" context="{'key': 'value', 'field_key': field}" />

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 12/1/15, 10:24 AM
Seen: 637 times
Last updated: 12/3/15, 12:36 PM