Commit Graph
76 Commits
Author SHA1 Message Date
Louis Baudoux 76f6257b6e [IMP] crm_iap_enrich,iap_mail,snailmail: improve IAP notification system
The old implementation had some inconsistencies and didn't allow to have
general error notifications, it was only meant for credit error
notifications.

The notification/log messages of lead enrichment were also improved as
some of them were unclear.

closes odoo/odoo#132233

Related: odoo/enterprise#44488
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
2023-09-04 15:02:50 +00:00
william-andre dc4dcead6e [IMP] base: add more support for sub companies
Add fields and tooling to support sub companies.
The new fields are
* `parent_ids`, which consists of all the ancestors of the current
  company
* `root_id`, the upmost parent, which is the company controlling the
  subsidiaries
* `parent_path` is added to avoid a hit on the performances when using
  the multibranch feature

Also add a mechanism to ensure some fields are shared with a root
company and all it's descendents.
All fields listed by `_get_company_root_delegated_field_names` will be
readonly and copied from the `root_id`.

task-3371677

Part-of: odoo/odoo#125642
2023-07-20 11:49:04 +02:00
Rémy Voet (ryv) c5cb357d90 [IMP] *: add dependencies to display_name field
The previous commit introduced an optimization to reduce the number of
queries and fields fetched when we call `name_search`. But it works much
better when the dependencies of `display_name` contain field names used
in the calculation (on the same record/model).

Then, to improve the performance and the cache coherency, add `depends`
and `depends_context` depending on the custom `_compute_display_name`.
Add only the first level of dependencies (never traverse relational
field) because only these have a positive impact on the previous
optimization and the cost is very low (see `modified`).
About `depends_context`, we don't include `lang` because (when `_` is
used by example) it is unlikely to get the same display_name in the same
request with two different lang.

closes odoo/odoo#122085

Related: odoo/documentation#4639
Related: odoo/enterprise#42599
Related: odoo/upgrade#4780
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-06-28 17:41:19 +02:00
Rémy Voet (ryv) 3c62ca1eb9 [REM] core: remove name_get API
Rationale
=========

