Skip to content

Commit

Permalink
Merge PR #409 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by alexis-via
  • Loading branch information
OCA-git-bot committed Jan 20, 2023
2 parents 4734b1d + 90f71c5 commit 709fa46
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions l10n_fr_das2/models/l10n_fr_das2.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,17 @@ def name_get(self):
return res

def done(self):
self.write({"state": "done"})
vals = {"state": "done"}
if self.line_ids:
attach = self.generate_file()
vals["attachment_id"] = attach.id
self.write(vals)
return

def back2draft(self):
if self.attachment_id:
self.attachment_id.unlink()
self.message_post(body=_("DAS2 file deleted."))
self.write({"state": "draft"})
return

Expand Down Expand Up @@ -692,8 +699,8 @@ def generate_file(self):
"datas": base64.encodebytes(file_content_encoded),
}
)
self.attachment_id = attach.id
self.message_post(body=_("DAS2 file generated."))
return attach

def button_lines_fullscreen(self):
self.ensure_one()
Expand Down
2 changes: 1 addition & 1 deletion l10n_fr_das2/readme/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Then click on the button *Generate Lines*. Check and edit the generated lines. Y

You should also have a look in the chatter: you may have a message that warn you about suppliers that have expenses recorded in accounts such as 622100 Commissions et courtages sur achats, 622200 Commissions et courtages sur ventes, 622600 Honoraires, 622800 Rémunérations d'intermédiaires divers, 653000 Jetons de présence, 651600 Droits d'auteur et de reproduction and are not configured for DAS2.

Once your declaration is OK, click on the button *Generate File* and download the generated file.
Once your declaration is OK, click on the button *Done*: it will generate the DAS2 file and set the declaration to *Done* state (all the fields become readonly).

Connect to DAS2_declaration_, select *Transmission par internet des fichiers TD/bilatéral* and type your login and password (the credentials are specific to this website; their are not the same as on *impots.gouv.fr*). Then follow the online declaration process and upload the file generated by Odoo.

Expand Down
2 changes: 1 addition & 1 deletion l10n_fr_das2/views/l10n_fr_das2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
states="draft"
class="btn-primary"
/>
<button name="generate_file" string="Generate File" type="object" />
<button
name="back2draft"
string="Back to Draft"
type="object"
states="done"
confirm="Are you sure you want to go back to draft?"
/>
<button
name="done"
Expand Down

0 comments on commit 709fa46

Please sign in to comment.