Commit Graph
228 Commits
Author SHA1 Message Date
jpr-odoo d6d7554a6e [IMP] account: improvement into the invoice mail template
with this commit, we have added  comma ',' after the name of the customer

Task ID: 1930087
2019-04-12 09:04:27 +00:00
Thibault Delavallée 0b74c9ab6e [FIX][IMP] various: improve recipients computation in mail templates
Purpose: use more email_formatted when possible, clean and simplify
email_from, email_to and partner_to computation.

Next step is to try to extract some common patterns in tools or methods in
order to simplify template creation and customization.

Related to task 1972615
Linked to PR #32872
2019-04-23 14:26:50 +00:00
Laurent Smet bd90026c67 [IMP] account: check match_partner in the default reconcile rule 2018-11-19 16:01:02 +00:00
Cedric Snauwaert bc9e1f7ed0 [FIX] account: fix account type of other income and asset filter
Account type of other income should be of type 'income' and not 'other'
Filter 'Assets' in chart of accounts view is not working correctly due to typo in the filter.
2018-09-28 13:34:37 +02:00
Laurent Smet 7053ae7828 [IMP] account: management of reconciliation rules
Bank statement lines need to be matched with entries; We have to automate this operation as much as possible.
At the same time, create an algorithm that fit everyone needs is quite impossible.
For that reason we will let users choose the rules they want with the improvement of reconciliation models.

Note that we did it only for bank statement reconliation, not for manual reconciliations.

Was task: 1877375
Was PR #26669
2018-09-20 17:11:52 +02:00
Nicolas Bayet cb1aa9c596 [IMP] account: Allow to filter account by internal group
Purpose
=======

Since the account apocalypse in 9.0, there are no way to filter the accounts
based on their 'internal group'.

Specification
=============

Add a Selection field 'internal_group' on the account.account.type to allow
filtering the accounts. The possible internal groups are the following:
- Equity
- Asset
- Liability
- Income
- Expense

Also, set the value to the account types defined in data.

TaskID: 1868221
2018-08-13 14:36:32 +02:00
Nikunj Ladava d68d8d9039 [IMP] sale_payment,website_sale: send email when automatic invoice activated
Currently when in payment is configure in automatic invoice mode,
customers don't receive anything.
If they want to see their invoice, they have to log into their portal
account.

Task #1866497
Closes #25864
2018-08-10 17:01:41 +02:00
Mitali Patel 84f528bcff [IMP] Portal - Share link : Easily share the url of a document
Purpose
=======
- Quickly share the url to someone else (a client, a colleague,...)
- Ensure that the recipient can access at least
  the portal view of the shared record.
- Typically used when a client cannot retrieve the mail to access his order.
  The share link can be used in this case.

Specifications
==============
For any object inheriting form portal.mixin:
    - Add a button SHARE (not visible in edit mode)
    - When clicking on this button, a popup opens with :
        - A warning message for tasks and projects only (see below)
        - the link (like in gmail) that can be copied
        - Recipients
        - mail composer (with preselected template) ==> see below
        - button [Send Link] [Copy Link] Discard
        - After sharing document, put internal note like
          "Document shared to xyz,...." with template message
    - Anyone with the link, even anonymous user (not logged in) can have access
      to the document with the access token provided in the url.

Impacted models:
    - account.invoice (Community)
    - project.project (Community)
    - project.task (Community)
    - purchase.order (Community)
    - sale.order (Community)
    - helpdesk.ticket (Enterprise)

Warning messages and access rules:
    Allowed :
        - SO canceled or draft will be accessible with the link
          with access_token
        - If the customer account is B2B (signup not enabled), the recipient
          will anyway see the document as the user specifically wants the
          recipient to see the document.
    Restrictions :
        - For Project and Task, if the privacy is not public, then, there is a
          contradiction between the access_token mechanism
          and the privacy of the document.
        - A warning message will be displayed in the share wizard to inform the
          user if the document cannot be visible by the recipients and to
          ask him to set the privacy to 'Visible by following customer'.
          The send button will, in that case, be hidden.
        - To avoid to block the share for a new project, default privacy value
          is now set to 'Visible by followong customer'

