2
0
mirror of https://github.com/frappe/books.git synced 2024-11-09 23:30:56 +00:00

fix: Create Invoice action from Customer

This commit is contained in:
Faris Ansari 2019-11-20 00:46:16 +05:30
parent dfd364dc95
commit b2c5eeb618

View File

@ -1,8 +1,32 @@
const { _ } = require('frappejs/utils');
const router = require('@/router').default;
const frappe = require('frappejs');
module.exports = {
name: 'Customer',
label: 'Customer',
basedOn: 'Party',
filters: {
customer: 1
}
},
actions: [
{
label: _('Create Invoice'),
action: async customer => {
let doc = await frappe.getNewDoc('SalesInvoice');
router.push({
path: `/edit/SalesInvoice/${doc.name}`,
query: {
values: {
customer: customer.name
}
}
});
}
},
// {
// label: _('View Invoices'),
// action: console.log
// }
]
};