mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
minor fixes
This commit is contained in:
parent
3efaf0bbfa
commit
66284ec5b3
@ -42,7 +42,7 @@ module.exports = class ReportPage extends Page {
|
|||||||
|
|
||||||
getFilterValues() {
|
getFilterValues() {
|
||||||
const values = {};
|
const values = {};
|
||||||
for (let control of this.form.controlList) {
|
for (let control of this.form.formLayout.controlList) {
|
||||||
values[control.fieldname] = control.getInputValue();
|
values[control.fieldname] = control.getInputValue();
|
||||||
if (control.required && !values[control.fieldname]) {
|
if (control.required && !values[control.fieldname]) {
|
||||||
frappe.ui.showAlert({message: frappe._('{0} is mandatory', control.label), color: 'red'});
|
frappe.ui.showAlert({message: frappe._('{0} is mandatory', control.label), color: 'red'});
|
||||||
@ -75,7 +75,10 @@ module.exports = class ReportPage extends Page {
|
|||||||
const filterValues = this.getFilterValues();
|
const filterValues = this.getFilterValues();
|
||||||
if (filterValues === false) return;
|
if (filterValues === false) return;
|
||||||
|
|
||||||
let data = await frappe.call(this.method, filterValues);
|
let data = await frappe.call({
|
||||||
|
method: this.method,
|
||||||
|
args: filterValues
|
||||||
|
});
|
||||||
this.datatable.refresh(data);
|
this.datatable.refresh(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,9 @@ module.exports = class BaseForm extends Observable {
|
|||||||
Object.assign(this, arguments[0]);
|
Object.assign(this, arguments[0]);
|
||||||
this.links = [];
|
this.links = [];
|
||||||
|
|
||||||
this.meta = frappe.getMeta(this.doctype);
|
if (!this.meta) {
|
||||||
|
this.meta = frappe.getMeta(this.doctype);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.setup) {
|
if (this.setup) {
|
||||||
this.setup();
|
this.setup();
|
||||||
|
@ -20,7 +20,7 @@ async function makePDF(html, filepath) {
|
|||||||
|
|
||||||
async function getPDFForElectron(doctype, name) {
|
async function getPDFForElectron(doctype, name) {
|
||||||
const html = await getHTML(doctype, name);
|
const html = await getHTML(doctype, name);
|
||||||
const filepath = path.join(frappe.electronConfig.directory, name + '.pdf');
|
const filepath = path.join(frappe.electronSettings.directory, name + '.pdf');
|
||||||
await makePDF(html, filepath);
|
await makePDF(html, filepath);
|
||||||
shell.openItem(filepath);
|
shell.openItem(filepath);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user