Commit Graph
23 Commits
Author SHA1 Message Date
Antoine Prieels (ANP) 8f486db52d [IMP] mail, snailmail, snailmail_account: improve error management
When a letter is sent through snailmail and encounter an error, it used
to create an activity to the user to notify him that there was an error
with its letter.

When a user had this activity, he didn't have any clues of what was the
error and how to manage it. So we decided to better handle snailmail
errors and give the possibility to the user to easily fix the source of
the snailmail errors.

First to give a better feedback on the letters in errors, we've made
features similar to ones existing for emails:
 - We add a mail message on the document that sent the letter, and put a
   small paper plane icon, which is red when an error occurs (like the
   envelope for email)
 - As letters can be sent in batch, we've also added an entry in the
   systray to easily manage the different documents having snailmail
   errors like for emails.

Then we identified, the most common errors encountered with the
snailmail letters and give proper way to let the user fix them:
 - Missing Required Field:
    - The address is not complete, some of the fields are empty.
    - We open a wizard allowing the user to modify the partner address
      and we try to resend all letters having this error on the modified
      partner.
    - We also try to avoid this error, by opening the wizard before
      sending the letter, but it only works for single documents, not
      for batch.
 - Trial/Credit Error:
    - The user has not enough credits to send letters anymore.
    - We open a wizard that give a redirection lnk to add credits on its
      iap account.
 - No Price Available:
    - The destination country is not supported by any of our providers,
      and we cannot do anything to send this letter.
 - Format Error:
    - The format of the pdf report send by the user is refused by our
      providers, because some visual stuffs are not respected, for
      example blank zone to print barcode or margins.
    - We show a wizard to the user letting him check a setting option
      that add a cover page in the envelope and the documents will be
      send with this extra page containing the address.
 - Unknown Error:
    - This is not one of the listed error above.
    - A wizard suggesting the user to contact support is displayed.

The cron that try to resend letters on error, has been addapted to only
try to send the error of type Trial/No Credit, because the account might
have been reloaded, and other errors, won't change if they have not been
fixed locally.

closes odoo/odoo#29685
2019-01-24 13:36:51 +00:00
Christophe Simonis 8aa8548d8a [MERGE] forward port branch 12.0 up to 3e4138deaa
closes odoo/odoo#30045
2019-01-09 15:56:53 +00:00
Antoine Prieels 62221bc3f9 [FIX] snailmail: Object of type bytes is not JSON serializable
Sending a letter resulted systematically in an error due to the insertion of the binary of the PDF in the JSON sent to IAP-services.

closes odoo/odoo#29880
2019-01-03 12:56:52 +00:00
Antoine Prieels (ANP) e81ef3a603 [FIX] snailmail: Do not resend letters in state 'error' in cron
closes odoo/odoo#29456
2018-12-12 09:36:36 +00:00
Antoine Prieels (ANP) f68df47ddf [IMP] snailmail: Show the price in terms of stamps
- The price of sending a letter was displayed in the currency of the company, now we express the price in terms of stamps
- Show a different message in the modal depending on the validity of the address
2018-11-22 15:38:42 +00:00
Antoine Prieels (ANP) d5ca268438 [IMP] snailmail: Change order of settings and default values
Task #1892473
2018-11-22 15:38:42 +00:00
Antoine Prieels (ANP) 2dfa7cd597 [IMP] snailmail: Add form and tree views for snailmail.letter
Add new form and tree views for snailmail.letter available in Accounting > Configuration > Management > Snailmail Letters
Add a many2one field to snailmail.letter to link to a mail.activity in case of an error with snailmail

Task #1892473
2018-11-22 15:38:42 +00:00
Rémi Rahir 235811d468 [FIX] snailmail: avoid spam on user mailbox
the fix merged in cb8bd299fc
was only tackling half the problem. When you assign a user to an
activity, the said user will be notified by email. This also occur if
you change the assignee to the next activity even if you change it to
the same user.

This commit ensures that we only write on the user_id field when we
create the next activity and not during the update.
2018-11-05 09:32:33 +00:00
Rémi Rahir 9988ce3f3b [IMP] snailmail: add new error message to help the user 2018-11-05 09:31:52 +00:00
Rémi Rahir 5032828d5a [FIX] snailmail: instable behaviour on print
Since commit b6a981405e we require a
certain key in the context to apply the custom snailmail report layout.
This was badly managed and would eventually confilt inside the modal
that links snailmail and the mail composer.

This fix stabilises the biehaviour by properly propagating the context
key.
2018-10-19 08:36:16 +00:00
Antoine Prieels (ANP) 218fbaf90b [IMP] snailmail: Change formatting of address in snailmail
The previos format displayed the fields 'street' and 'street2' on two different line, making the address too big for the address area allowed by Pingen.
2018-10-19 08:36:16 +00:00
Antoine Prieels (ANP) a5b3246dcd [FIX] Convert the estimated price for snailmail server-side
Currency rates were not updated client-side so we moved to make the convertion happen server-side, where rates are updated daily

closes odoo/odoo#27688
2018-10-11 14:48:25 +00:00
Rémi Rahir cb8bd299fc [FIX] snailmail: avoid next activity spamming
closes odoo/odoo#27665
2018-10-11 11:11:42 +00:00
Rémi Rahir e12ac2b91b [IMP] snailmail(_account): smoothe the etimation of price
Up until now, when we wanted to post a single document, it's base64 blob
was uploaded to the snailmail server to estimate the cost of the
transaction.  We now use the 'batch' apporach that will estimate the
price based on 1 page per document.
2018-09-29 11:12:39 +02:00
Rémi Rahir b6a981405e [IMP] snailmail: adding special map for the country names 2018-09-29 11:12:38 +02:00
Adrian Torres 3f4f77fd9d [REF] *: adapt code to new related default behaviour
This commit adapts the business code to changes introduced by
the parent commit in order to keep the same behaviour as before.

All readonly=False fields will have to be checked afterwards to confirm
that the business case requires write access to the source field.
2018-09-27 12:10:23 +02:00
Rémi Rahir 49695b0088 [FIX] snailmail: use the correct activity type
The activity generated by the snailmail sending is actually an exception
and should therefore use the corresponding activity type.
2018-09-27 11:30:16 +02:00
Rémi Rahir 0df593f2fe [IMP] snailmail: adding dbuuid to the request for free credits
change the payload of a request to adapt to 2cd0b6acf1e22642607edf05a220f5ab8af12164.
2018-09-21 13:48:56 +02:00
Nimesh Jethva 2c1549cc59 [IMP]tools, technial modules: Improvement in model description
Purpose of this commit is to give description more "business oriented"
because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers.

Related Task ID : 37311
2018-09-21 11:45:15 +02:00
Rémi Rahir 46dc8ceef9 [IMP] snailmail: adapt reports for snailmail
In order to ease the integration with the snailmail posting service provider,
We will generate specific reports with a layout that fits their
criteria.
In short,
* we specify the postition of the recipient's address on the
document
* we force the A4 format

This also support the din5008 type B report.
2018-09-19 17:58:35 +02:00
Rémi Rahir 0354579c98 [IMP] iap,snailmail: support new trial system 2018-09-17 12:45:05 +02:00
Rémi Rahir 53cdd68e7c [IMP] account,snailmail: support batch calls
- reworked the multi.compose.message model to manage
   several documents simultaneously
 - Added a letter model for asynchronous processing
 - usability improvement of the modal
2018-08-10 18:41:00 +02:00
Rémi Rahir 4cb9194275 [ADD] snailmail: new iap module to send letters by post 2018-07-19 15:54:00 +02:00