Since v8, the `display_name` field is present on all models. By default,
`display_name` uses `name_get` which has pretty much the same purpose
(return record name used by the web client). Gradually, many (backend)
developers (and the ORM: https://github.com/odoo/odoo/commit/6da1c3ac4c036eac289597602976538e243cb939)
started using `display_name` (more convenient than
`record.name_get()[0][1]`) but it still had the `name_get` override.
It becomes more complex than necessary and poeple start to misunderstand
the two (and sometimes override both, leading to inconstiencies between
`display_name`/`name_get`).

To simplify the ORM and the API, we decided to keep only one of them,
the `display_name` field:
- It is much more convenient from a backend point of view
(`record.name_get()[0][1]` vs `record.display_name`)
- It is cached during the same transaction (and invalidated if
its dependencies change)
- It can be overridden like any other compute field (override
`_compute_display_name` with any extra dependencies)
- `name_get` is replaced by `read(['display_name'])`
(API perceptive), which can actually be more efficient
(if `display_name`'s depends are correct, the ORM will only fetch the
fields it needs instead of every prefetchable field)

Changes
=======

- Deprecates `name_get` for the v17 and based the method on
`display_name` (the opposite of before)
- Converts all usage of `name_get`
- Overrides of `name_get` are now overrides of `_compute_display_name`
- For `res.partner`, rename the field store `display_name` into
`complete_name` because `display_name` context-dependent and it makes
no sense to have a compute store that is context-dependent.
- Previously, it was possible to return multiple names for the same
record with `name_get`, but it was tricky and most of the usage of
this `name_get` didn't take this into account. The only example of
this is the `name_get` of `product.product`
(now use `", ".join(<names>)`).

Part-of: odoo/odoo#122085
2023-06-28 17:41:19 +02:00
Denis Ledoux 15e2aebcf4 [FIX] snailmail: accurate error message when no access to the attachment
This revision follows
- odoo/odoo@5e81850ea6
- odoo/enterprise@e484b4da0c
2023-04-26 13:53:54 +02:00
Solan Delvenne (sode) 4f72cfcc94 [FIX] snailmail: Fix an error with invoice address
If an user tries sending a invoice using an invoice address and a
delivery address through snailmail, it would result in a traceback.
This is due to the invoice address record not having a name.

closes odoo/odoo#114227

X-original-commit: eceb23b1835b3d039759eb7431950f221ac1fb6e
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-07 09:02:55 +01:00
Laurent Smet 955091e707 [IMP] account*: send&print with documents
Refactoring send&print wizard.
==============================

Main reason for this commit is that we want to let the user
decide when to generate the relevant documents / approvals
for its invoices. The natural choice is when the information
leaves Odoo. So now, each time the users decide to
download/send its invoices, he will be able to select the
relevant documents to be generated and the approvals to be
requested from the send&print wizard.

This used to happen automatically during the posting with lots
of undesirable behaviors (difficulty to update/revert, hard to
know exactly what will happen,...)

Main changes:

1/ Send&print wizard

- The model 'account.invoice.send' has been replaced by
'account.move.send' and became models.Model to handle
asynchrounous generation of documents (webservice,..) in
case of more than one invoice.

- The wizard is meant to be overriden in order to add
checkbox and document to be generated. A comprehensive exemple
can be found in account_edi_ubl_cii.

2/ Import invoice from attachments

- The decoding logic has moved from account_edi to account
on the attachemnts.

- The function _extend_with_attachments() serve as a common
entry point for import (from chatter, dashboard).

3/ Export invoice pdf / document

- All the specific actions to export attachments should be
implemented on the account.move and called from the wizard in
 _generate_documents()

- The official pdf for the invoice is now only generated once
 the user request it. In order to regenerate the pdf and
documents, it needs to be deleted.

task-id: 3117238
[enterprise](https://github.com/odoo/enterprise/pull/36757)
[community](https://github.com/odoo/odoo/pull/111857
)

[IMP] web: enable close on ir.actions.act_url in wizard

Before this commit, calling ir.actions.act_url on a modal
leaves the modal open. Which feels ackward in the send&print
wizard.

We now enable 'close' parameter on ir.actions.act_url. If set,
the wizard will close after act_url.

closes odoo/odoo#111857

Related: odoo/enterprise#36757
Related: odoo/upgrade#4387
Signed-off-by: Laurent Smet <las@odoo.com>
2023-03-03 19:10:10 +01:00
niyasraphy 123912784b [IMP] snailmail: add missing value to selection field
From _snailmail_create function the value passed to error_code selection field
is ATTACHMENT_ERROR. However it is not existing the selection field.

In this commit we add the missing value to selection field.

closes odoo/odoo#108226

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-02 10:53:54 +01:00
Solan Delvenne (sode) ee65a44218 [FIX] snailmail: overwrite margins in letters
In order to pass the validation of the snailmail provider, the margins
are required to have nothing but white pixels. To avoid letters being
stuck until their layout is fixed, we fill the margins with white.

closes odoo/odoo#107180

X-original-commit: 206eb42468997d23b9b998530d246aa0bc69607d
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Louis Baudoux (lba) <lba@odoo.com>
Signed-off-by: Solan Delvenne (sode) <sode@odoo.com>
2022-12-03 02:23:07 +01:00
Solan Delvenne (sode) 93fb62edb1 [IMP] snailmail: Send an error when using non-A4 paperformat.
Since the provider only accepts A4 letters, prevent the user from using
non A4 formats by giving them an error when clicking the Send button.

closes odoo/odoo#105725

X-original-commit: 452882f4534cb55546bcf19e93390067e1337f6f
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Solan Delvenne (sode) <sode@odoo.com>
2022-11-15 10:34:12 +01:00
Solan Delvenne (sode) c7bc8e80c0 [FIX] snailmail: Force english locale on snail-mails
Pingen does not support localized country names, as such we need to force English locale.

closes odoo/odoo#105456

X-original-commit: e0233bff032c722cb309357c4b329bf9fe1aae43
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Solan Delvenne (sode) <sode@odoo.com>
2022-11-10 21:16:16 +01:00
Solan Delvenne (sode) 9b0c42574c [FIX] snailmail: Fix name not appearing on snailmail cover
closes odoo/odoo#104556

X-original-commit: 1d35394f260e5ffa9fc6af834e9c429909ab29ae
Signed-off-by: Louis Baudoux (lba) <lba@odoo.com>
Signed-off-by: Solan Delvenne (sode) <sode@odoo.com>
2022-11-03 15:42:50 +01:00
Solan Delvenne (sode) 08deba16b3 [IMP] snailmail: Generate a cover page if the "Cover Page" option is turned on
Pingen's v2 API does not offer an endpoint to generate a Cover Page automatically with an API call anymore, thus the need to generate it and append it to the invoice from the client-side beforehand.

X-original-commit: 13f934cebc35511f8ba587b9d07a658bf7c1e640
Part-of: odoo/odoo#103806
2022-10-28 14:20:53 +02:00
Arthur (goa) a9702cee39 [FIX] snailmail: dont resend without credits
We are spammed by some accounts that don't have credits anymore.

With this commit, when we try to send letters from the cron, whenever we
meet the CREDIT_ERROR error_code, we stop trying to send the letter.

task-2930455

closes odoo/odoo#103530

X-original-commit: f1fed40e2f853ecd9e5c24e0882c67f9505155c2
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
2022-10-20 17:16:58 +02:00
Laurent Desausoi 7593c073d2 [IMP] core: use inert SQL based neutralization
Before this commit the neutralize system introduced in v16 was using ORM
methods in order to change appropriate records. Although flexible, this approach
could lead to call some methods with side effects while neutralizing
(eg: overloads of write).

This patch converts the neutralize system to a safer "inert" SQL based approach
by migrating the generic method _neutralize to SQL files exposed in the
data folder.

Task id: 2961687

closes odoo/odoo#102792

X-original-commit: e5dbded9bb363351feff7ca8a56c7f8a6860f492
Related: odoo/enterprise#32580
Signed-off-by: Fabien Meghazi <fme@odoo.com>
2022-10-09 22:04:00 +02:00
Martin Trigaux ffc525419a [IMP] base: avoid render with env mixup
The render API was confusing as mixing the access to the report and
the rendering env.

The ambiguity was present for code such as
`report.sudo()._render(record_ids)` where it was not clear if the
`sudo()` is needed to access to `report` or to `record_ids`. For low
priviledge users (such as portal or public), it was common to use
`report.with_user(SUPERUSER_ID)._render(record_ids)`.

This PR changes the render methods signature to be `api.model`. The
`report_ref` can be:
- ir.actions.report external id
- ir.actions.report id
- ir.actions.report recod
- `report_name` value

This will allow to call the report methods with any user and no longer
need to use `with_user(1)` to render reports as public user.

Task-id 2670865

closes odoo/odoo#91341

Related: odoo/upgrade#3650
Related: odoo/enterprise#27323
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-08-02 11:48:46 +02:00
Pierre-Yves Dufays eca543ef40 [REM] mail, sms, snailmail: discard notifications without confirmation
Skip the confirmation step when wanting to get rid of a notification
for emails, sms or letters that were not sent.

Technical:
- All 3 wizards to confirm the discarding of the notification have been removed
(the ones for mail, sms and letter) have been removed
- The method to discard notification has been centralized in MailThread
(notify_cancel_by_type in addons/mail/models/mail_thread.py)
- This centralization has been done as well on the client code as the same
server code is called whether it is a mail, a sms or a letter
(in addons/mail/static/src/models/notification_group/notification_group.js)
- Existing front and back test have been adapted
- A test of notify_cancel_by_type for mail has been added
(addons/test_mail/tests/test_mail_management.py)
- add missing author_id in mail_notification demo data

Task-2752190

closes odoo/odoo#84452

Related: odoo/upgrade#3246
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-01 17:56:20 +02:00
Gorash 880954ebfc [IMP] *: remove _render from ir.ui.view and simplify report
There were inconsistencies in the calls to `_render`.
* the view context could contain information that misled developers.
Indeed, the context and value of the view are not supposed to be found
in the rendering. Thus by calling `ir.qweb` with the name of the
template, we ensure that there is no unwanted information and in
addition the cache key is that of the name of the template which saves
a query.
* the context used for rendering was modified by a method on
`ir.ui.view`, except this is not information used by this model. There
is now a `_prepare_environment` method residing on `ir.qweb`. This
method allows to modify the value dictionary as well as the context in
which the rendering will be done. This preparation of the data as well
as my security check is done only once per rendering. This also saves
some queries
* Freeze options for rendering were inconsistent. It could be that
options on which rendering depends were not part of the cache key. Thus,
depending on the user who generated the generation of the rendering
function, there was or was not information in the template. For example
for automatic branding. This is no longer possible, because it is the
context that is used. The options serving as a cache key are only
recorded for information (for the profiling system for example). A
simplification of the `ir.qweb.field` models could be made.

The report rendering and call `ir.qweb` instead of `ir.ui.view`.

Part-of: odoo/odoo#85110
2022-03-29 10:56:15 +02:00
Dominik Zians 7111c9b404 [FIX] snailmail: change error code when timeout
When the snailmail API-call timed out, the SnailmailLetter.state and SnailmailLetter.error_code were not changed, which resulted in an infinite loop of retries  via the "Snailmail: process letters queue" cron job.
This commit changes this behavior: On a timeout the SnailmailLetter.error_code is changed such that no retry happens. Following stable policy, no timeout error is added, but 'unknown error' will be used. Preventing retries on timeout is mandatory as timed-out request are indeed processed by IAP and customer credited.

closes odoo/odoo#84263

X-original-commit: b3c46e8050e9405e69cfbe9c49706a22007e10ba
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Zians Dominik (dozi) <dozi@odoo.com>
2022-02-15 16:51:15 +00:00
Sébastien Theys 47bda95b98 [FIX] mail, sms, snailmail: fix perf of fetching failures of user
We are currently lacking an index with (author, failure) due to the information
being spread out in two different tables which are both rather big (there are a
lot of non-failure messages for the current user, as well as a lot of failure
messages for other users), so the fetch of failures for the current user can
become extremely slow (> 20s).

With this new index, the query takes less than 1ms.

task-2742946

closes odoo/odoo#83451

Related: odoo/upgrade#3204
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-01 18:07:02 +00:00
Christophe Monniez 4fc7b9e329 [IMP] iap, various: implement _neutralize method
An overridable model method was added in a previous commit in order to
neutralize a database.

This commit adds the implementation of this method on the `iap.account` model.
A _get_iap_config_paremeters method is also added on this model.
Each iap service must override this method to extend the list of
`ir.config_parameter` that need to be neutralized.

Part-of: odoo/odoo#67825
2022-02-01 09:54:08 +00:00
Raphael Collet a1904aa6f6 [IMP] core: field index names
The possible index names have been renamed "btree", "btree_not_null"
(instead of "not null") and "trigram" (instead of "gin").

Task 2742526

Part-of: odoo/odoo#83274
2022-01-28 14:10:01 +00:00
Prakash PrajapatiandNisha Patel fe86b687a6 [IMP] snail(mail),crm_(iap)_lead_enrich: improve the iap notification
The purpose of this task is to use the notification which we currently
have for partner autocomplete and to generalize it to our other IAP
services.

So in this commit, we improve the iap notification for the below views
-> we display a toast in green when the request was successfully completed
   (and the  user has enough credits).
 - when a letter is sent in batch from the list view
 - when leads are enriched in batch from the list view
-> we display a toast in orange when the user doesn't have enough
   credits with a corresponding 'buy credits' link to the service.
 - when a letter is sent in batch from the list view
 - when leads are enriched in batch from the list view or when
   clicking on 'enrich' from the form view
 - when creating a new lead mining request

task-2185306
closes odoo/odoo#66977

Related: odoo/enterprise#16736
Signed-off-by: Arnaud Joset <arj@odoo.com>
Co-authored-by: Nisha Patel <nit@odoo.com>
2022-01-21 15:03:57 +00:00
Fabien Pinckaers eedf37d6e2 [IMP] Better handling of indexes
Three supported types:
- btree (default for index=True)
- btree not null (when >90% of the data are null)
- gin trigram search (for char fields)

Review of indexes on all objects.

closes odoo/odoo#83015

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-01-19 16:52:23 +00:00
Martin Trigaux a8e50921af [FIX] *: correct typos and English errors
closes odoo/odoo#80181

X-original-commit: efd178daee689192d4e930a075475587038b3e0d
Related: odoo/enterprise#22439
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-22 14:48:04 +00:00
fda-odoo f5f0752f88 [FIX] snailmail: avoid timeout issue
_snailmail_print can be called on multiple letters, and this can lead to a timeout from IAP Service. However, letters are sent, credits are consumed, but letters aren't marked as sent. To avoid that, we force the sending to IAP service to be done letter by letter.

closes odoo/odoo#68107

X-original-commit: 3d8ad1e68583fa1b354ff36f902ccb0405270bb2
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2021-03-18 16:20:07 +00:00
Victor Feyens e045e5d925 [IMP] snailmail: create notifications in batch
UDPATE ME

Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
2020-12-03 10:18:53 +00:00
Victor Feyens 646457d761 [IMP] mail, digest, fetchmail, hr_holidays, snailmail: support batch creation
See merge commit for more details.

Note that mail.alias model will be done in a separate commit.

Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
2020-12-03 10:18:47 +00:00
Thibault Delavallée fcd10b3691 [REF] iap, various: reorganize IAP module organization
PURPOSE

Clean and improve IAP tools integration in Odoo. Introduce bridge modules
to extract common features, notably for CRM and Partner.

SPECIFICATIONS

In this commit we reorganize IAP module to better understand its content
and ease future cleaning

  * have models separated from tools;
  * rename some tools to find their grep. An iap_ prefix is added to ensure
    we don't clash with other global functions or methods;
  * perform some linting;

To provide backward compatibility support we keep some import in init file of
IAP addon. Standard code is about to be updated but we want to avoid too
much issues when migrating code to 13.5 . Compatibility layer will be removed
after v14 final freeze.

LINKS

Task ID-2248367
Community PR odoo/odoo#53214
Enterprise PR odoo/enterprise#11258
Upgrade PR odoo/upgrade#1363
IAP PR odoo/iap-apps#191
2020-08-18 11:41:59 +00:00
Rémi Rahir 40de7e6555 [FIX] snailmail: avoid resending letters on rollback
Up until now, the cron would send letters by batch on a single call with
15 secs timeout which is unfortunately insufficient to have an answer
from the IAP server.
The cron would therefore fail and would end up trying to resend the same
letters again and again even if each call had reached the IAP server and that the
letters were actually processed.

FW port of 61c10c5c9bb3f0d3c2d01bcb1798d03996217585

closes odoo/odoo#56050

X-original-commit: b34d2905ba11ee5bddd1efd2121595a4bdc304c4
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2020-08-18 11:15:47 +00:00
Florent de Labarre da040be14f [FIX] snailmail: get_param return a string
timeout should be an integer

closes odoo/odoo#55103

closes odoo/odoo#55586

X-original-commit: 9dbc3e3807750ae471b8ede61674ce05ca30c0cf
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-08-06 15:36:11 +00:00
Anh Thao Pham (pta) 87be1ab6c4 [FIX] snailmail: allow to configure timeout for snailmail
When sending a letter with a PDF containing pictures, it could happen that the default timeout of 15s is too short.

Parameter "snailmail.timeout" has been added to allow configuration of this timeout.
Also a default value of 30s has been set instead of 15s.

opw-2276125

closes odoo/odoo#55415

X-original-commit: 796373ae674248cb96c576ccb968d7f19a732317
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-08-04 15:23:16 +00:00
Martin Trigaux 400cc4f14e [FIX] *: correct all or improve code translation lookup
This commit fixes all issues detected by the new pylint
gettext-variable test.
It converts some calls to the new syntax
  _("Foo %s", bar)

to progressively migrate the code to the new syntax.

A few calls were not technically incorrect but still detected by the
linter.

  _("Foo" +
    "Bar")

has been converted to

  _("Foo"
    "Bar")

as it has the same effect and make sure the argument is of type
asteroid.Const instead of BinOp).

closes odoo/odoo#53683

Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-06-30 10:19:59 +00:00
Rémi Rahir 687a845cdb [FIX] snailmail: fix error translations
The string formating was called inside _() which does not work.

closes odoo/odoo#53781

X-original-commit: aef420570ca153da34796a80d3e22193f17c2cf0
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2020-06-29 12:09:25 +00:00
Martin Trigaux d9287caf94 [IMP] *: convert to private methods
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id

Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
2020-05-14 13:59:10 +02:00
Victor Feyens db79d20a1d [IMP] snailmail: res.partner write performance
Do not loop through the partners, doing the same stuff n times, and
potentially doing multiple searches when one is enough.

X-original-commit: 35713d2ff46dcfc4a578c41dad6f786919754ca2
2020-04-30 12:33:42 +02:00
Sébastien Theys dea52493b8 [IMP] mail, sms, snailmail, test_mail_full: adapt mail.notification
The purpose is to have more common code for failure and notifications, with less
override in `sms` and `snailmail`.

task-2176017

closes odoo/odoo#44170

Related: odoo/enterprise#9140
Related: odoo/upgrade#918
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-04-17 12:17:57 +00:00
Adrian Torres 1daf8eb127 [FIX] *: set ondelete policy of required Selection fields
With this commit, Selection fields with `required=True` which are
extended via `selection_add` are given proper ondelete policies to
ensure the cleanup of records containing these extended options during
uninstall of the extending module.

This commit also cleans up leftover uninstall hooks that were being used
to handle the same set of problems prior to the ondelete mechanism being
implemented for Selection fields.

closes odoo/odoo#46325

Related: odoo/enterprise#9117
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-03-30 13:42:04 +00:00
Christophe Simonis 58a83d1222 [MERGE] forward port branch saas-12.4 up to 4a1321bc99
closes odoo/odoo#37127

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-20 14:33:54 +00:00
Christophe Simonis 080f8b1f96 [MERGE] forward port branch saas-12.3 up to d8ce75466e 2019-09-17 17:49:09 +02:00
Rémi Rahir 3f401e3e2f [FIX] snailmail: do not decode null objects
Prior to this commit, we would try to decode the logo of a company
without any verification on its presence. If the logo was not set, we'd
try to decode nothing which caused a crash.

This commit ensure that we asert that the field is set before trying to
encode it for a JSON payload.

closes odoo/odoo#36784

X-original-commit: f40f763831bace8c499072ea81ef9bbd5fc910e4
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-12 13:21:48 +00:00
Vincent Schippefilt cc9467b750 [FIX] snailmail: support write with multiple records 2019-09-18 11:31:43 +00:00
Christophe Simonis 5b2f64fd5d [MERGE] forward port branch 12.0 up to 4870251f0b 2019-06-14 10:15:49 +02:00
Christophe Simonis 25e3f27062 [MERGE] forward port branch saas-12.3 up to 48a9f5a633 2019-06-17 13:20:35 +02:00
Pierre Rousseau 4c7f236fb5 [FIX] snailmail: re-render report when using snailmail
If the option 'Reload from attachment' is checked for a report, it will be generated from the existing attachments.
However, for snailmail, we have to force the re-rendering to apply specific css rules to match the layout of a A4 letter.

Task-ID: 2008896

closes odoo/odoo#34053

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2019-06-12 11:31:26 +00:00
Christophe Simonis 71a50a2214 [MERGE] forward port branch saas-12.3 up to 409679866b 2019-06-06 11:54:35 +02:00
Pierre Rousseau 743434cb2e [FIX] snailmail: send the contact_address
Before this commit, the param contact_address was not sent to the service. However, the service need it to correctly send the letter if the format is wrong.

OPW-1981168

closes odoo/odoo#33855

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2019-06-04 07:03:36 +00:00
Thanh Dodeur c212cfe899 [REF] *: removes datas_fname from ir.attachment
This commit removes the field `datas_fname` from `ir.attachment` as
it was unnecessary and most of the time the duplicate of `name` or
`url`.

Task #1909865

closes odoo/odoo#32976

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-05 09:12:13 +00:00
Yannick Tivisse f5dfe4727c [IMP] api.py: Rename company_id/company_ids into company/companies
The goal is to be coherent with the user property.

Actually, company_id and company_ids on the environment are no fields.

Calling env.company_id returns a browse record, not an id.
2019-05-29 08:09:15 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00