Skip to content

Commit

Permalink
[MIG] purchase_invoice_plan_retention: Migration to 15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Saran440 committed Sep 26, 2023
1 parent 6153575 commit 4721ed2
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion purchase_invoice_plan_retention/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Copyright 2021 Ecosoft Co., Ltd (http://ecosoft.co.th/)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)

from . import models
2 changes: 1 addition & 1 deletion purchase_invoice_plan_retention/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Purchase Invoice Plan - Retention",
"summary": "Add to purchase invoice plan, the retention on each invoice",
"version": "14.0.1.0.0",
"version": "15.0.1.0.0",
"author": "Ecosoft,Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/purchase-workflow",
Expand Down
1 change: 0 additions & 1 deletion purchase_invoice_plan_retention/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Copyright 2021 Ecosoft Co., Ltd (http://ecosoft.co.th/)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)

from . import purchase
1 change: 0 additions & 1 deletion purchase_invoice_plan_retention/models/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class PurchaseOrder(models.Model):

payment_retention = fields.Selection(
selection=[("percent", "Percent"), ("amount", "Amount")],
string="Payment Retention",
readonly=False,
copy=False,
help="For each invoice installment, suggested retention amount "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_invoice_plan(self):
with Form(self.PurchaseInvoicePlan) as p:
p.num_installment = 5
purchase_plan = p.save()
purchase_plan.with_context(ctx).purchase_create_invoice_plan()
purchase_plan.with_context(**ctx).purchase_create_invoice_plan()
# Change plan, so that the 1st installment is 1000 and 5th is 3000
self.assertEqual(len(self.test_po_product.invoice_plan_ids), 5)
self.test_po_product.payment_retention = "amount"
Expand All @@ -38,7 +38,7 @@ def test_invoice_plan(self):
receive.move_ids_without_package.quantity_done = 10.0
receive._action_done()
purchase_create = self.env["purchase.make.planned.invoice"].create({})
purchase_create.with_context(ctx).create_invoices_by_plan()
purchase_create.with_context(**ctx).create_invoices_by_plan()
self.assertEqual(
self.test_po_product.amount_total,
sum(self.test_po_product.invoice_ids.mapped("amount_total")),
Expand Down

0 comments on commit 4721ed2

Please sign in to comment.