Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][IMP] fs_product_multi_image: Replace tree view with kanban view #408

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions fs_product_multi_image/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"views/product_product.xml",
"views/product_template.xml",
],
"assets": {
"web.assets_backend": [
"fs_product_multi_image/static/src/scss/fs_product_image.scss",
]
},
"demo": [],
"maintainers": ["lmignon"],
"development_status": "Alpha",
Expand Down
11 changes: 7 additions & 4 deletions fs_product_multi_image/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.

See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -274,7 +275,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: grey; } /* line numbers */
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -456,7 +457,9 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
Expand Down
3 changes: 3 additions & 0 deletions fs_product_multi_image/static/src/scss/fs_product_image.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.o_image_fs {
max-width: 128px;
}
26 changes: 17 additions & 9 deletions fs_product_multi_image/views/product_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,25 @@
nolabel="1"
colspan="2"
>
<tree>
<field name="sequence" widget="handle" />
<field name="name" />
</tree>
<kanban>
<field name="name" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you manage sequence now? Do we really need to always display the images? If you take a look at the code in version 16, a new widget has been developped with a lot of usefull functionnality. We should forward port #332 instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right

<templates>
<t t-name="kanban-box">
<div
class="oe_kanban_content o_kanban_grouped oe_kanban_global_click"
>
<img
t-att-src="kanban_image('fs.product.image', 'image_medium', record.id.raw_value)"
alt="Image"
class="o_image_fs me-2"
/>
<field name="name" />
</div>
</t>
</templates>
</kanban>
</field>
</group>
<!-- field
name="image_ids"
mode="kanban"
widget="storage_image_handle"
/ -->
</group>
</page>
</page>
Expand Down
Loading