mirror of
https://github.com/bringout/oca-ocb-vertical-industry.git
synced 2026-04-23 19:32:06 +02:00
Initial commit: Vertical Industry packages
This commit is contained in:
commit
d5567a0017
766 changed files with 733028 additions and 0 deletions
46
odoo-bringout-oca-ocb-lunch/lunch/static/src/views/kanban.js
Normal file
46
odoo-bringout-oca-ocb-lunch/lunch/static/src/views/kanban.js
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/** @odoo-module */
|
||||
|
||||
import { patch } from '@web/core/utils/patch';
|
||||
import { registry } from '@web/core/registry';
|
||||
|
||||
import { kanbanView } from '@web/views/kanban/kanban_view';
|
||||
import { KanbanRecord } from '@web/views/kanban/kanban_record';
|
||||
import { KanbanRenderer } from '@web/views/kanban/kanban_renderer';
|
||||
|
||||
import { LunchDashboard } from '../components/lunch_dashboard';
|
||||
import { LunchRendererMixin } from '../mixins/lunch_renderer_mixin';
|
||||
|
||||
import { LunchSearchModel } from './search_model';
|
||||
|
||||
|
||||
export class LunchKanbanRecord extends KanbanRecord {
|
||||
onGlobalClick(ev) {
|
||||
this.env.bus.trigger('lunch_open_order', {productId: this.props.record.resId});
|
||||
}
|
||||
}
|
||||
|
||||
export class LunchKanbanRenderer extends KanbanRenderer {
|
||||
getGroupsOrRecords() {
|
||||
const {locationId} = this.env.searchModel.lunchState;
|
||||
if (!locationId) {
|
||||
return [];
|
||||
} else {
|
||||
return super.getGroupsOrRecords(...arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
patch(LunchKanbanRenderer.prototype, 'lunch_kanban_renderer_mixin', LunchRendererMixin);
|
||||
|
||||
LunchKanbanRenderer.template = 'lunch.KanbanRenderer';
|
||||
LunchKanbanRenderer.components = {
|
||||
...LunchKanbanRenderer.components,
|
||||
LunchDashboard,
|
||||
KanbanRecord: LunchKanbanRecord,
|
||||
}
|
||||
|
||||
registry.category('views').add('lunch_kanban', {
|
||||
...kanbanView,
|
||||
Renderer: LunchKanbanRenderer,
|
||||
SearchModel: LunchSearchModel,
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue