-
-
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.
[14.0][l10n_it_pos_fatturapa] Port to v14.0
- Loading branch information
Showing
10 changed files
with
119 additions
and
92 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
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,11 +1,14 @@ | ||
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", | ||
"electronic_invoice_obliged_subject", | ||
"eori_code", | ||
"codice_destinatario", | ||
"pec_destinatario", | ||
"pa_partner_code", | ||
]); | ||
}); |
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,30 @@ | ||
odoo.define('l10n_it_pos_fatturapa.screens', function (require) { | ||
odoo.define("l10n_it_pos_fatturapa.ClientDetailsEdit", function (require) { | ||
"use strict"; | ||
|
||
var Screens = require('point_of_sale.screens'); | ||
var ClientDetailsEdit = require("point_of_sale.ClientDetailsEdit"); | ||
const Registries = require("point_of_sale.Registries"); | ||
|
||
Screens.ClientListScreenWidget.include({ | ||
|
||
display_client_details: function(visibility,partner,clickpos){ | ||
var self = this; | ||
this._super.apply(self, arguments); | ||
if (visibility === 'edit') { | ||
this.$('.electronic_invoice_subjected').off('change').on('change', function(event) { | ||
this.value = this.checked; | ||
$('#electronic_invoice_subjected').css('display', this.checked ? 'block' : 'none'); | ||
}); | ||
const PosClientDetailsEdit = (ClientDetailsEdit) => | ||
class extends ClientDetailsEdit { | ||
constructor() { | ||
super(...arguments); | ||
const partner = this.props.partner; | ||
this.changes.electronic_invoice_obliged_subject = | ||
partner.electronic_invoice_obliged_subject; | ||
} | ||
captureChange(event) { | ||
super.captureChange(event); | ||
if (event.target.name === "electronic_invoice_obliged_subject") { | ||
$("#electronic_invoice_obliged_subject").css( | ||
"display", | ||
event.target.checked ? "block" : "none" | ||
); | ||
this.changes[event.target.name] = event.target.checked; | ||
} | ||
} | ||
}, | ||
}); | ||
}; | ||
|
||
Registries.Component.extend(ClientDetailsEdit, PosClientDetailsEdit); | ||
|
||
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,60 +1,63 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<templates id="template" xml:space="preserve"> | ||
|
||
<t t-extend="ClientDetails"> | ||
<t t-jquery=".client-details-right" t-operation="append"> | ||
<div class='client-detail'> | ||
<t t-if="partner.electronic_invoice_subjected"> | ||
<span class='label'>e-Invoice</span> | ||
<input type="checkbox" class='detail o_checkbox electronic_invoice_subjected' | ||
t-att-checked="partner.electronic_invoice_subjected ? 'checked' : null" disabled="disabled" | ||
t-att-value="partner.electronic_invoice_subjected"/><br/> | ||
|
||
<div id="electronic_invoice_subjected" t-attf-style="display: #{partner.electronic_invoice_subjected ? 'block': 'none'};"> | ||
<div class="client-detail"> | ||
<span class='label'>Code</span> | ||
<span class='detail codice_destinatario'><t t-esc='partner.codice_destinatario or ""'/></span><br/> | ||
|
||
<span class='label'>PEC</span> | ||
<span class='detail pec_destinatario'><t t-esc='partner.pec_destinatario or ""'/></span><br/> | ||
|
||
<span class='label'>EORI</span> | ||
<span class='detail eori_code'><t t-esc='partner.eori_code or ""'/></span><br/> | ||
|
||
<span class='label'>iPA Code</span> | ||
<span class='detail pa_partner_code'><t t-esc='partner.pa_partner_code or ""'/></span> | ||
</div> | ||
</div> | ||
</t> | ||
</div> | ||
</t> | ||
</t> | ||
|
||
<t t-extend="ClientDetailsEdit"> | ||
<t t-jquery=".client-details-right" t-operation="append"> | ||
<t | ||
t-name="ClientDetailsEdit" | ||
t-inherit="point_of_sale.ClientDetailsEdit" | ||
t-inherit-mode="extension" | ||
owl="1" | ||
> | ||
<xpath expr="//div[hasclass('client-details-right')]" t-operation="inside"> | ||
<div class='client-detail'> | ||
<span class='label'>e-Invoice</span> | ||
<input type='checkbox' class='detail o_checkbox checkbox electronic_invoice_subjected' | ||
name='electronic_invoice_subjected' t-att-checked="partner.electronic_invoice_subjected ? 'checked' : null" | ||
t-att-value="partner.electronic_invoice_subjected"/> | ||
|
||
<div id="electronic_invoice_subjected" t-attf-style="display: #{partner.electronic_invoice_subjected ? 'block': 'none'};"> | ||
<input | ||
type='checkbox' | ||
class='detail o_checkbox checkbox electronic_invoice_obliged_subject' | ||
name='electronic_invoice_obliged_subject' | ||
t-on-change="captureChange" | ||
t-att-checked="props.partner.electronic_invoice_obliged_subject ? 'checked' : null" | ||
t-att-value="props.partner.electronic_invoice_obliged_subject" | ||
/> | ||
|
||
<div | ||
id="electronic_invoice_obliged_subject" | ||
t-attf-style="display: {{props.partner.electronic_invoice_obliged_subject ? 'block': 'none'}};" | ||
> | ||
<div class='client-detail'> | ||
<span class='label'>Code</span> | ||
<input class='detail codice_destinatario' name='codice_destinatario' t-att-value="partner.codice_destinatario or '0000000'"/> | ||
<input | ||
class='detail codice_destinatario' | ||
name='codice_destinatario' | ||
t-on-change="captureChange" | ||
t-att-value="props.partner.codice_destinatario or '0000000'" | ||
/> | ||
|
||
<span class='label'>PEC</span> | ||
<input class='detail pec_destinatario' name='pec_destinatario' t-att-value="partner.pec_destinatario or ''"/> | ||
<input | ||
class='detail pec_destinatario' | ||
name='pec_destinatario' | ||
t-on-change="captureChange" | ||
t-att-value="props.partner.pec_destinatario or ''" | ||
/> | ||
|
||
<span class='label'>EORI</span> | ||
<input class='detail eori_code' name='eori_code' t-att-value="partner.eori_code or ''"/> | ||
<input | ||
class='detail eori_code' | ||
name='eori_code' | ||
t-on-change="captureChange" | ||
t-att-value="props.partner.eori_code or ''" | ||
/> | ||
|
||
<span class='label'>iPA Code</span> | ||
<input class='detail pa_partner_code' name='pa_partner_code' t-att-value="partner.pa_partner_code or ''"/> | ||
<input | ||
class='detail pa_partner_code' | ||
name='pa_partner_code' | ||
t-on-change="captureChange" | ||
t-att-value="props.partner.pa_partner_code or ''" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</t> | ||
</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, | ||
) |