Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package trytond_product for openSUSE:Factory 
checked in at 2026-06-12 19:27:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/trytond_product (Old)
 and      /work/SRC/openSUSE:Factory/.trytond_product.new.1981 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "trytond_product"

Fri Jun 12 19:27:47 2026 rev:19 rq:1358799 version:7.0.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/trytond_product/trytond_product.changes  
2026-02-05 18:06:48.299728097 +0100
+++ 
/work/SRC/openSUSE:Factory/.trytond_product.new.1981/trytond_product.changes    
    2026-06-12 19:28:47.197359509 +0200
@@ -1,0 +2,5 @@
+Fri Jun 12 00:25:35 UTC 2026 - Axel Braun <[email protected]>
+
+- Version 7.0.5 - Bugfix Release
+
+-------------------------------------------------------------------

Old:
----
  trytond_product-7.0.4.tar.gz

New:
----
  trytond_product-7.0.5.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ trytond_product.spec ++++++
--- /var/tmp/diff_new_pack.R50I6l/_old  2026-06-12 19:28:48.185400851 +0200
+++ /var/tmp/diff_new_pack.R50I6l/_new  2026-06-12 19:28:48.185400851 +0200
@@ -29,7 +29,7 @@
 
 %define majorver 7.0
 Name:           trytond_product
-Version:        %{majorver}.4
+Version:        %{majorver}.5
 Release:        0
 Summary:        The "product" module for the Tryton ERP system
 License:        GPL-3.0-only

++++++ trytond_product-7.0.4.tar.gz -> trytond_product-7.0.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/trytond_product-7.0.4/CHANGELOG 
new/trytond_product-7.0.5/CHANGELOG
--- old/trytond_product-7.0.4/CHANGELOG 2026-02-01 11:23:36.000000000 +0100
+++ new/trytond_product-7.0.5/CHANGELOG 2026-04-16 23:17:51.000000000 +0200
@@ -1,4 +1,9 @@
 
+Version 7.0.5 - 2026-04-16
+--------------------------
+* Bug fixes (see mercurial logs for details)
+
+
 Version 7.0.4 - 2026-02-01
 --------------------------
 * Bug fixes (see mercurial logs for details)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/trytond_product-7.0.4/PKG-INFO 
new/trytond_product-7.0.5/PKG-INFO
--- old/trytond_product-7.0.4/PKG-INFO  2026-02-01 11:23:39.465370200 +0100
+++ new/trytond_product-7.0.5/PKG-INFO  2026-04-16 23:17:54.849662000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: trytond_product
-Version: 7.0.4
+Version: 7.0.5
 Summary: Tryton module with products
 Home-page: http://www.tryton.org/
 Download-URL: http://downloads.tryton.org/7.0/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/trytond_product-7.0.4/__init__.py 
new/trytond_product-7.0.5/__init__.py
--- old/trytond_product-7.0.4/__init__.py       2025-09-22 21:34:39.000000000 
+0200
+++ new/trytond_product-7.0.5/__init__.py       2026-04-14 20:36:57.000000000 
+0200
@@ -4,10 +4,12 @@
 from trytond.pool import Pool
 
 from . import category, configuration, ir, product, uom
-from .product import price_digits, round_price
+from .product import (
+    copy_product_filtered, copy_template_filtered, price_digits, round_price)
 from .uom import uom_conversion_digits
 
-__all__ = [price_digits, round_price, uom_conversion_digits]
+__all__ = [price_digits, round_price, uom_conversion_digits,
+    copy_template_filtered, copy_product_filtered]
 
 
 def register():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/trytond_product-7.0.4/product.py 
new/trytond_product-7.0.5/product.py
--- old/trytond_product-7.0.4/product.py        2025-09-22 21:34:39.000000000 
+0200
+++ new/trytond_product-7.0.5/product.py        2026-04-15 00:46:14.000000000 
+0200
@@ -30,7 +30,9 @@
 from .exceptions import InvalidIdentifierCode
 from .ir import price_decimal
 
