Skip to content

Commit

Permalink
IMP l10n_it_fatturapa_in adding "Recompute XML fields" button when fi…
Browse files Browse the repository at this point in the history
…elds like "invoices_number" and "registered" are not valorized

This may happen in case of temporary errors while importing from SDI
  • Loading branch information
eLBati authored and TheMule71 committed May 8, 2021
1 parent ac2507d commit 4e253f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions l10n_it_fatturapa_in/models/attachment.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def _compute_e_invoice_validation_error(self):
def get_xml_string(self):
return self.ir_attachment_id.get_xml_string()

def recompute_xml_fields(self):
self._compute_xml_data()
self._compute_registered()

@api.depends("ir_attachment_id.datas")
def _compute_xml_data(self):
for att in self:
Expand Down
7 changes: 7 additions & 0 deletions l10n_it_fatturapa_in/views/account_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
text="Show preview"
attrs="{'invisible': [('id', '=', False)]}"
/>
<button
type="object"
name="recompute_xml_fields"
string="Recompute XML fields"
icon="fa-refresh"
attrs="{'invisible': [('invoices_number', '!=', 0), ('xml_supplier_id', '!=', False), ('invoices_date', '!=', False)]}"
/>
</div>
<field name="name" invisible="1" />
</group>
Expand Down

0 comments on commit 4e253f1

Please sign in to comment.