Many2Many快速预览

This commit is contained in:
夜未央
2025-09-21 19:24:16 +08:00
parent 660120467e
commit 2bb7139522
8 changed files with 292 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
# -*- coding: utf-8 -*-
+25
View File
@@ -0,0 +1,25 @@
{
'name': 'Many2Many Quick Preview',
'author': 'Odoo Hub',
'category': 'Tools',
'summary': 'Provides quick preview of records in many2many_tags, many2many preview many2many clickable odoo record preview many2many field preview many2many field clickable many2many tags clickable many2many_tags clickable many2many_tags preview tags preview tags clickable clickable tag quick preview odoo many2many quick view instant record preview odoo related records preview many2many smart preview preview related records odoo many2many instant access many2many detail preview many2many inline preview quick access to records odoo productivity enhancement odoo preview without opening record preview on hover odoo ui enhancement many2many relation preview clickable many2many tags many2many record access preview in tags odoo improve navigation many2many quick detail view',
'description': """
Many2Many Quick Preview is an Odoo app that allows users to instantly preview related records in many2many fields directly from the many2many_tags.
This app improves navigation and productivity by providing quick access to record details without having to open them individually.
""",
'maintainer': 'Odoo Hub',
'website': 'https://apps.odoo.com/apps/modules/browse?author=Odoo%20Hub',
'version': '1.0',
'depends': ['base', 'web'],
'assets': {
'web.assets_backend': [
'many2many_quick_preview/static/src/js/many2many_tags_field.js',
],
},
'images': ['static/description/banner.png'],
'live_test_url': 'https://youtu.be/dNF106wVNX0',
'installable': True,
'application': True,
'auto_install': False,
'license': 'LGPL-3',
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

@@ -0,0 +1,221 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
</head>
<body>
<!-- App Overview Section -->
<section class="container py-5">
<div class="row justify-content-center">
<div class="col-lg-10 col-md-12 col-sm-12 text-center shadow rounded-3">
<h2 class="text-primary my-5">App Overview</h2>
<p class="bg-primary text-light rounded-3 p-4 lead">
The Many2Many Quick Preview app enhances your Odoo experience by allowing users to instantly preview
related records
from many2many fields directly within the many2many tags. This app streamlines navigation and boosts
productivity
by providing quick access to related records, eliminating the need to open them individually.
</p>
<div class="card mb-4 bg-info text-light rounded-3 overflow-hidden">
<div class="card-body px-md-5 px-2">
<h4 class="card-title text-primary text-start mb-4">Key Features:</h4>
<ul class="list-unstyled text-start">
<li class="d-flex align-items-center mb-3">
<i class="fa fa-check-circle text-primary fs-4 me-3"></i>
<span class="fs-5">Instantly preview related records in many2many fields without opening them</span>
</li>
<li class="d-flex align-items-center mb-3">
<i class="fa fa-check-circle text-primary fs-4 me-3"></i>
<span class="fs-5">Quick access to detailed record information directly from the many2many tags</span>
</li>
<li class="d-flex align-items-center mb-3">
<i class="fa fa-check-circle text-primary fs-4 me-3"></i>
<span class="fs-5">Boost productivity by reducing time spent switching between records</span>
</li>
<li class="d-flex align-items-center mb-3">
<i class="fa fa-check-circle text-primary fs-4 me-3"></i>
<span class="fs-5">Improves user experience with faster, more efficient navigation</span>
</li>
<li class="d-flex align-items-center mb-3">
<i class="fa fa-check-circle text-primary fs-4 me-3"></i>
<span class="fs-5">Seamlessly integrates into existing Odoo many2many fields and views</span>
</li>
</ul>
</div>
</div>
</div>
</div>
</section>
<!-- Watch Demo Section -->
<section class="container py-5">
<div class="row justify-content-center">
<div class="col-lg-10 col-sm-12 text-center shadow rounded-3">
<h2 class="text-primary my-5">Watch Demo</h2>
<p class="bg-primary text-light rounded-3 p-4 lead">
Check out our video for a detailed demonstration of how our Odoo apps work and how they can help you optimize your business.
</p>
<div class="card bg-info mb-4 text-light rounded-3 overflow-hidden">
<div class="card-body text-center position-relative">
<a href="https://youtu.be/dNF106wVNX0" target="_blank">
<img src="http://img.youtube.com/vi/dNF106wVNX0/mqdefault.jpg" class="img-fluid rounded" title="YouTube Video" alt="YouTube Video" />
<div class="play-button position-absolute top-50 start-50 translate-middle bg-dark bg-opacity-50 rounded-circle p-2">
<i class="fa fa-play-circle fa-3x text-light"></i>
</div>
</a>
</div>
</div>
</div>
</div>
</section>
<!-- Screenshots Section -->
<section class="container py-5">
<div class="row justify-content-center">
<div class="col-lg-10 text-center shadow rounded-3">
<h2 class="text-primary my-5">Screenshots</h2>
<p class="bg-primary text-light rounded-3 p-4 lead">
Explore how our app looks and functions! Here are some screenshots to give you a quick view of the
features.
</p>
<div class="row g-4 mb-4">
<div class="col-12">
<div class="card bg-primary text-light rounded-3 overflow-hidden">
<div class="card-header">Quick Preview</div>
<div class="card-body">
<img alt="Screenshot 1" class="img-fluid rounded" src="/many2many_quick_preview.gif">
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Our Service Section -->
<section class="container py-5">
<div class="row justify-content-center">
<div class="col-lg-10 col-md-12 col-sm-12 text-center shadow rounded-3">
<h2 class="text-primary my-5">Our Services</h2>
<p class="bg-primary text-light rounded-3 p-4 lead">
We offer a range of essential services designed to enhance your Odoo experience, including
customization, migration, and troubleshooting. Our goal is to ensure smooth integration and optimal
performance for your business.
</p>
<div class="row">
<div class="col-lg-4 col-md-6 mb-4">
<div class="card shadow-sm bg-info rounded-3 overflow-hidden h-100 d-flex flex-column">
<div class="card-body text-center d-flex flex-column">
<div class="mb-3">
<i class="fa fa-cogs text-primary fs-2"></i>
</div>
<h4 class="card-title text-primary">Customization</h4>
<p class="card-text flex-grow-1">
Tailor Odoo to meet your specific business needs with custom modules, workflows, and UI
adjustments.
We ensure that Odoo fits perfectly into your operations.
</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 mb-4">
<div class="card shadow-sm bg-info rounded-3 overflow-hidden h-100 d-flex flex-column">
<div class="card-body text-center d-flex flex-column">
<div class="mb-3">
<i class="fa fa-exchange text-primary fs-2"></i>
</div>
<h4 class="card-title text-primary">Migration</h4>
<p class="card-text flex-grow-1">
Upgrade your Odoo plugins from older versions to newer versions.
We ensure a smooth transition, preserving functionality and minimizing downtime.
</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 mb-4">
<div class="card shadow-sm bg-info rounded-3 overflow-hidden h-100 d-flex flex-column">
<div class="card-body text-center d-flex flex-column">
<div class="mb-3">
<i class="fa fa-bug text-primary fs-2"></i>
</div>
<h4 class="card-title text-primary">Troubleshooting</h4>
<p class="card-text flex-grow-1">
Encountering issues with your Odoo setup? Our troubleshooting service quickly identifies
and fixes
problems, ensuring minimal downtime and maximum productivity.
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- More Apps Section -->
<section class="container py-5">
<div class="row justify-content-center">
<div class="col-lg-10 col-sm-12 text-center shadow rounded-3">
<h2 class="text-primary my-5">Explore More Apps</h2>
<p class="bg-primary text-light rounded-3 p-4 lead">
Looking for more powerful tools to enhance your Odoo experience? Check out our complete collection of
apps
designed to help you get the most out of your Odoo environment.
</p>
<div class="card bg-info mb-4 text-light rounded-3 overflow-hidden">
<div class="card-body text-center">
<a class="btn btn-lg text-primary px-4"
href="https://apps.odoo.com/apps/modules/browse?author=Odoo%20Hub">
<i class="fa fa-cogs me-2"></i> Explore Our Apps
</a>
</div>
</div>
</div>
</div>
</section>
<!-- Help & Support Section -->
<section class="container py-5">
<div class="row justify-content-center">
<div class="col-lg-10 col-sm-12 text-center shadow rounded-3">
<h2 class="text-primary my-5">Help & Support</h2>
<p class="bg-primary text-light rounded-3 p-4 lead">
Having issues with the app? We offer <strong>free support</strong> to help with installation,
configuration, or any bugs you may encounter.
If you need further <strong>customizations</strong>, We are here to provide tailored solutions for your
needs.
</p>
<div class="card bg-info mb-4 text-light rounded-3 overflow-hidden">
<div class="card-body text-center">
<a class="btn btn-lg text-primary px-4" href="mailto:odoohubofficial@gmail.com">
<i class="fa fa-envelope me-2"></i> Email Us Now
</a>
</div>
</div>
</div>
</div>
</section>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 525 KiB

@@ -0,0 +1,45 @@
/** @odoo-module **/
import { Many2ManyTagsFieldColorEditable, Many2ManyTagsField } from "@web/views/fields/many2many_tags/many2many_tags_field";
import { patch } from "@web/core/utils/patch";
patch(Many2ManyTagsFieldColorEditable.prototype, {
setup() {
super.setup(...arguments);
},
onBadgeClick(ev, record) {
const onBadgeClick = super.onBadgeClick(ev, record);
var action = {
type: 'ir.actions.act_window',
res_model: record.resModel,
res_id: record.resId,
views: [[false, 'form']],
target: 'new',
};
this.env.model.action.doAction(action);
return onBadgeClick;
},
});
patch(Many2ManyTagsField.prototype, {
getTagProps(record) {
const props = super.getTagProps(record);
// 绑定点击事件(注意要接收 ev)
props.onClick = (ev) => this.onTagClick(ev, record);
return props;
},
onTagClick(ev, record) {
// 阻止默认的标签点击行为
ev.stopPropagation();
ev.preventDefault();
// 执行自定义动作
this.env.services.action.doAction({
type: "ir.actions.act_window",
name: record?.data?.display_name,
res_model: this.relation,
res_id: record.resId,
views: [[false, "form"]],
target: "current",
});
},
});