Skip to content

Commit

Permalink
[MIG] partner_invoicing_mode_at_shipping: Migration to 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chaule97 committed Jan 3, 2025
1 parent 8fd1c0f commit 9521c07
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion partner_invoicing_mode_at_shipping/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Partner Invoicing Mode At Shipping",
"version": "17.0.1.0.0",
"version": "18.0.1.0.0",
"summary": "Create invoices automatically when goods are shipped.",
"author": "Camptocamp, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-invoicing",
Expand Down
6 changes: 3 additions & 3 deletions partner_invoicing_mode_at_shipping/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from odoo import _, api, fields, models
from odoo import api, fields, models
from odoo.exceptions import ValidationError


Expand Down Expand Up @@ -35,15 +35,15 @@ def _check_invoicing_mode_one_invoice_per_shipping(self):
and partner.one_invoice_per_shipping
):
raise ValidationError(
_(
self.env._(
"You cannot configure the partner %(partner)s with "
"Invoicing Mode 'At Shipping' and 'One Invoice Per Shipping'!",
partner=partner.name,
),
)
if partner.one_invoice_per_shipping and partner.one_invoice_per_order:
raise ValidationError(
_(
self.env._(
"You cannot configure the partner %(partner)s with "
"'One Invoice Per Order' and 'One Invoice Per Shipping'!",
partner=partner.name,
Expand Down
4 changes: 2 additions & 2 deletions partner_invoicing_mode_at_shipping/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models
from odoo import api, fields, models


class SaleOrder(models.Model):
Expand Down Expand Up @@ -35,7 +35,7 @@ def generate_invoices(
last_execution_field=last_execution_field,
)
# Validate the preceding generated invoices in draft mode.
description = _(
description = self.env._(
"Validate the invoices generated by shipping for the "
"invoicing mode %(invoicing_mode_name)s"
)
Expand Down
4 changes: 2 additions & 2 deletions partner_invoicing_mode_at_shipping/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)

from odoo import _, api, models
from odoo import api, models


class StockPicking(models.Model):
Expand Down Expand Up @@ -44,7 +44,7 @@ def _invoicing_at_shipping(self):
# The invoices per picking will use the invoicing_mode
for invoice in self._invoicing_at_shipping_validation(invoices):
invoice.with_delay()._validate_invoice()
return invoices or _("Nothing to invoice.")
return invoices or self.env._("Nothing to invoice.")

def _get_sales_order_to_invoice(self):
return self.move_ids.sale_line_id.order_id.filtered(
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# generated from manifests external_dependencies
openupgradelib

0 comments on commit 9521c07

Please sign in to comment.