mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[FIX] web_help: Run pre-commit [FIX] web_help: Run pre-commit [FIX] web_help: Run pre-commit [FIX] web_help: Run pre-commit [IMP] Easy changeable template and buttons texts, more demo, fixed readme. [IMP] Easy changeable template and buttons texts, more demo, fixed readme. [IMP] Easy changeable template and buttons texts, more demo, fixed readme. [FIX] Grammar
17 lines
502 B
JavaScript
17 lines
502 B
JavaScript
/** @odoo-module **/
|
|
import {registry} from "@web/core/registry";
|
|
|
|
export function findTrip(model, viewType) {
|
|
const trips = registry.category("trips").getAll();
|
|
const matchedTrips = _.filter(trips, function (trip) {
|
|
return trip.selector(model, viewType);
|
|
});
|
|
if (matchedTrips.length >= 1) {
|
|
if (matchedTrips.length != 1) {
|
|
console.warning("More than one trip found", model, viewType);
|
|
}
|
|
return matchedTrips[0].Trip;
|
|
}
|
|
return null;
|
|
}
|