Technical implementation
========================
- Move the access_token mechanism (field + methods + mail controller)
  to the portal.mixin to be able to use it in a generic way for each object
  inheriting the portal.mixin
- Generalise a part of the _*model*_get_page_view_values method
  into a single one in portal
- Generalize the _*model*_check_access into the portal controller of the
  portal module
- Remove the init_column + default value for the access_token
  > old records have an access_token,
  > new one won't but it will be generated on demand via the get_access_token
  Done for performance reasons
- Add share button into action menu separately. + kanban view context menu
  (except for task and project where button not in action menu but 'simple'
  button for task and project because other modules already provide action
  to send documents by email, which is not the case for project and task.)
- Add a sign_token used to authentify the recipient in the portal view chatter,
  if any. The message will be posted as if the user was logged in.
- Set the _get_share_url as private for security reason
- Add a redirect parameter to _get_share_url to get
    If false : The direct portal view url
    If True : The redirect url (mail/view/?)
- Cleaning up unnecessary code

- Bug fix :
    - Before, if user was not logged and record had partner_id,
      if partner id was null, post message was done as admin.
      Now, the post message is done as public user.
    - If the user had an uid but had no access_token, he could be able
      to gain the access token of the record.
      check_access_rights was missing in the get_access_action.

Task ID : 30985
Closes #25629
2018-08-03 15:20:42 +02:00
Yannick Tivisse a701031c92 [REM] account_invoicing: Merge module into account
Purpose
=======

The only module that was supposed to work without the accounting menuitems was
the ecommerce. Now that the ecommerce wants the accounting menuitems to be
visible, this module makes no sense anymore.

Specification
=============

Remove the account_invoicing module and move the code to account.
2018-07-31 12:34:18 +02:00
Laurent Smet c75f3a007c [REF] account,stock,account_intrastat: Intrastat report moved in interprise
This will allow to use the same core for all intrastat reports and benefit from the dynamic financial reports engine.
Incoterms have been move to account, as we want to provide a light intrastat report for people not having the stock app installed

Was task: 35850
Was PR #23805
2018-07-26 02:18:37 +02:00
Pratima GuptaandMitali Patel 0d83edc9b0 [IMP] account, l10n_be_invoice: make templates more modern and updated with Odoo guidelines
In this commit we improve templates used in account and l10n_be. Purpose of this
commit is to have templates that embed or use standard Odoo email layouts to
make them look modern and have a common style across all emails.

Main guidelines

 * better use of div / p / br to try to lessen layout issues, especially
   when updating templates using the editor;
 * correctly sequence the templates fields definition;
 * correctly set templates values notably auto_delete and user_signature
   fields to avoid confusion;
 * correctly layout the email content using light notification email. It
   can either propagate the layout choice through various send mail methods
   or directly embed the styling in the templates for more technical or
   complex templates;
 * use email_formatted computed field when possible to avoid having hand-made
   from / to addresses;
 * fix various typos and improve subjects when necessary;

Content of emails is not necessarily updated as the purpose of this task is
about styling, not content itself.

This commit is linked to task ID 1843395 and 1843376 (and 1868112) and to
PR #25294 and #25349 (and #25889).

Co-Authored-By: Mitali Patel <mpa@odoo.com>
2018-07-24 15:33:22 +02:00
Thibault Delavallée 14a3fd6018 [REF] account: clean send by email template
Purpose

 * use the new notification template allowing to display the payment button
   only in emails;
 * reorder the fields definition to ease the reading;
 * slightly clean the email body using a maximum of div and br tags as it
   seems better integrated with Odoo edition capabilities;

This commit is linked to task ID 1860049 and PR #25824.
2018-07-19 17:14:33 +02:00
Christophe Simonis 2ab7ad8361 [MERGE] forward port branch saas-11.3 up to c00df14654 2018-06-07 11:43:07 +02:00
Sanjay Jamod a4df9f8c93 [IMP] account: vendor bill creation upon email reception
This allows to set up a mail alias per purchase journal. Then share that email address to your supplier, or use it internally to forward the vendor bills received by mail, to automatically create an empty vendor bill with the mail attachments linked, and the partner might be filled if the source email matches a supplier.