-__all__ = ['price_digits', 'round_price', 'TemplateFunction']
+__all__ = [
+    'price_digits', 'round_price', 'TemplateFunction',
+    'copy_template_filtered', 'copy_product_filtered']
 logger = logging.getLogger(__name__)
 
 TYPES = [
@@ -54,6 +56,72 @@
         Decimal(1) / 10 ** price_digits[1], rounding=rounding)
 
 
+def copy_template_filtered(
+        field_name, template_name='template', product_name='product'):
+    class TemplateCopyFiltered:
+        __slots__ = ()
+
+        @classmethod
+        def copy(cls, templates, default=None):
+            Target = getattr(cls, field_name).get_target()
+            assert (getattr(Target, template_name).model_name
+                == 'product.template')
+            assert (getattr(Target, product_name).model_name
+                == 'product.product')
+            default = default.copy() if default is not None else {}
+            copy_field = field_name not in default
+            default.setdefault(field_name)
+            new_templates = super().copy(templates, default=default)
+            if copy_field:
+                old2new, to_copy = {}, []
+                for template, new_template in zip(templates, new_templates):
+                    to_copy.extend(
+                        l for l in getattr(template, field_name)
+                        if not getattr(l, product_name))
+                    old2new[template.id] = new_template.id
+                if to_copy:
+                    Target.copy(to_copy, {
+                            template_name: lambda d: old2new[d[template_name]],
+                            })
+            return new_templates
+    return TemplateCopyFiltered
+
+
+def copy_product_filtered(
+        field_name, template_name='template', product_name='product'):
+    class ProductCopyFiltered:
+        __slots__ = ()
+
+        @classmethod
+        def copy(cls, products, default=None):
+            Target = getattr(cls, field_name).get_target()
+            assert (getattr(Target, template_name).model_name
+                == 'product.template')
+            assert (getattr(Target, product_name).model_name
+                == 'product.product')
+            default = default.copy() if default is not None else {}
+            copy_field = field_name not in default
+            default.setdefault(field_name)
+            new_products = super().copy(products, default=default)
+            if copy_field:
+                template2new, product2new, to_copy = {}, {}, []
+                for product, new_product in zip(products, new_products):
+                    if targets := getattr(product, field_name):
+                        to_copy.extend(targets)
+                        template2new[product.template.id] = (
+                            new_product.template.id)
+                        product2new[product.id] = new_product.id
+                if to_copy:
+                    Target.copy(to_copy, {
+                            product_name: lambda d: product2new[
+                                d[product_name]],
+                            template_name: lambda d: template2new[
+                                d[template_name]],
+                            })
+            return new_products
+    return ProductCopyFiltered
+
+
 class Template(
         DeactivableMixin, ModelSQL, ModelView, CompanyMultiValueMixin):
     "Product Template"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/trytond_product-7.0.4/tryton.cfg 
new/trytond_product-7.0.5/tryton.cfg
--- old/trytond_product-7.0.4/tryton.cfg        2025-09-22 21:34:39.000000000 
+0200
+++ new/trytond_product-7.0.5/tryton.cfg        2026-02-01 11:23:45.000000000 
+0100
@@ -1,5 +1,5 @@
 [tryton]
-version=7.0.4
+version=7.0.5
 depends:
     company
     ir
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/trytond_product-7.0.4/trytond_product.egg-info/PKG-INFO 
new/trytond_product-7.0.5/trytond_product.egg-info/PKG-INFO
--- old/trytond_product-7.0.4/trytond_product.egg-info/PKG-INFO 2026-02-01 
11:23:38.000000000 +0100
+++ new/trytond_product-7.0.5/trytond_product.egg-info/PKG-INFO 2026-04-16 
23:17:54.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.4
 Name: trytond_product
-Version: 7.0.4
+Version: 7.0.5
 Summary: Tryton module with products
 Home-page: http://www.tryton.org/
 Download-URL: http://downloads.tryton.org/7.0/

Reply via email to