Skip to content

Commit

Permalink
[MIG] l10n_es_pos: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
peluko00 committed Apr 23, 2024
1 parent 8ef38d7 commit 019cde4
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 49 deletions.
4 changes: 4 additions & 0 deletions l10n_es_pos/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ Contributors

- Daniel Duque <daniel.duque@factorlibre.com>

- `APSL <https://apsl.tech>`__:

- Antoni Marroig <amarroig@apsl.net>

Maintainers
-----------

Expand Down
2 changes: 1 addition & 1 deletion l10n_es_pos/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-spain",
"license": "AGPL-3",
"version": "16.0.1.0.2",
"version": "17.0.1.0.0",
"depends": ["point_of_sale"],
"data": ["views/pos_views.xml", "views/res_config_settings_views.xml"],
"assets": {
Expand Down
8 changes: 2 additions & 6 deletions l10n_es_pos/hooks.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# Copyright 2018 David Vidal <david.vidal@tecnativa.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import SUPERUSER_ID, api


def post_init_hook(cr, registry, vals=None):
def post_init_hook(env, vals=None):
"""For brand new installations"""
env = api.Environment(cr, SUPERUSER_ID, {})
IrSequence = env["ir.sequence"]
pos_config = env["pos.config"].search(
[("l10n_es_simplified_invoice_sequence_id", "=", False)]
Expand Down Expand Up @@ -47,6 +44,5 @@ def post_init_hook(cr, registry, vals=None):
)


def uninstall_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
def uninstall_hook(env):
env["ir.sequence"].search([("code", "=", "pos.config.simplified_invoice")]).unlink()
2 changes: 2 additions & 0 deletions l10n_es_pos/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
- Manuel Regidor
- [Factor Libre](https://factorlibre.com/):
- Daniel Duque \<<daniel.duque@factorlibre.com>\>
- [APSL](https://apsl.tech):
- Antoni Marroig \<<amarroig@apsl.net>\>
4 changes: 4 additions & 0 deletions l10n_es_pos/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<li>Daniel Duque &lt;<a class="reference external" href="mailto:daniel.duque&#64;factorlibre.com">daniel.duque&#64;factorlibre.com</a>&gt;</li>
</ul>
</li>
<li><a class="reference external" href="https://apsl.tech">APSL</a>:<ul>
<li>Antoni Marroig &lt;<a class="reference external" href="mailto:amarroig&#64;apsl.net">amarroig&#64;apsl.net</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
t-name="TicketScreen"
t-inherit="point_of_sale.TicketScreen"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//div[hasclass('header-row')]/div[2]" position="after">
<div class="col wide">Simplified Invoice</div>
Expand Down
1 change: 0 additions & 1 deletion l10n_es_pos/static/src/xml/pos.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
t-name="OrderReceipt"
t-inherit="point_of_sale.OrderReceipt"
t-inherit-mode="extension"
owl="1"
>
<xpath expr="//t[@t-if='receipt.company.contact_address']" position="before">
<t t-if="env.pos.config.is_simplified_config and !receipt.to_invoice">
Expand Down
65 changes: 25 additions & 40 deletions l10n_es_pos/views/res_config_settings_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,55 +5,40 @@
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="point_of_sale.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@id='pos_accounting_section']" position="inside">
<div class="col-12 col-lg-6 o_setting_box" id="l10n_es_pos_simp_seq">
<div class="o_setting_left_pane">
<field name="pos_iface_l10n_es_simplified_invoice" />
</div>
<div class="o_setting_right_pane">
<label
for="pos_l10n_es_simplified_invoice_sequence_id"
string="Simplified Invoice Sequence"
/>
<div class="text-muted">
Set simplified invoice sequence for this POS
</div>
<div class="content-group mt16" groups="base.group_no_one">
<field name="pos_l10n_es_simplified_invoice_sequence_id" />
</div>
<field
name="pos_l10n_es_simplified_invoice_sequence_id"
invisible="1"
/>
<xpath expr="//block[@id='pos_accounting_section']" position="inside">
<setting
string="Simplified Invoice Sequence"
help="Set simplified invoice sequence for this POS"
id="l10n_es_pos_simp_seq"
>
<field name="pos_iface_l10n_es_simplified_invoice" />
<div class="content-group mt16" groups="base.group_no_one">
<field name="pos_l10n_es_simplified_invoice_sequence_id" />
</div>
</div>
<div
class="col-12 col-lg-6 o_setting_box"
<field
name="pos_l10n_es_simplified_invoice_sequence_id"
invisible="1"
/>
</setting>
<setting
string="Simplified Invoice Limit"
help="Above this limit the simplified invoice won't be made"
id="l10n_es_pos_simp_limit"
attrs="{'invisible': [('pos_iface_l10n_es_simplified_invoice', '=', False)]}"
invisible="not pos_iface_l10n_es_simplified_invoice"
>
<div class="o_setting_right_pane">
<label
for="pos_l10n_es_simplified_invoice_limit"
string="Simplified Invoice Limit"
<div class="content-group mt16">
<field
name="pos_l10n_es_simplified_invoice_limit"
class="oe_inline"
/>
<div class="text-muted">
Above this limit the simplified invoice won't be made
</div>
<div class="content-group mt16">
<field
name="pos_l10n_es_simplified_invoice_limit"
class="oe_inline"
/>
</div>
</div>
</div>
</setting>
</xpath>

<xpath expr="//field[@name='pos_invoice_journal_id']" position="attributes">
<attribute
name="attrs"
>{'required': ['|', ('pos_company_has_template', '=', True), ('pos_l10n_es_simplified_invoice_sequence_id', '=', True)]}</attribute>
name="required"
>pos_company_has_template and pos_l10n_es_simplified_invoice_sequence_id</attribute>
</xpath>

</field>
Expand Down

0 comments on commit 019cde4

Please sign in to comment.