[PATCH] Upstream patch - 28012022

This commit is contained in:
Parthiv Patel
2022-01-28 14:24:00 +00:00
parent f882f983ab
commit abc96c91ca
44 changed files with 1170 additions and 345 deletions
+1 -1
View File
@@ -718,7 +718,7 @@ class ProductPackaging(models.Model):
name = fields.Char('Package Type', required=True)
sequence = fields.Integer('Sequence', default=1, help="The first in the sequence is the default one.")
product_id = fields.Many2one('product.product', string='Product', check_company=True)
qty = fields.Float('Contained Quantity', help="Quantity of products contained in the packaging.")
qty = fields.Float('Contained Quantity', digits='Product Unit of Measure', help="Quantity of products contained in the packaging.")
barcode = fields.Char('Barcode', copy=False, help="Barcode used for packaging identification. Scan this packaging barcode from a transfer in the Barcode app to move all the contained units")
product_uom_id = fields.Many2one('uom.uom', related='product_id.uom_id', readonly=True)
company_id = fields.Many2one('res.company', 'Company', index=True)
+3 -1
View File
@@ -518,7 +518,9 @@ class ProductTemplateAttributeValue(models.Model):
def _get_combination_name(self):
"""Exclude values from single value lines or from no_variant attributes."""
return ", ".join([ptav.name for ptav in self._without_no_variant_attributes()._filter_single_value_lines()])
ptavs = self._without_no_variant_attributes().with_prefetch(self._prefetch_ids)
ptavs = ptavs._filter_single_value_lines().with_prefetch(self._prefetch_ids)
return ", ".join([ptav.name for ptav in ptavs])
def _filter_single_value_lines(self):
"""Return `self` with values from single value lines filtered out
+2 -19
View File
@@ -5,8 +5,7 @@ from itertools import chain
from flectra import api, fields, models, tools, _
from flectra.exceptions import UserError, ValidationError
from flectra.tools import float_repr
from flectra.tools.misc import get_lang
from flectra.tools.misc import formatLang, get_lang
class Pricelist(models.Model):
@@ -486,23 +485,7 @@ class PricelistItem(models.Model):
item.name = _("All Products")
if item.compute_price == 'fixed':
decimal_places = self.env['decimal.precision'].precision_get('Product Price')
if item.currency_id.position == 'after':
item.price = "%s %s" % (
float_repr(
item.fixed_price,
decimal_places,
),
item.currency_id.symbol,
)
else:
item.price = "%s %s" % (
item.currency_id.symbol,
float_repr(
item.fixed_price,
decimal_places,
),
)
item.price = formatLang(item.env, item.fixed_price, monetary=True, dp="Product Price", currency_obj=item.currency_id)
elif item.compute_price == 'percentage':
item.price = _("%s %% discount", item.percent_price)
else:
+1
View File
@@ -12,6 +12,7 @@ class Partner(models.Model):
property_product_pricelist = fields.Many2one(
'product.pricelist', 'Pricelist', compute='_compute_product_pricelist',
inverse="_inverse_product_pricelist", company_dependent=False,
domain=lambda self: [('company_id', 'in', (self.env.company.id, False))],
help="This pricelist will be used, instead of the default one, for sales to the current partner")
@api.depends('country_id')