Skip to content

Commit

Permalink
Merge PR #1679 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by legalsylvain
  • Loading branch information
OCA-git-bot committed Jul 8, 2024
2 parents 0212ec6 + cb4b852 commit 8f70858
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 6 deletions.
1 change: 1 addition & 0 deletions product_pricelist_direct_print/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Contributors
* `Trobz <https://trobz.com/>`_:

* Tris Doan
* Chau Le

Maintainers
~~~~~~~~~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 16.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-07-04 10:18+0000\n"
"PO-Revision-Date: 2024-07-04 10:18+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -256,6 +258,11 @@ msgstr ""
msgid "Print Price List"
msgstr ""

#. module: product_pricelist_direct_print
#: model:ir.model.fields,field_description:product_pricelist_direct_print.field_product_pricelist_print__print_child_categories
msgid "Print child categories"
msgstr ""

#. module: product_pricelist_direct_print
#: model_terms:ir.ui.view,arch_db:product_pricelist_direct_print.view_product_pricelist_print
msgid "Product Options"
Expand Down
1 change: 1 addition & 0 deletions product_pricelist_direct_print/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
* `Trobz <https://trobz.com/>`_:

* Tris Doan
* Chau Le
12 changes: 8 additions & 4 deletions product_pricelist_direct_print/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 @@ -488,14 +489,17 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
</li>
<li><a class="reference external" href="https://trobz.com/">Trobz</a>:<ul>
<li>Tris Doan</li>
<li>Chau Le</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">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
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class ProductPricelistPrint(models.TransientModel):
" the last X ordered products will be obtained for the report."
)
summary = fields.Text()
print_child_categories = fields.Boolean()
max_categ_level = fields.Integer(
string="Max category level",
help="If this field is not 0, products are grouped at max level "
Expand All @@ -77,6 +78,10 @@ class ProductPricelistPrint(models.TransientModel):

product_price = fields.Float(compute="_compute_product_price")

@api.onchange("categ_ids")
def _onchange_categ_ids(self):
self.print_child_categories = len(self.categ_ids) > 0

@api.depends_context("product")
def _compute_product_price(self):
product = self.env.context["product"]
Expand Down Expand Up @@ -331,7 +336,11 @@ def get_products_domain(self):
]
)
domain = expression.AND([domain, aux_domain])
if self.categ_ids:
if self.print_child_categories:
domain = expression.AND(
[domain, [("categ_id", "child_of", self.categ_ids.ids)]]
)
elif self.categ_ids:
domain = expression.AND([domain, [("categ_id", "in", self.categ_ids.ids)]])
return domain

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
widget="many2many_tags"
attrs="{'invisible':['|',('product_tmpl_ids','!=',[]), ('product_ids','!=',[])]}"
/>
<field
name="print_child_categories"
attrs="{'invisible':[('categ_ids','=',[])]}"
/>
<field name="show_only_defined_products" />
<field
name="show_variants"
Expand Down

0 comments on commit 8f70858

Please sign in to comment.