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:', 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 @@