chore: import enterprise addons 19.0 bulk snapshot

This commit is contained in:
1b-agent committed 2026-09-16 10:13:08 +00:00
commit ca4af030d3
39951 files changed
+15570005

No files matched your search

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates id="template" xml:space="preserve">
<t t-inherit="point_of_sale.PaymentScreenButtons" t-inherit-mode="extension">
<xpath expr="//div[hasclass('payment-buttons')]//button[hasclass('js_invoice')]" position="replace">
<!-- Remove the invoice button when dian is enabled -->
<t t-if="!this.pos.company.l10n_co_edi_pos_dian_enabled">$0</t>
</xpath>
</t>
</templates>
@@ -0,0 +1,14 @@
import { OrderReceipt } from "@point_of_sale/app/screens/receipt_screen/receipt/order_receipt";
import { patch } from "@web/core/utils/patch";
patch(OrderReceipt.prototype, {
get l10n_co_edi_pos_receipt_data() {
const receiptData = this.order.l10n_co_edi_pos_receipt_data;
if (receiptData) {
return JSON.parse(receiptData);
} else {
return undefined;
}
},
});
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates id="template" xml:space="preserve">
<t t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension">
<xpath expr="//div[hasclass('before-footer')]" position="inside">
<t t-set="receipt_data" t-value="l10n_co_edi_pos_receipt_data"/>
<t t-if="receipt_data">
<t t-set="before_footer_data" t-value="receipt_data.before_footer"/>
<div class="d-flex flex-column align-items-center mt-4">
<!-- Client info -->
<div class="receipt_l10n_co_edi_partner_name">Razón social / Nombre: <t t-out="before_footer_data.partner_name"/></div>
<div class="receipt_l10n_co_edi_identification_type">Tipo de identificación: <t t-out="before_footer_data.identification_type"/></div>
<div class="receipt_l10n_co_edi_identification_number">Número de identificación: <t t-out="before_footer_data.identification_number"/></div>
<div class="receipt_l10n_co_edi_address">Dirección: <t t-out="before_footer_data.address"/></div>
<!-- Company info -->
<div class="receipt_l10n_co_edi_large_taxpayer">
<t t-if="before_footer_data.large_taxpayer" class="mt-3">Somos Grandes Contribuyentes</t>
<t t-else="" class="mt-3">No Somos Grandes Contribuyentes</t>
</div>
<div class="receipt_l10n_co_edi_fiscal_regimen">Regimen fiscal: <t t-out="before_footer_data.fiscal_regimen_description"/></div>
<div>Responsabilidad Tributaria:</div>
<div class="receipt_l10n_co_edi_obligation_type_description"><t t-out="before_footer_data.obligation_type_description"/></div>
<img alt="Barcode" t-att-src="before_footer_data.barcode_src" class="mt-3"/>
</div>
</t>
</xpath>
<xpath expr="//div[hasclass('after-footer')]" position="before">
<t t-set="receipt_data" t-value="l10n_co_edi_pos_receipt_data"/>
<t t-if="receipt_data">
<t t-set="after_footer_data" t-value="receipt_data.after_footer"/>
<div class="d-flex flex-column align-items-center">
<br/>
<t t-if="receipt_data.document_state == 'invoice_accepted'">
<t t-foreach="after_footer_data.cufe_chunks" t-as="chunk" t-key="chunk">
<div t-if="chunk_first">CUFE: <t t-out="chunk"/></div>
<div t-else=""><t t-out="chunk"/></div>
</t>
<div class="receipt_l10n_co_edi_signing_time mt-2">Fecha de firma: <t t-out="after_footer_data.signing_time"/></div>
<div class="receipt_l10n_co_edi_issue_date_time">Fecha de emisión: <t t-out="after_footer_data.issue_date"/> <t t-out="after_footer_data.issue_time"/></div>
</t>
<div>Generado por Software Propio</div>
<div class="receipt_l10n_co_edi_pos_serial_number">Número de serie del punto de venta: <t t-out="after_footer_data.l10n_co_edi_pos_serial_number"/></div>
</div>
</t>
</xpath>
</t>
</templates>
@@ -0,0 +1,14 @@
import { ReceiptHeader } from "@point_of_sale/app/screens/receipt_screen/receipt/receipt_header/receipt_header";
import { patch } from "@web/core/utils/patch";
patch(ReceiptHeader.prototype, {
get l10n_co_edi_pos_header_data() {
const receiptData = this.order.l10n_co_edi_pos_receipt_data;
if (receiptData) {
return JSON.parse(receiptData).header;
} else {
return undefined;
}
},
});
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<templates xml:space="preserve">
<t t-inherit="point_of_sale.ReceiptHeader" t-inherit-mode="extension">
<xpath expr="//div[hasclass('pos-receipt-contact')]" position="after">
<t t-set="header_data" t-value="l10n_co_edi_pos_header_data"/>
<t t-if="header_data">
<div class="receipt_header_l10n_co_edi_type">
<t t-if="header_data.l10n_co_edi_type == '1'">Factura Electrónica de Venta</t>
<t t-else="">Nota Crédito Electrónica</t>
</div>
<div class="receipt_header_l10n_co_edi_document_number">Número de Documento: <t t-out="header_data.sequence_number"/></div>
<div class="receipt_header_l10n_co_edi_authorization_number">DIAN resolution: <t t-out="header_data.l10n_co_edi_dian_authorization_number"/></div>
<div class="receipt_header_l10n_co_edi_date_range">Fecha efectiva desde <t t-out="header_data.l10n_co_edi_dian_authorization_date"/> a <t t-out="header_data.l10n_co_edi_dian_authorization_end_date"/></div>
<div>Número de secuencia desde</div>
<div class="receipt_header_l10n_co_edi_sequence_range"><t t-out="header_data.l10n_co_edi_min_range_number"/> a <t t-out="header_data.l10n_co_edi_max_range_number"/></div>
<div class="receipt_header_l10n_co_edi_payment_option">Metodo de Pago: <t t-out="header_data.l10n_co_edi_pos_payment_option_id.name"/></div>
<div class="receipt_header_l10n_co_edi_payment_option_code">
<t t-if="header_data.l10n_co_edi_pos_payment_option_id.code == '1'">Termino de Pago: Contado</t>
<t t-if="header_data.l10n_co_edi_pos_payment_option_id.code == '2'">Termino de Pago: Crédito</t>
</div>
</t>
</xpath>
</t>
</templates>
@@ -0,0 +1,22 @@
/** @odoo-module */
import { TicketScreen } from "@point_of_sale/app/screens/ticket_screen/ticket_screen";
import { patch } from "@web/core/utils/patch";
patch(TicketScreen.prototype, {
// Override
setPartnerToRefundOrder(partner, destinationOrder) {
if (this.pos.company.l10n_co_edi_pos_dian_enabled) {
const destinationPartner = destinationOrder.getPartner();
if (
partner &&
(!destinationPartner ||
destinationPartner.id === this.pos.session._l10n_co_final_consumer_id)
) {
destinationOrder.setPartner(partner);
}
} else {
super.setPartnerToRefundOrder(partner, destinationOrder);
}
},
});
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates id="template" xml:space="preserve">
<t t-inherit="point_of_sale.TicketScreen" t-inherit-mode="extension">
<xpath expr="//InvoiceButton" position="replace">
<!-- Remove the InvoiceButton when dian is enabled -->
<t t-if="!this.pos.company.l10n_co_edi_pos_dian_enabled">$0</t>
</xpath>
</t>
</templates>
@@ -0,0 +1,13 @@
import { PosOrder } from "@point_of_sale/app/models/pos_order";
import { patch } from "@web/core/utils/patch";
patch(PosOrder.prototype, {
// @Override
setup() {
super.setup(...arguments);
if (this.company.l10n_co_edi_pos_dian_enabled && !this.partner_id) {
this.update({ partner_id: this.config._l10n_co_final_consumer_id });
}
},
});
@@ -0,0 +1,25 @@
/** @odoo-module */
import { PosStore } from "@point_of_sale/app/services/pos_store";
import { patch } from "@web/core/utils/patch";
patch(PosStore.prototype, {
// @Override
getSyncAllOrdersContext(orders, options = {}) {
const context = super.getSyncAllOrdersContext(orders, options);
if (this.company.l10n_co_edi_pos_dian_enabled) {
// this ensures that we send all the invoices (generated from pos orders) to dian
context.generate_pdf = true;
}
return context;
},
// @Override
getDefaultPartnerId() {
if (this.company.l10n_co_edi_pos_dian_enabled) {
return this.config._final_consumer_id;
}
return super.getDefaultPartnerId();
},
});
@@ -0,0 +1,30 @@
/** @odoo-module */
import OrderPaymentValidation from "@point_of_sale/app/utils/order_payment_validation";
import { patch } from "@web/core/utils/patch";
patch(OrderPaymentValidation.prototype, {
// @Extend
async askBeforeValidation() {
if (this.pos.company.l10n_co_edi_pos_dian_enabled) {
const currentPartner = this.order.getPartner();
if (
!currentPartner ||
currentPartner.id === this.pos.config._l10n_co_final_consumer_id
) {
this.order.setToInvoice(false);
} else {
this.order.setToInvoice(true);
}
}
return super.askBeforeValidation();
},
// @Override
shouldDownloadInvoice() {
return this.pos.company.l10n_co_edi_pos_dian_enabled
? false
: super.shouldDownloadInvoice();
},
});
@@ -0,0 +1,16 @@
/** @odoo-module **/
import { FormController } from "@web/views/form/form_controller";
import { patch } from "@web/core/utils/patch";
patch(FormController.prototype, {
// @Override
async afterExecuteActionButton(clickParams) {
const result = await super.afterExecuteActionButton(clickParams);
if (clickParams.name === "button_l10n_co_dian_refresh_data") {
const pos = this.env.services.pos;
await pos.data.read("res.partner", [this.model.root.resId]);
}
return result;
},
});