Skip to content

Commit

Permalink
[MIG] edi_voxel_account_invoice_oca: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandoRomera committed Aug 7, 2024
1 parent 35f675b commit 136ddc3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 69 deletions.
2 changes: 1 addition & 1 deletion edi_voxel_account_invoice_oca/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Voxel account invoice oca",
"summary": "Sends account invoices to Voxel.",
"version": "15.0.1.0.2",
"version": "17.0.1.0.0",
"development_status": "Production/Stable",
"category": "Accounting & Finance",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down

This file was deleted.

15 changes: 10 additions & 5 deletions edi_voxel_account_invoice_oca/tests/test_voxel_account_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand All @@ -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(
Expand All @@ -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),
Expand All @@ -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,
},
Expand All @@ -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,
},
Expand Down Expand Up @@ -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):
Expand Down
37 changes: 13 additions & 24 deletions edi_voxel_account_invoice_oca/views/account_move_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,29 @@
<field name="name">account.move.form.inherit</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form" />
<field
name="groups_id"
eval="[(4, ref('edi_voxel_oca.group_voxel_manager'))]"
/>
<field name="arch" type="xml">
<header position="inside">
<button
name="action_send_to_voxel"
type="object"
string="Send to Voxel"
attrs="{'invisible': [
'|',
('move_type', 'not in', ['out_invoice', 'out_refund']),
('state', '!=', 'posted'),
]}"
invisible="move_type not in ['out_invoice', 'out_refund'] or state != 'posted'"
/>
</header>
<notebook position="inside">
<field name="voxel_enabled" invisible="1" />
<page
string="Voxel"
attrs="{'invisible': [('voxel_enabled', '!=', True)]}"
invisible="not voxel_enabled"
groups="edi_voxel_oca.group_voxel_manager"
>
<group>
<field name="voxel_state" />
</group>
<group
name="group_voxel_processing_error"
colspan="8"
attrs="{'invisible': [('processing_error', '=', False)]}"
invisible="not processing_error"
>
<field name="processing_error" />
</group>
Expand All @@ -56,23 +49,23 @@
name="voxel_requeue_sudo"
string="Requeue"
class="oe_highlight"
attrs="{'invisible': [('state', '!=', 'failed')]}"
invisible="state != 'failed'"
/>
<button
type="object"
name="voxel_cancel_now"
string="Cancel sending"
class="oe_highlight_cancel"
icon="fa-times-circle"
attrs="{'invisible': [('state', 'not in', ['pending','enqueued'])]}"
invisible="state not in ['pending','enqueued']"
/>
<button
type="object"
name="voxel_do_now"
string="Send now"
class="oe_highlight"
icon="fa-fighter-jet"
attrs="{'invisible': ['|', ('state', '!=', 'pending'), ('eta', '=', False)]}"
invisible="state != 'pending' or (not eta)"
/>
</tree>
</field>
Expand All @@ -81,13 +74,10 @@
<page
string="Voxel XML report"
name="page_voxel_report"
attrs="{'invisible': [('voxel_xml_report', '=', False)]}"
invisible="not voxel_xml_report"
>
<group name="group_voxel_report">
<group
colspan="8"
attrs="{'invisible': [('voxel_filename', '=', False)]}"
>
<group colspan="8" invisible="not voxel_filename">
<field name="voxel_filename" />
</group>
<group colspan="8">
Expand All @@ -109,13 +99,12 @@
<field name="name">account.invoice.select.inherit</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_account_invoice_filter" />
<field
name="groups_id"
eval="[(4, ref('edi_voxel_oca.group_voxel_manager'))]"
/>
<field name="arch" type="xml">
<filter name="late" position="before">
<group string="Voxel filters">
<group
string="Voxel filters"
groups="edi_voxel_oca.group_voxel_manager"
>
<separator />
<filter
name="voxel_not_sent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
<field name="name">res.config.settings.view.form.voxel.invoice</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="edi_voxel_oca.res_config_settings_view_form" />
<field
name="groups_id"
eval="[(4, ref('edi_voxel_oca.group_voxel_manager'))]"
/>
<field name="arch" type="xml">
<xpath expr="//div[@name='voxel_login_config']" position="inside">
<div class="row mt16">
<div class="row mt16" groups="edi_voxel_oca.group_voxel_manager">
<label
for="voxel_invoice_login_id"
class="col-lg-3 o_light_label"
Expand Down

0 comments on commit 136ddc3

Please sign in to comment.