2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00
books/models/baseModels/Party/Supplier.js

54 lines
1.1 KiB
JavaScript
Raw Normal View History

import router from '@/router';
import frappe, { t } from 'frappe';
import { h } from 'vue';
import PartyWidget from './PartyWidget.vue';
export default {
name: 'Supplier',
2022-02-16 06:19:16 +00:00
label: t`Supplier`,
basedOn: 'Party',
filters: {
supplier: 1,
},
actions: [
{
2022-02-09 06:59:41 +00:00
label: t`Create Bill`,
condition: (doc) => !doc.isNew(),
action: async (supplier) => {
let doc = await frappe.getEmptyDoc('PurchaseInvoice');
router.push({
path: `/edit/PurchaseInvoice/${doc.name}`,
query: {
doctype: 'PurchaseInvoice',
values: {
supplier: supplier.name,
},
},
});
},
},
{
2022-02-09 06:59:41 +00:00
label: t`View Bills`,
condition: (doc) => !doc.isNew(),
action: (supplier) => {
router.push({
name: 'ListView',
params: {
doctype: 'PurchaseInvoice',
filters: {
supplier: supplier.name,
},
},
});
},
},
2019-12-26 13:45:41 +00:00
],
quickEditWidget: (doc) => ({
render() {
2019-12-26 13:45:41 +00:00
return h(PartyWidget, {
doc,
2019-12-26 13:45:41 +00:00
});
},
}),
};