v 9.0 Third Party 158
Download for v 9.0
Availability
Odoo Online
Odoo.sh
On Premise
Technical Name web_one2many_ng
LicenseAGPL-3
You bought this module and need support? Click here!

Acciones avanzadas sobre el campos One2Many

Añadiendo el widget 'one2many_ng' a un campo podrás definir campos m2o para crear/eliminar registros de forma masiva ó acciones python arbitrarias sobre los registros seleccionados.

¿Como funciona?

Debes indicar que el campo One2many debe utilizar el widget 'one2many_ng'
<field name="categoria_producto_rel_ids" widget="one2many_ng" />
Las acciones se deberána añadir como el atributo actions del nodo field. En cada acción se pueden definir las siguientes propiedades:
name: Nombre del método python del modelo relacionado del campo one2many a ejecutar
multiselect: Si se establece a "1", el método python recibirá el listado de registros seleccionados (del campo one2many). Será obligatorio seleccionar algun valorantes de ejecutar la acción.
string: Etiqueta de la acción
separator: Si se establece a "1" se añadirá un separador despuesde la acción.

<field name="categoria_producto_rel_ids" widget="one2many_ng" actions='[ { "name": "bulk_action3", "string": "Acción 3", "multiselect": "1" }, { "name": "bulk_action4", "string": "Acción 4", "multiselect": "1" } ]'>
Si se desean añadir acciones de añadir o eliminar de forma masiva se deberá añadir los atributos mass_add_field y/o mass_del_field en los campos m2o sobre los se se desee la acción.
<field name="categoria_producto_rel_ids" widget="one2many_ng"> <tree editable="Botton"> <field name="producto_id" mass_add_field="1" mass_del_field="1" /> <field name="producto2_id" mass_add_field="1" /> <field name="producto3_id" mass_add_field="1" /> <field name="nombre_relacion" /> <field name="fecha" /> </tree> </field>

Ejemplo de función Python para las acciones

@api.multi
def bulk_verify(self):
 for record in self:
 print record

Screenshot

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.
Good work, but it only works in edit mode.
by
Ubaid
on 5/17/17, 3:02 AM

I had installed this module but in my case I want to perform some function on readyonly/edit="false" in list view of One2many filed and no action/name string appeared on right side. How it works in my case?


There are no comments yet!