Thanks to the document preview on the side, it's now super easy and super fast to copy the vendor bill info from the received PDF into the account.invoice object. This would eventually be improved later on (IAP).

Was task: 37703
Was PR #22158
2018-06-06 14:17:03 +02:00
Christophe Simonis aba8c2b8fb [MERGE] forward port branch 11.0 up to 1b272a2050 2018-06-05 16:27:49 +02:00
len-odoo 42aff92a4e [FIX] account, purchase, sale: properly quote the name of the email sender
formataddr (from the email python library) writes email_from as '"name" <email>'
in the email_from field of the mail.compose.message record.
When the mail is rendered, onchange_template_id is triggered.
This then overwrites the values of email_from among other fields.
What happens is that it uses the email_from field from the template to render
the email_from, bypassing what was put by formataddr before.
What happens in some cases is that it is rendered as 'name <email>'
(note the quotes have been stripped away).
If name contains arbitrary symbols, e.g. name = 'pépé [company] <pdg>, ohlala',
then getaddresses which is supposed to parse the (name, email) pairs gets thrown
off (in particular, <pdg> will be interpreted as an email address, and many
other problems with the various special symbols).
It then gives these wrong elements as email addresses, which will usually crash
when getting non-ascii symbols (i.e. these strings don't respect the relevant
RFC for email addresses).

Closes:
https://github.com/odoo/odoo/issues/23502
https://github.com/odoo/odoo/pull/2311823118

opw 815202
opw 1824243
2018-06-01 13:06:09 +02:00
Christophe Simonis 3ab25b60bc [MERGE] forward port branch saas-15 up to cae950e826 2018-04-23 17:59:59 +02:00
Goffin Simon 4ac10f20c4 [FIX] account, purchase, sale: Wrong company displayed in the footer
Steps to reproduce the bug:

- Set a multi company environment with two company A and B
- Set user admin in company A
- Set user demo in company B
- Create a PO with user demo
- Send a RFQ

Bug:

The company of the admin user was displayed in the footer of the email.

The function _notify called on res.parter model is called in sudo by
the function _notify on mail.message model.

The function render_template on mail.template model uses the user defined
on self.env to render the template. So the user admin was always used.

opw:1835647
2018-04-23 09:33:22 +02:00
qdp-odoo c410911ad9 [REV] account: revert feature to create recurrent vendor bills
This reverts commit 7642754122.

The reason is that we finally decided to implement that in another way and we want to avoid people start using this feature as it would be replaced in next saas. Yes, I know, that sucks.

New task ID: 1823153
2018-03-05 15:46:24 +01:00
Christophe Simonis 36945a5853 [MERGE] forward port branch 11.0 up to c2e878e34c 2018-03-01 19:43:25 +01:00
Christophe Simonis 9d25cc3429 [FIX] *: correcly format amounts in mail templates 2018-02-28 19:01:35 +01:00
Thibault Delavallée 885e7fcda9 [REF] various: use secondary notification template
All those templates are basically the same except some bug fixes that
were not propagated about company. Let us use just the one we just
defined in the mail module.
2018-01-29 16:56:04 +01:00
Thibault Delavallée 0f301bec25 [REF] mail: move email notification templates to QWeb
In this commit we change notification templates used to render
notification emails from jinja-based mail.template to pure QWeb
templates.

There are several reasons to do so

 * those are not real mail.template records. Indeed they cannot be used
   outside of the notification process as some values are computed
   and not available on the mail.message record used to render the
   template;
 * we do not really need other fields than body. Indeed fields like
   subject, email_from or email_to are computed from the notification
   process;
 * we do not want people to update the mail.template without knowing
   the consequences, especially for fields like recipients that may
   broke the mail gateway;
 * using the html editor easily break the mail.template as it is very
   custom and very to break without really realizing it.

It also simplifies template management as it lessens number of mail
template people have in their list view of mail.template. It avoids
mixing technical and functional templates.

We move to QWeb templates as those are not too hard to customize and
allow to perform body rendering which is what we really need when
notifying people of a new message.

