Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: OCA/edi
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c50362f43fa8c145115bf2ad6fe8d1e390fda71c
Choose a base ref
..
head repository: OCA/edi
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 35b9e096bfe04d6cf3927aefff62993af8f38a7b
Choose a head ref
Showing with 10 additions and 13 deletions.
  1. +10 −13 edi_account/tests/test_edi.py
23 changes: 10 additions & 13 deletions edi_account/tests/test_edi.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

import logging
import datetime
from datetime import datetime

from odoo import fields

@@ -17,16 +17,19 @@ class EDIBackendTestCase(TestAccountNoChartCommon, SavepointComponentRegistryCas
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.setUpAdditionalAccounts()
cls.setUpAccountJournal()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.cash_journal = cls.env["account.journal"].search(
[("type", "=", "cash"), ("company_id", "=", cls.company.id)]
[("type", "=", "cash"), ("company_id", "=", cls.env.user.company_id.id)]
)[0]
cls.journal_sale.update_posted = True

class AccountInvoiceEventListenerDemo(Component):
_name = "account.invoice.event.listener.demo"
_inherit = "base.event.listener"

def on_post_account_invoice(self, invoice):
def on_open_account_invoice(self, invoice):
invoice.name = "new_name"

def on_paid_account_invoice(self, invoice):
@@ -42,17 +45,16 @@ def on_cancel_account_invoice(self, invoice):
.with_context(components_registry=cls.comp_registry)
.create(
{
"partner_id": cls.partner_a.id,
"partner_id": cls.partner_customer_usd.id,
"date_invoice": fields.Date.from_string("2016-01-01"),
"journal_id": cls.journal_sale.id,
"invoice_line_ids": [
(
0,
None,
{
"name": "revenue line 1",
"account_id": cls.company_data[
"default_account_revenue"
].id,
"account_id": cls.account_revenue.id,
"quantity": 1.0,
"price_unit": 100.0,
},
@@ -62,14 +64,9 @@ def on_cancel_account_invoice(self, invoice):
None,
{
"name": "revenue line 2",
"account_id": cls.company_data[
"default_account_revenue"
].id,
"account_id": cls.account_revenue.id,
"quantity": 1.0,
"price_unit": 100.0,
"tax_ids": [
(6, 0, cls.company_data["default_tax_sale"].ids)
],
},
),
],