Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
6487 Lượt xem

Hi, i am working on a module where i'm going to show a google map in my xml view, i am wondering how can i pass a list of strings with coordantes to xml view and work with them inside of a javascript code embeded inside my view. Is it possible?

I am calling the view like this in the procedure that calculates coordantes

return {
            'type': 'ir.actions.act_window',
            'name': _(self._description),
            'res_model': self._name,
            'res_id': ids[0],
            'view_type': 'form',
            'view_mode': 'form',
            'view_id': view_id,
            'target': 'current',
            'nodestroy': True,
            'context' : {'group_by' :'fleet'}
        }

And the view where it leads me, is this one:

           <record id="view_best_rutas_result" model="ir.ui.view">
                <field name="name">best.route</field>
                <field name="model">best.route</field>
                <field name="priority">1</field>
                <field name="type">form</field>
                <field name="arch" type="xml">
                    <form string="Mejores Rutas" version="7.0">
                            <header>
                                    <script xmlns="http://www.w3.org/1999/xhtml"><![CDATA[
                                alert('Hello');
                                ]]></script>
                            </header>
                            <field name="invoices" string="Facturas para Enviar" widget="one2many"  colspan="4" nolabel="1">
                                <tree>
                                        <field name="inv_id"/>
                                        <field name="order"/>
                                </tree>
                            </field>
                    </form>
                </field>            
           </record>

I will replace javascript to show google maps, but i want to access data from that piece of code, can someone please light my way in achieving this?

 

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 16
3369
0
thg 7 25
402
1
thg 7 25
5282
0
thg 7 25
825
0
thg 6 25
840