-
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] edi_voxel_account_invoice_oca: Migration to 17.0
- Loading branch information
1 parent
35f675b
commit ec4ab36
Showing
5 changed files
with
39 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
edi_voxel_account_invoice_oca/migrations/15.0.1.0.0/pre-migration.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
class TestVoxelAccountInvoice(TransactionCase): | ||
@classmethod | ||
def setUpClass(cls): | ||
super(TestVoxelAccountInvoice, cls).setUpClass() | ||
super().setUpClass() | ||
cls.env = cls.env( | ||
context=dict( | ||
cls.env.context, | ||
|
@@ -62,7 +62,7 @@ def setUpClass(cls): | |
) | ||
cls.env["product.customerinfo"].create( | ||
{ | ||
"name": partner.id, | ||
"partner_id": partner.id, | ||
"product_tmpl_id": product_1.product_tmpl_id.id, | ||
"product_id": product_1.id, | ||
"product_code": "1234567891234", | ||
|
@@ -74,14 +74,15 @@ def setUpClass(cls): | |
product_3 = product_obj.create( | ||
{"default_code": "DC_003", "name": "Product 3 (test)"} | ||
) | ||
|
||
tax_group_15 = cls.env["account.tax.group"].create({"name": "Tax 15%"}) | ||
tax_group_30 = cls.env["account.tax.group"].create({"name": "Tax 30%"}) | ||
tax_15 = cls.env["account.tax"].create( | ||
{ | ||
"name": "Tax 15%", | ||
"type_tax_use": "sale", | ||
"amount_type": "percent", | ||
"amount": 15, | ||
"tax_group_id": cls.env.ref("account.tax_group_taxes").id, | ||
"tax_group_id": tax_group_15.id, | ||
} | ||
) | ||
tax_30 = cls.env["account.tax"].create( | ||
|
@@ -90,13 +91,14 @@ def setUpClass(cls): | |
"type_tax_use": "sale", | ||
"amount_type": "percent", | ||
"amount": 30, | ||
"tax_group_id": cls.env.ref("account.tax_group_taxes").id, | ||
"tax_group_id": tax_group_30.id, | ||
} | ||
) | ||
# Invoice | ||
cls.invoice = cls.env["account.move"].create( | ||
{ | ||
"partner_id": partner.id, | ||
"partner_shipping_id": False, | ||
"move_type": "out_invoice", | ||
"currency_id": cls.main_company.currency_id.id, | ||
"invoice_date": date(2019, 4, 13), | ||
|
@@ -109,6 +111,7 @@ def setUpClass(cls): | |
"product_id": product_1.id, | ||
"quantity": 2, | ||
"price_unit": 750, | ||
"tax_ids": False, | ||
"name": "Product 1", | ||
"product_uom_id": cls.env.ref("uom.product_uom_unit").id, | ||
}, | ||
|
@@ -133,6 +136,7 @@ def setUpClass(cls): | |
"product_id": product_3.id, | ||
"quantity": 0, | ||
"price_unit": 0, | ||
"tax_ids": False, | ||
"name": "Product 3", | ||
"product_uom_id": product_3.uom_id.id, | ||
}, | ||
|
@@ -166,6 +170,7 @@ def test_get_report_values(self): | |
# Get expected data | ||
expected_report_data = self._get_invoice_data() | ||
# Check data | ||
self.maxDiff = None | ||
self.assertDictEqual(report_data, expected_report_data) | ||
|
||
def _get_invoice_data(self): | ||
|
@@ -218,7 +223,19 @@ def _get_client_data(self): | |
} | ||
|
||
def _get_customers_data(self): | ||
return [] | ||
return [ | ||
{ | ||
"SupplierClientID": "C01", | ||
"SupplierCustomerID": "C01", | ||
"Customer": "Client (test)", | ||
"Address": "Street 1, Street 2", | ||
"City": "City (test)", | ||
"PC": "10000", | ||
"Province": "West Virginia", | ||
"Country": "USA", | ||
"Email": "[email protected]", | ||
} | ||
] | ||
|
||
def _get_comments_data(self): | ||
return [] | ||
|
@@ -286,8 +303,4 @@ def _get_taxes_data(self): | |
] | ||
|
||
def _get_total_summary_data(self): | ||
return { | ||
"Tax": "158.76", | ||
"SubTotal": "1852.8", | ||
"Total": "2011.56", | ||
} | ||
return {"SubTotal": "1852.8", "Tax": "158.76", "Total": "2011.56"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters