Jam.py documentation

lookup_field

lookup_field

domain: client

language: javascript

class Item class

Description

Use lookup_field to check if the item was created to select a value for the lookup field. See Lookup fields

Example

function on_view_form_created(item) {
    item.table_options.multiselect = false;
    if (!item.lookup_field) {
        var print_btn = item.add_view_button('Print', {image: 'icon-print'}),
            email_btn = item.add_view_button('Send email', {image: 'icon-pencil'});
        email_btn.click(function() { send_email() });
        print_btn.click(function() { print(item) });
        item.table_options.multiselect = true;
    }
}