This commit does not change the functional purpose and layout of the
templates. Behavior should be the same before and after this commit.
2018-01-29 16:48:23 +01:00
Sanjay Jamod 7642754122 [IMP] account: Added feature to create recurrent vendor bills,
- One need to first enable this from Accounting Settings to use this feature
- This feature works for Vendor Bills which are validated/paid
- Once activated, user can see one option in Vendor Bills to set particular record to be recurrent document and can define the recurrency period. This will automatically create draft documents(by mean of Scheduled Actions) as per recurrency configuration.

Was PR #21411. was task 34884.
2018-01-26 16:56:57 +01:00
Nicolas Martinelli ee8e3d6940 [FIX] account, l10n_be_invoice_bba, purchase, repair, sale: format_amount
Use `format_amount` in the mail templates in order to format as a
regular amount (with rounding and symbol).

opw-805370
2018-01-25 11:00:35 +01:00
Kinjal Mehta ae23e7f083 [IMP] account: Add '45 Days' and '2 Months' in payment terms data 2017-11-29 15:42:53 +01:00
Pierre Rousseau c563013f3f [IMP] account: Automatic reverse entry at specific date
Added options to reverse entries automatically based on a cron job.

Was PR #18626. Was task 35012.
2017-11-14 09:14:32 +01:00
Christophe Simonis de987831da [MERGE] forward port branch 11.0 up to d70518d04f 2017-10-21 15:22:36 +02:00
Christophe Simonis 10128fa7e8 [MERGE] forward port branch saas-16 up to dc2a6c6cd2 2017-10-20 19:27:04 +02:00
Christophe Simonis 5ea0f55d65 [MERGE] forward port branch saas-15 up to bee0c11ef7 2017-10-20 17:57:21 +02:00
Christophe Simonis bee0c11ef7 [MERGE] forward port branch saas-14 up to f3ac68ed29 2017-10-20 17:24:15 +02:00
Christophe Simonis f3ac68ed29 [MERGE] forward port branch 10.0 up to e2532f855f 2017-10-20 16:09:28 +02:00
Lucas Perais (lpe) af6baac9c7 [FIX] account, sale: fix notification templates inline style
Before this commit, Sale order and invoice notification email templates broke when doing any action on them (duplicating, open preview etc...)
This is because the model is saved during those operation, and the css style gets converted to inline style.
The table tag present in those templates, was wrongly associated with the bootstrap rule for tables, collapsing their border, hence the break of the templates.

After this commit, we force the borders not to collapse, and the templates don't break

OPW 774323
2017-10-20 09:09:04 +02:00
Thibault Delavallée 4fd6945535 [REM] base, various: remove res.request.link
Not used since a while, remaining of old res.request. Requests have been
removed at 881a76dbcf . Links have been kept because still
used in some reference fields. It seems the last use was in OpenERP v9.0
in crm_claim module. As links are not used since a while let us get rid of
it.
2017-10-19 14:53:39 +02:00
qdp-odoo f9dc8cf76d [FIX] account: email template name changed (again)
As per discussion on commit https://github.com/odoo/odoo/commit/48a8d68194c4802320984cbd487ccd650e1bb096#diff-356151c8ac0f23574964c7c9da863c70, I add the App name in the template name.
2017-09-29 15:43:40 +02:00
Lucas Perais (lpe) 2fcb780a01 [FIX] account: enforce simple res.partner form on send receipt
Before this commit, when Sending the receipt by email (payments) the full partner form was displayed in case the partner didn't have an email set.

Now, just like invoices, the simpler version is displayed
2017-09-29 13:30:17 +02:00
Prakash Prajapati 48a8d68194 [FIX] account: email template name change 2017-09-29 11:03:44 +02:00
Thibault Delavallée 6c7e128b33 [IMP] account: add invoice page view on customer portal
This commit adds a page view for invoices on the customer portal. Layout
is based on the invoice report to closely match what is already done in
Odoo. It replaces the old controller that returned only the pdf.
Customers should now be able to receive both.

Future commits will improve invoice page view notably in account_payment
while adding payment options in account customer portal.
2017-08-25 15:33:18 +02:00
Thibault Delavallée 4e11d2fcb0 [CLN] account: perform some guidelining and cleaning
* rename some files according to guidelines;
 * clean template name to clean their ordering and ease template browsing;
 * use html type for mail templates body instead of cdata;
 * clean html for mail templates introduced at 96da10de6cc20486b3e37fd4c6c88eb61cbb919c;

