frappe / frappejs

Node + Electron + Vue based metadata web framework (inspired by Frappe)
264 stars 110 forks source link

feat: add conditional `required`, fix formatting in document.js, fix async calls for submit and revert. #152

Closed 18alantom closed 2 years ago

18alantom commented 2 years ago

Required can now be set like so.

fields: [
    {
      fieldname: 'paymentMethod',
      label: 'Payment Method',
      fieldtype: 'Select',
      options: ['', 'Cash', 'Cheque', 'Transfer'],
      required: 1
    },
    {
      fieldname: 'referenceId',
      label: 'Ref. / Cheque No.',
      fieldtype: 'Data',
      required: (doc) => doc.paymentMethod !== 'Cash'
    },
]