Skip to content

Commit

Permalink
Merge pull request #1221 from OCA/15.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/product-attribute (15.0)
  • Loading branch information
bt-admin authored Jan 17, 2025
2 parents 990364b + 5cc5818 commit ff1bd27
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ addon | version | maintainers | summary
[product_pricelist_supplierinfo](product_pricelist_supplierinfo/) | 15.0.1.0.2 | | Allows to create priceslists based on supplier info
[product_profile](product_profile/) | 15.0.1.0.0 | [![bealdav](https://github.com/bealdav.png?size=30px)](https://github.com/bealdav) [![sebastienbeau](https://github.com/sebastienbeau.png?size=30px)](https://github.com/sebastienbeau) [![kevinkhao](https://github.com/kevinkhao.png?size=30px)](https://github.com/kevinkhao) | Allow to configure a product in 1 click
[product_restricted_type](product_restricted_type/) | 15.0.1.0.0 | | Product Restricted Type
[product_secondary_unit](product_secondary_unit/) | 15.0.2.0.5 | [![sergio-teruel](https://github.com/sergio-teruel.png?size=30px)](https://github.com/sergio-teruel) | Set a secondary unit per product
[product_secondary_unit](product_secondary_unit/) | 15.0.2.0.6 | [![sergio-teruel](https://github.com/sergio-teruel.png?size=30px)](https://github.com/sergio-teruel) | Set a secondary unit per product
[product_sequence](product_sequence/) | 15.0.2.1.1 | | Product Sequence
[product_state](product_state/) | 15.0.1.2.0 | [![emagdalenaC2i](https://github.com/emagdalenaC2i.png?size=30px)](https://github.com/emagdalenaC2i) | Module introducing a state field on product template
[product_status](product_status/) | 15.0.1.1.0 | | Product Status Computed From Fields
Expand Down
2 changes: 1 addition & 1 deletion product_secondary_unit/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Product Secondary Unit
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9b4b4156c031bd115e8baddb6e11e75a61da6b4a1eb34ae885bbdd4c30f7fb42
!! source digest: sha256:1db6af091ca90421849fee3322a7ee6a14700a57924664089ee09144738465e4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
Expand Down
2 changes: 1 addition & 1 deletion product_secondary_unit/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Product Secondary Unit",
"summary": "Set a secondary unit per product",
"version": "15.0.2.0.5",
"version": "15.0.2.0.6",
"development_status": "Production/Stable",
"category": "Product",
"website": "https://github.com/OCA/product-attribute",
Expand Down
5 changes: 5 additions & 0 deletions product_secondary_unit/models/product_secondary_unit_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def _get_secondary_uom_qty_depends(self):

@api.depends(lambda x: x._get_secondary_uom_qty_depends())
def _compute_secondary_uom_qty(self):
"""Compute the secondary qty field defined based on uom qty_field"""
for line in self:
if not line.secondary_uom_id:
line.secondary_uom_qty = 0.0
Expand All @@ -86,6 +87,10 @@ def _compute_secondary_uom_qty(self):
precision_rounding=line.secondary_uom_id.uom_id.rounding,
)
line.secondary_uom_qty = qty
# To avoid recompute uom qty_field when secondary_uom_qty changes.
self.env.remove_to_compute(
field=self._fields[self._secondary_unit_fields["qty_field"]], records=self
)

def _get_default_value_for_qty_field(self):
return self.default_get([self._secondary_unit_fields["qty_field"]]).get(
Expand Down
14 changes: 8 additions & 6 deletions product_secondary_unit/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand All @@ -9,10 +8,11 @@

/*
:Author: David Goodger ([email protected])
: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 @@ -275,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 @@ -301,7 +301,7 @@
span.pre {
white-space: pre }

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

span.section-subtitle {
Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Product Secondary Unit</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9b4b4156c031bd115e8baddb6e11e75a61da6b4a1eb34ae885bbdd4c30f7fb42
!! source digest: sha256:1db6af091ca90421849fee3322a7ee6a14700a57924664089ee09144738465e4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/product-attribute/tree/15.0/product_secondary_unit"><img alt="OCA/product-attribute" src="https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/product-attribute-15-0/product-attribute-15-0-product_secondary_unit"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of product module to allow define other units with their conversion factor.</p>
Expand Down Expand Up @@ -422,7 +422,9 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">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

0 comments on commit ff1bd27

Please sign in to comment.