<< Click to Display Table of Contents >> Odoo ERP library |
![]() ![]() ![]() |
odoogetmodelcount(Input1, Input2, Input3) - used is to get number of rows that you get from Odoo ERP with name in Input1 (Example: “OdooERP0”) and model with name in Input2 (Example: “mrp.workorder”) that fits the filter in Input3. Filter is consisted with name of field, comparison and value to compare separated by commas (Example:”state,=,cancel” get rows where state == cancel).
Example:
Tags.orderscount = odoogetmodelcount("OdooERP0", “mrp.workorder","state,=,cancel");
odooreadmodelfield(Input1, Input2, Input3, Input4, Input5) - used to read value of row’s field that you get from Odoo ERP with name in Input1 (Example: “OdooERP0”) and model with name in Input2 (Example: “mrp.workorder”) that fits the filter in Input3. Filter is consisted with name of the field, comparison and value to compare separated by commas (Example:”state,=,cancel” get rows where state == cancel). Name of the field you have to enter in Input4 (Example:”production_id”). In Input5 you have to enter row position you want to read (Example:1).
Example:
Tags.Field = odooreadmodelfield("OdooERP0","mrp.workorder", "", “production_id",1);
odoowritemodelfield(Input1, Input2, Input3, Input4, Input5, Input6) - used to write value to the row’s field that you get from Odoo ERP with name in Input1 (Example: “OdooERP0”) and model with name in Input2 (Example: “mrp.workorder”) that fits the filter in Input3. Filter is consisted with name of the field, comparison and value to compare separated by commas (Example:”state,=,cancel” get rows where state == cancel). Name of the field you have to enter in Input4 (Example:”production_id”). In Input5 you have to enter row position you want to read (Example:1). And in Input6 you have to enter value should be written (Example:”20”). If write is successful function return TRUE.
Example:
odoowritemodelfield("OdooERP0","product.product", "id,=,2","list_price",0,Tags.Price);
odoocallfunction(Input1, Input2, Input3, Input4) - used to call function in Odoo ERP with name in Input1 (Example: “OdooERP0”) and model with name in Input2 (Example: “mrp.workorder”) with name in Input3 (Example:”action_toggle_is_locked”), and with parameter in Input4 (Example: 1). If call is successful function return TRUE.
Example:
odoocallfunction("OdooERP0","mrp.production","action_toggle_is_locked",Tags.ID);