No horse has been harmed and no functional change performed.
2017-08-25 11:41:41 +02:00
jpr-odoo 711455f9b9 [IMP] account: Print payment receipts from Print menu.
PURPOSE
=======

Users don't find where to print the payment receipts because it's under the `Action` menu

SPECIFICATION
=============

Allow to print the payment receipt pdf directly from the print menu
2017-07-10 14:07:56 +02:00
Denis Vermylen 7dd6225f0b [IMP] mail, account, sale: improve sales order mail link
Mail now can handles a generic access_token in /mail/view route. Mail does
not do anything with it. Addons can override the controller and add their
specific management of this token according to some specific business
logic.

Sale order emails now contains the access token to grant access from the
notification email url without logging in. Sale portal now allow customers
to log in using an access token without having to use Online Quote. If
the user doesn't have an account yet and signup is allowed (B2C) an extra
parameter is added to the url to link the correct partner to the user upon
signup. If the user already has an account an extra parameter is added to
auto-fill the user's login if he wants to login from that session.

Account is also updated to prepare accepting access tokens. However the
complete implementation of accounting customer portal will be done in
another task coming soon.
2017-07-06 12:53:39 +02:00
Thibault Delavallée dbe6aa4292 [FIX] account: finally allows to reinit the module
Otherwise a constraint is raised because new line are added to the
payment term instead of recreating them from scratch. This constraint
blocks people from reinitializing the module, which is quite boring
when developing.
2017-05-10 17:09:29 +02:00
Laurent Smet 3425752eac [REM] odoo/report: remove deprecated stuff
- RML Reports
- Webkit Reports (most part already removed by 13b9982c62)
- LocalService in netsvc.py
- rename attributes like rml_% to report_%
- rename ir.actions.report.xml to ir.actions.report
- allow rendering directly on an ir.actions.report by calling render method
- remove 'controller' report_type
- remove unused res.font stuff
- remove print_report method in models.py (not used)
- restore removed call to pdftotext process in test_reports
2017-05-08 09:22:56 +02:00
dbh 4b074ca11c [IMP] account: rename 'Refund' to 'Credit Note' 2017-05-04 16:05:32 +02:00
Thibault Delavallée a4c76239fd [IMP] account: fix link and redirection in invoice email
Currently the link is always the website link once website_portal is
installed. However it is better to use the generic /mail/view controller
that chooses the right redirection depending on the user trying to access
the document.
2017-04-25 14:10:54 +02:00
Christophe Simonis 68176d80ad [MERGE] forward port branch saas-14 up to eddefc9948 2017-03-01 16:49:15 +01:00
Christophe Simonis 85368d7f86 [MERGE] forward port branch 10.0 up to 387b2acfcb 2017-02-23 20:15:38 +01:00
Nicolas Martinelli 7a03f9ce93 [FIX] web, sale, account: company logo
The notification mail template of a SO and an Invoice displays the logo
of the company. However, the logo is always the logo of the superuser's
company.

When accessing the logo from an email client, the UID is not defined.
Therefore, we fall back on the superuser, and display the logo of his
company.

We add the support of a `company` key in the kwargs, so we can force the
company from which we retrieve the logo. Note that this key was used
elsewhere, such as:

addons/web/static/src/js/web_client.js

opw-705420
2017-02-14 12:14:23 +01:00
Denis Ledoux 41ffb5032b [FIX] mail, sale, account: company used in notification emails
The `user` variable in the mail templates is the `self.env.user`,
https://github.com/odoo/odoo/blob/10.0/addons/mail/models/mail_template.py#L370

which will always be the administrator in the use case
of a notification email
https://github.com/odoo/odoo/blob/10.0/addons/mail/models/res_partner.py#L151-L156

Using `user.company_id` to determine the company of the sales order
or the invoice is therefore wrong, as it will always be the administrator
company, which can be different than the order/invoice company.

opw-706267
2017-02-13 15:18:23 +01:00
Christophe Simonis a282d4ae7f [MERGE] forward port branch saas-14 up to be9dfb331f 2017-02-10 18:41:06 +01:00