-
-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] l10n_it_pos_fatturapa: Migration to 14.0
[FIX] GSLabIt review
- Loading branch information
Showing
12 changed files
with
139 additions
and
113 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
# Copyright 2019 Roberto Fichera | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class ResPartner(models.Model): | ||
_inherit = 'res.partner' | ||
_inherit = "res.partner" | ||
|
||
@api.model | ||
def create_from_ui(self, partner): | ||
if 'electronic_invoice_subjected' in partner: | ||
electronic_invoice_subjected = \ | ||
partner['electronic_invoice_subjected'] == 'true' | ||
partner['electronic_invoice_subjected'] = \ | ||
electronic_invoice_subjected | ||
partner['electronic_invoice_obliged_subject'] = \ | ||
electronic_invoice_subjected | ||
if "electronic_invoice_subjected" in partner: | ||
electronic_invoice_subjected = bool( | ||
partner.get("electronic_invoice_subjected") | ||
) | ||
|
||
partner.update( | ||
{ | ||
"electronic_invoice_subjected": electronic_invoice_subjected, | ||
"electronic_invoice_obliged_subject": electronic_invoice_subjected, | ||
} | ||
) | ||
return super(ResPartner, self).create_from_ui(partner) |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
* Roberto Fichera <roberto.fichera@levelprime.com> | ||
* berim <info@berim.it> | ||
* Ooops404 <info@ooops404.com> |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
odoo.define("l10n_it_pos_fatturapa.ClientDetailsEdit", function (require) { | ||
"use strict"; | ||
|
||
const ClientDetailsEdit = require("point_of_sale.ClientDetailsEdit"); | ||
const Registries = require("point_of_sale.Registries"); | ||
|
||
const PosClientDetailsEditCode = (ClientDetailsEdit) => | ||
class extends ClientDetailsEdit { | ||
captureChange(event) { | ||
super.captureChange(event); | ||
if (event.target.name === "electronic_invoice_subjected") { | ||
const checked = event.currentTarget.checked; | ||
this.changes[event.target.name] = Boolean(checked); | ||
$(".electronic_invoice_subjected") | ||
.toArray() | ||
.forEach(function (el) { | ||
$(el).css("display", checked ? "block" : "none"); | ||
}); | ||
} | ||
} | ||
}; | ||
|
||
Registries.Component.extend(ClientDetailsEdit, PosClientDetailsEditCode); | ||
|
||
return ClientDetailsEdit; | ||
}); |
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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
odoo.define('l10n_it_pos_fatturapa.models', function (require) { | ||
odoo.define("l10n_it_pos_fatturapa.models", function (require) { | ||
"use strict"; | ||
|
||
var pos_models = require('point_of_sale.models'); | ||
|
||
pos_models.load_fields("res.partner", | ||
["electronic_invoice_subjected", "eori_code", | ||
"codice_destinatario", "pec_destinatario", | ||
"pa_partner_code"]); | ||
var pos_models = require("point_of_sale.models"); | ||
|
||
pos_models.load_fields("res.partner", [ | ||
"electronic_invoice_subjected", | ||
"eori_code", | ||
"codice_destinatario", | ||
"pec_destinatario", | ||
"ipa_code", | ||
]); | ||
}); |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<templates id="template" xml:space="preserve"> | ||
|
||
<t t-inherit="point_of_sale.ClientDetailsEdit" t-inherit-mode="extension"> | ||
<xpath expr="//div[@class='client-details-right']" position="inside"> | ||
<div class="client-detail"> | ||
<span class='label'>e-Invoice</span> | ||
<input | ||
type='checkbox' | ||
class='detail o_checkbox' | ||
name='electronic_invoice_subjected' | ||
t-att-checked="props.partner.electronic_invoice_subjected ? 'checked' : null" | ||
t-on-change="captureChange" | ||
t-att-value="props.partner.electronic_invoice_subjected" | ||
/> | ||
</div> | ||
<div | ||
class="electronic_invoice_subjected" | ||
t-on-change="captureChange" | ||
t-attf-style="display: {{props.partner.electronic_invoice_subjected ? 'block': 'none'}};" | ||
> | ||
<div class="client-detail"> | ||
<span class='label'>Code</span> | ||
<input | ||
class='detail codice_destinatario' | ||
name='codice_destinatario' | ||
t-on-change="captureChange" | ||
t-att-value="props.partner.codice_destinatario || ''" | ||
/> | ||
</div> | ||
<div class="client-detail"> | ||
<span class='label'>PEC</span> | ||
<input | ||
class='detail pec_destinatario' | ||
name='pec_destinatario' | ||
t-on-change="captureChange" | ||
t-att-value="props.partner.pec_destinatario || ''" | ||
/> | ||
</div> | ||
<div class="client-detail"> | ||
<span class='label'>EORI</span> | ||
<input | ||
class='detail eori_code' | ||
name='eori_code' | ||
t-on-change="captureChange" | ||
t-att-value="props.partner.eori_code || ''" | ||
/> | ||
</div> | ||
<div class="client-detail"> | ||
<span class='label'>iPA Code</span> | ||
<input | ||
class='detail pa_partner_code' | ||
name='ipa_code' | ||
t-on-change="captureChange" | ||
t-att-value="props.partner.ipa_code || ''" | ||
/> | ||
</div> | ||
</div> | ||
</xpath> | ||
</t> | ||
|
||
</templates> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../l10n_it_pos_fatturapa |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |