diff --git a/addons/account/wizard/account_automatic_entry_wizard.py b/addons/account/wizard/account_automatic_entry_wizard.py
index 1f9446a109..3ceb63c721 100644
--- a/addons/account/wizard/account_automatic_entry_wizard.py
+++ b/addons/account/wizard/account_automatic_entry_wizard.py
@@ -334,7 +334,7 @@ class AutomaticEntryWizard(models.TransientModel):
destination_move_offset += 2
accrual_move_lines = accrual_move.mapped('line_ids').filtered(lambda line: line.account_id == accrual_account)[accrual_move_offsets[accrual_move]:accrual_move_offsets[accrual_move]+2]
accrual_move_offsets[accrual_move] += 2
- (accrual_move_lines + destination_move_lines).reconcile()
+ (accrual_move_lines + destination_move_lines).filtered(lambda line: not line.currency_id.is_zero(line.balance)).reconcile()
move.message_post(body=self._format_strings(_('Adjusting Entries have been created for this invoice:
- %(link1)s cancelling '
'{percent:.2f}%% of {amount}
- %(link0)s postponing it to {new_date}
',
link0=self._format_move_link(destination_move),
diff --git a/addons/google_drive/models/google_drive.py b/addons/google_drive/models/google_drive.py
index 69745363dd..9ed72ded50 100644
--- a/addons/google_drive/models/google_drive.py
+++ b/addons/google_drive/models/google_drive.py
@@ -31,7 +31,7 @@ class GoogleDrive(models.Model):
_description = "Google Drive templates config"
def _module_deprecated(self):
- return GOOGLE_AUTH_DEPRECATION_DATE > fields.Date.today()
+ return GOOGLE_AUTH_DEPRECATION_DATE < fields.Date.today()
def get_google_drive_url(self, res_id, template_id):
if self._module_deprecated():
diff --git a/addons/l10n_de_sale/models/sale.py b/addons/l10n_de_sale/models/sale.py
index 6784962262..104e8b3123 100644
--- a/addons/l10n_de_sale/models/sale.py
+++ b/addons/l10n_de_sale/models/sale.py
@@ -33,7 +33,9 @@ class SaleOrder(models.Model):
def _compute_l10n_de_document_title(self):
for record in self:
- if record.state in ('draft', 'sent'):
+ if self._context.get('proforma'):
+ record.l10n_de_document_title = _('Pro Forma Invoice')
+ elif record.state in ('draft', 'sent'):
record.l10n_de_document_title = _('Quotation')
else:
record.l10n_de_document_title = _('Sales Order')
diff --git a/addons/l10n_it_edi/models/account_edi_format.py b/addons/l10n_it_edi/models/account_edi_format.py
index 285a3aa3e1..0e8e7a3284 100644
--- a/addons/l10n_it_edi/models/account_edi_format.py
+++ b/addons/l10n_it_edi/models/account_edi_format.py
@@ -723,6 +723,8 @@ class AccountEdiFormat(models.Model):
'name': name_attachment,
'datas': attachment_64,
'type': 'binary',
+ 'res_model': 'account.move',
+ 'res_id': new_invoice.id,
})
# default_res_id is had to context to avoid facturx to import his content
diff --git a/addons/product/models/product_pricelist.py b/addons/product/models/product_pricelist.py
index 2496681efa..998c49adee 100644
--- a/addons/product/models/product_pricelist.py
+++ b/addons/product/models/product_pricelist.py
@@ -93,7 +93,7 @@ class Pricelist(models.Model):
def _compute_price_rule_get_items(self, products_qty_partner, date, uom_id, prod_tmpl_ids, prod_ids, categ_ids):
self.ensure_one()
# Load all rules
- self.env['product.pricelist.item'].flush(['price', 'currency_id', 'company_id'])
+ self.env['product.pricelist.item'].flush(['price', 'currency_id', 'company_id', 'active'])
self.env.cr.execute(
"""
SELECT
@@ -108,6 +108,7 @@ class Pricelist(models.Model):
AND (item.pricelist_id = %s)
AND (item.date_start IS NULL OR item.date_start<=%s)
AND (item.date_end IS NULL OR item.date_end>=%s)
+ AND (item.active = TRUE)
ORDER BY
item.applied_on, item.min_quantity desc, categ.complete_name desc, item.id desc
""",
@@ -573,6 +574,9 @@ class PricelistItem(models.Model):
self.env['product.product'].invalidate_cache(['price'])
return res
+ def toggle_active(self):
+ raise ValidationError(_("You cannot disable a pricelist rule, please delete it or archive its pricelist instead."))
+
def _compute_price(self, price, price_uom, product, quantity=1.0, partner=False):
"""Compute the unit price of a product in the context of a pricelist application.
The unused parameters are there to make the full context available for overrides.
diff --git a/addons/sale/report/sale_report_templates.xml b/addons/sale/report/sale_report_templates.xml
index 660629af13..17a2f84069 100644
--- a/addons/sale/report/sale_report_templates.xml
+++ b/addons/sale/report/sale_report_templates.xml
@@ -221,6 +221,7 @@
+
diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py
index 54663f53ff..6cf0e8b887 100644
--- a/addons/stock/models/product.py
+++ b/addons/stock/models/product.py
@@ -224,7 +224,7 @@ class Product(models.Model):
if isinstance(item, int):
ids.add(item)
else:
- domain = expression.OR([[('name', 'ilike', item)], domain])
+ domain = expression.OR([[(self.env[model]._rec_name, 'ilike', item)], domain])
if domain:
ids |= set(self.env[model].search(domain).ids)
return ids
diff --git a/addons/stock/models/stock_orderpoint.py b/addons/stock/models/stock_orderpoint.py
index 16a352d4af..734d8bcae7 100644
--- a/addons/stock/models/stock_orderpoint.py
+++ b/addons/stock/models/stock_orderpoint.py
@@ -378,7 +378,7 @@ class StockWarehouseOrderpoint(models.Model):
to_refill = {k: v for k, v in to_refill.items() if float_compare(
v, 0.0, precision_digits=rounding) < 0.0}
- lot_stock_id_by_warehouse = self.env['stock.warehouse'].search_read([
+ lot_stock_id_by_warehouse = self.env['stock.warehouse'].with_context(active_test=False).search_read([
('id', 'in', [g[1] for g in to_refill.keys()])
], ['lot_stock_id'])
lot_stock_id_by_warehouse = {w['id']: w['lot_stock_id'][0] for w in lot_stock_id_by_warehouse}
diff --git a/addons/website_sale_stock/models/sale_order.py b/addons/website_sale_stock/models/sale_order.py
index 0b0292b35c..0451b86c85 100644
--- a/addons/website_sale_stock/models/sale_order.py
+++ b/addons/website_sale_stock/models/sale_order.py
@@ -12,8 +12,11 @@ class SaleOrder(models.Model):
def _cart_update(self, product_id=None, line_id=None, add_qty=0, set_qty=0, **kwargs):
values = super(SaleOrder, self)._cart_update(product_id, line_id, add_qty, set_qty, **kwargs)
- line_id = values.get('line_id')
+ values = self._cart_lines_stock_update(values, **kwargs)
+ return values
+ def _cart_lines_stock_update(self, values, **kwargs):
+ line_id = values.get('line_id')
for line in self.order_line:
if line.product_id.type == 'product' and line.product_id.inventory_availability in ['always', 'threshold']:
cart_qty = sum(self.order_line.filtered(lambda p: p.product_id.id == line.product_id.id).mapped('product_uom_qty'))