Skip to content

Commit

Permalink
[IMP] l10n_uy_edi: Creacion de facturas de proveedor automaticamente
Browse files Browse the repository at this point in the history
Task: 28036
  • Loading branch information
pablohmontenegro committed Oct 19, 2023
1 parent a5cd0fe commit 6aa76e1
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 101 deletions.
2 changes: 1 addition & 1 deletion l10n_uy_account/views/account_journal_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<field name="inherit_id" ref="l10n_latam_invoice_document.view_account_journal_form"/>
<field name="arch" type="xml">
<field name="type" position="after">
<field name="l10n_uy_type" attrs="{'invisible':['|', '|', ('country_code', '!=', 'UY'), ('l10n_latam_use_documents', '=', False), ('type', '!=', 'sale')], 'required':[('country_code', '=', 'UY'), ('l10n_latam_use_documents', '=', True), ('type', '=', 'sale')]}"/>
<field name="l10n_uy_type" attrs="{'invisible':['|', '|', ('country_code', '!=', 'UY'), ('l10n_latam_use_documents', '=', False), ('type', 'not in', ['sale', 'purchase'])], 'required':[('country_code', '=', 'UY'), ('l10n_latam_use_documents', '=', True), ('type', 'in', ['sale', 'purchase'])]}"/>
</field>
<field name="refund_sequence" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('type', 'not in', ['sale', 'purchase']), ('l10n_latam_use_documents', '=', True), ('country_code', '=', 'UY')]}</attribute>
Expand Down
2 changes: 1 addition & 1 deletion l10n_uy_edi/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
'author': 'ADHOC SA',
'category': 'Localization',
'license': 'LGPL-3',
'version': "16.0.1.6.0",
'version': "16.0.1.7.0",
'depends': [
'l10n_uy_account',
'account_debit_note',
Expand Down
10 changes: 10 additions & 0 deletions l10n_uy_edi/data/ir_cron.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
<field name="active" eval="True"/>
</record>

<record id="ir_cron_get_vendor_bills_received" model="ir.cron">
<field name="name">UY: Consult vendor bills received</field>
<field name="interval_number">10</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field name="model_id" ref="model_account_move"/>
<field name="state">code</field>
<field name="code">model.l10n_uy_action_get_l10n_uy_received_invoices()</field>
<field name="active" eval="True"/>
</record>
<!-- TODO KZ generar el reporte diario en odoo a partir del generado en ucfe
<field name="nextcall" eval="(DateTime.now().replace(hour=22, minute=0, second=0) + timedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S')"/> -->

Expand Down
1 change: 1 addition & 0 deletions l10n_uy_edi/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class AccountMove(models.Model):
_inherit = ['account.move', 'l10n.uy.cfe']

l10n_uy_journal_type = fields.Selection(related='journal_id.l10n_uy_type')
l10n_uy_idreq = fields.Text('idReq', copy=False, readonly=True, groups="base.group_system", help="We add this field to the vendor bills that are created from Uruware because if we need to consult them again through the consult of notifications we need to pass that idReq to consult 600 to get the response it again.")

# This is required to be able to save defaults taking into account the document type selected
l10n_latam_document_type_id = fields.Many2one(change_default=True)
Expand Down
389 changes: 291 additions & 98 deletions l10n_uy_edi/models/l10n_uy_cfe.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion l10n_uy_edi/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def _l10n_uy_ucfe_inbox_operation(self, msg_type, extra_req={}, return_transport
""" Call Operation get in msg_type for UCFE inbox webservice """
self.ensure_one()
# TODO consumir secuencia creada en Odoo
id_req = 1
id_req = extra_req.get('IdReq') or 1
now = datetime.utcnow()
company = self.sudo()
data = {'Req': {'TipoMensaje': msg_type, 'CodComercio': company.l10n_uy_ucfe_commerce_code,
Expand Down
1 change: 1 addition & 0 deletions l10n_uy_edi/views/account_move_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<!-- <field name="l10n_uy_ucfe_notif"/> -->
<!-- <field name="l10n_uy_cfe_partner_status"/> -->
<field name="l10n_uy_cfe_uuid"/>
<field name="l10n_uy_idreq" attrs="{'invisible': [('l10n_uy_journal_type', '!=', 'electronic'), ('invoice_filter_type_domain', '!=', 'purchase')]}"/>
<button name="action_l10n_uy_get_uruware_cfe" type="object" string="Get Uruware Invoice" class="oe_link" colspan="2"/>
<field name="l10n_uy_cfe_file"/>
</group>
Expand Down

0 comments on commit 6aa76e1

Please sign in to comment.