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:
parent
dfd364dc95
commit
b2c5eeb618
@ -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
|
||||
// }
|
||||
]
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user