Commit Graph
108718 Commits
Author SHA1 Message Date
Nicolas Lempereur a0fddebe64 [FIX] base: prevent bin_size/binary visual defect
Changing the address type of a contact in the "Contact & Addresses" tab
could in some instance lead to a dead image (just visually, saving it
would not change it) because the image is set to something like
"data:image/png;base64,5.23 Kb" because of a combination of kanba/form
x2many view, onchange, the differences of field present.

In 9.0 this did not happen because the image was not a field in the form
view corresponding to a contact of the kanban contacts view.

In saa-15 thanks to bf26445 the image_small is different than image in
the kanban view and this got us out of the issue.

In saas-16 it is solved even further because new views only load missing
fields.

This commit just get out of the issue by preventing an update of the
records field (with bin_size which caused the issue of the image) when
opening the modal form view of a contact's contact.

Ideally we should solve this more deeply but this is dangerous code to
change (eg. removing the bin_size would solve it but this was done for a
reason and could affect performances) and the effect is just visual in a
very particular set of factors (if we save the form after the image is
dead, the previous image reappeared).

opw-765952
closes #19491
2017-09-20 13:36:51 +02:00
Nicolas Martinelli dfe96ff38e [FIX] stock: UoM on return lot
- Create a product with:
  Product UoM: kg
  Purchase UoM: lb(s)
  Tracking: By lot(s)
- Purchase 100 lb(s), validate and receive picking (set lot 001)
- Return the picking
- Set the lot

The quantity to do is 45.36 instead of 100.

We make sure to convert the quant UoM (=Product UoM) into the
appropriate UoM.

opw-771930
2017-09-20 10:15:23 +02:00
Nicolas Lempereur 6252c21000 [FIX] web: modifiers computed when x2many ready
Modifiers (eg. required, readonly, ... on a field) are computed after a
record has been changed. When loading a record they could be computed
based on x2many in a inconsistent state.

eg. on res.partner form, by defaut the email is required depending on:
        [('user_ids','!=', [])]
    but when switching from one record to another this was computed
    wrongly based on the difference between the two records.

This change make the x2many when loading a record ready to be used as
soon as it is set to solve this issue.

forward-port: not needed after saas-15 thanks to framework views rewrite

fix #18239
opw-749483
closes #18815
2017-09-19 17:49:43 +02:00
Laurent Mignon (ACSONE) e34f6aaa26 [FIX] stock: procurements must be confirmed with the right company
The method _procure_orderpoint_confirm in stock/procurement is calld in sudo() by run_scheduler.
Even if this method receives the company as parameter, the company is not enforced for all
the processes trigerred into the method. i.e. If a PO is generated by the run of the procurements
the sequence used is the one of the admin's company and not the one for the given company.
To enforce the company to use, we force the company into the context if it's not the same as
the user's company.

opw:771851
2017-09-19 17:25:27 +02:00
Fabien Meghazi f234376034 [FIX] bus: compatibility with Odoo's PAAS external long polling handler
Add a `peek` option in the bus event dispatcher polling in order to let
an external event dispatcher fetch the notifications and their
corresponding channels.

Cherry-pick of rev. f2f99dc091
2017-09-19 16:57:00 +02:00
Fabien Meghazi 4e9b5e8f23 [FIX] bus: compatibility with Odoo's PAAS external long polling handler
Only start the bus events dispatcher when needed (lazy starting).
On Odoo PAAS it's never started because the platform has its own event
dispatcher.

Cherry-pick of rev. a2ed3d3d5b
2017-09-19 16:57:00 +02:00
Nicolas Martinelli 3678cffcf9 [FIX] account: due date
On an invoice:
- Select a partner with payment term defined => due date D1 is set
- Change to a partner withour payment term defined

The due date D1 is kept.

opw-772063
2017-09-19 10:17:38 +02:00
Goffin Simon 875dd9221f [FIX] account, website_portal_sale: _generate_and_pay_invoice in other currency
When paying in other currency that the one defined  in the company, it
generates a payment which has to be in the currency of the transaction.
Otherwise it will generate an invoice which won't be completely paid.

opw:769278
2017-09-19 00:04:24 +02:00
Nicolas Martinelli 58c5b1cfd8 [FIX] payment: onchange partner
- Go in Accounting > Sales > Payment
- Fill the mandatory info, and create a "Payment Transaction"
- On the form view, change the Partner
- The Customer Details are empty, and saving is not possible since the
  country (mandatory) is not filled in

Closes #15708
opw-771753
2017-09-18 10:51:51 +02:00
Nicolas Martinelli 6b511f38c0 [FIX] point_of_sale: format date on receipt
The date printed on the receipt is not printed according to the language
settings.

opw-769862
2017-09-18 10:03:27 +02:00
Odoo Translation Bot c2f2bea6c5 [I18N] Update translation terms from Transifex 2017-09-17 04:40:19 +02:00
Jeremy Kersten 8f99b24f6c [FIX] payment_sips, payment_ogone: remove call to partner_reference.
This field has been removed on transaction model in commit f8a98d9.
2017-09-14 16:27:43 +02:00
Jeremy Kersten 265f9ab509 [FIX] payment_sips: allow to override the default atos url.
Sips is generic, and others services that Atos use the same protocol.
It is not user-friendly, but that allow user to use alternative service
like 'Sogenactif'.

In next version, we need to add field on config to specify it and the
InterfaceVersion that can differ according to the provider.
2017-09-14 16:27:43 +02:00
Cédric Pigeon bf8f701032 [FIX] purchase: multiple backorders
Avoid crash if multiple backorders are found.

Closes #19452
opw-771732
2017-09-14 15:16:57 +02:00
Goffin Simon ce2d00f346 [FIX] account: Register a payment with no sequence for account.payment
When registring a supplier invoice, if no sequence exists for code "account.payment.supplier.invoice"
then it failed for the creation of the counterpart lines because a name is required to create an
account move line.

ps: check function "_get_liquidity_move_line_vals" for the condition.

opw:767224
2017-09-14 11:13:39 +02:00
Lucas Perais ecc7509277 [FIX] account, invoice analysis: negative amounts for in_invoice-like
Before this commit, the invoice analysis report summed the amount of invoices regardless of whether they were in or out,
as if it were an absolute sum.

This commit corrects the behavior back to v9's, where in_invoice have the minus sign and are hence subtracted

opw 769409. Was PR  #19413
2017-09-14 09:56:07 +02:00
Lucas Perais (lpe) c5b9bdcf9f [FIX] website_quote: images of acquirer should be dynamic
Echoes commit c255342e8f

Before this commit, the image that was fetched for the quotes was the static one, preventing it to be changed

Now, the image is dynamically fetched

OPW 769701

closes #19417
2017-09-14 09:53:39 +02:00
Olivier Dony cd26062a38 [FIX] mass_mailing: add missing statistics index
Indexing `mail_mail_id_int` is useful for locating the statistics entry
that should be updated (bounced/opened/replied)
2017-09-13 18:41:54 +02:00
Christophe Simonis 5b69f1a333 [FIX] account_tax_python: correctly forward-port 7eb7e9fd6e 2017-09-13 17:47:34 +02:00
Christophe Simonis c8b5c01340 [MERGE] forward port branch 9.0 up to 7eb7e9fd6e 2017-09-13 16:49:16 +02:00
Martin Trigaux 052bc38805 [FIX] google_calendar: do not create an event with an invalid id
The id is useful to update existing events but sometimes we are getting some
ids that are not accepted by Google

Getting an error:
odoo.addons.google_account.models.google_service: Bad google request : {
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "invalid",
    "message": "Invalid resource id value."
   }
  ],
  "code": 400,
  "message": "Invalid resource id value."
 }
}

Looks like existing events can have a _ in their id but new one, no longer.
It seems that these events are created by outlook calendar when synchronized
with Google Calendar.

opw-749752
opw-751294
opw-751348
2017-09-13 11:23:35 +02:00
Dan Čermák a52369274a [CLA] signature for D4N
Closes #19425
2017-09-13 11:22:00 +02:00
David Arnold cc955698ce [FIX]sale_stock: copy devolution move without decreasing respective SO values
-Make a return picking from a SO, and condigure the items to be refunded on SO(in the wizard)
-Copy the return picking.
-Validate it.

Without this fix, it would just keep decreasing the delivered value on SO.

opw:767429
2017-09-13 11:02:56 +02:00
Goffin Simon 8fbee7978f [FIX] purchase: PO state when validated
When nothing has been invoiced and the PO is validated with nothing to invoice
then the state of the PO must be "Nothing to invoice"

opw:769919
2017-09-13 10:16:34 +02:00
Nicolas Martinelli 7f356d6653 [FIX] account: mark as reconciled
`last_time_entries_checked` is a commercial field, so bypassing the
write won't sync it.

Closes #19274
opw-770018
2017-09-12 18:27:33 +02:00
Nicolas Martinelli 6318ff6675 [FIX] account_voucher: default currency
- Go to Accounting > Configuration > Journals.
- In the form view of a journal, click on Action > Voucher Entries
- Click on Create => traceback

opw-771415
2017-09-12 17:11:14 +02:00
Nicolas Martinelli 39964e6cf2 [FIX] account: mark as reconciled
- Create 2 companies:
- Company A and check VIES VAT Check
- Company B and do not check VIES VAT Check
- Set current company of admin to Company A and do not allow Company B
- Create a demo user on Company B and give him Adviser group in
  Accounting.
- Log in with the demo user.
- Create a Customer A as a company with:
  Country = Spain
  TIN = ES85847955H
- Create a contact on Customer A: "Contact Sample"
- Create a Customer invoice on "Contact Sample" partner
- Through the menu Accounting/Payments, create a new payment on "Contact
  Sample" partner with the total amount of the invoice.
- Open the menu Manual Payments and invoicing matching. The invoice and
  the payment should be proposed for reconciliation. Do CTRL+ENTER.

An error message appears: 'The VAT number [ES85847955H] for partner
[Contact Sample] either failed the VIES VAT validation check or did not
respect the expected format ESA12345674.'

This message should not appear as the current user is on Company B which
doesn't have the flag "VIES VAT Check" checked.

The issue comes from the `sudo` in `mark_as_reconciled`, which will lead
to `self.env.user` to be the admin in the VAT check, and therefore
`self.env.user.company_id` will be Company A.

Closes #19274
opw-770018
2017-09-12 16:24:26 +02:00
Goffin Simon 94eb69907d [FIX] crm: columns and tables in upper cases
The module studio gives the abality to name columns or tables with
upper cases. So making the SQL case sensitive avoids problems with studio.

opw:770022
2017-09-12 15:37:47 +02:00
Nicolas Martinelli d20388ba1a [FIX] purchase: missing data in tax computation
- Create a purchase tax computed with Python code.
- The Python code must use an attribute of the product, e.g.
  `product.price`.
- Create a PO using the created purchase tax.

It crashes, because the product (as well as the partner) is not sent to
the `compute_all` method.

opw-770078
2017-09-12 12:25:34 +02:00
Nicolas Martinelli 7eb7e9fd6e [FIX] account_tax_python: empty code
If the user somewhat removes the 'Applicable Code' text, the call to
`safe_eval` will crash.

opw-769267
2017-09-12 12:01:57 +02:00
Wolfgang Taferner 236a24de96 [FIX] account: handling of text domains in _query_get
1df72cb01b added a stringification of
the domain parameter to handle situations where an actual
domain (list/tuple) is being provided rather than a string, however
this causes issues when the string input is text (unicode) containing
non-ascii data as in Python 2 `str()` will then raise a
UnicodeEncodeError.

Rather than stringify the input, bypass safe_eval when the input is
already a proper domain.

Closes #19367
2017-09-12 11:20:09 +02:00
Nicolas Martinelli 80ad2a370c [FIX] account_asset: deferred revenue account
- Associate a product with a "Deferred Revenue Type"
- Create a customer invoice and add the product => the account of the
  deferred revenue is used.
- Create a SO with the same product, and generate the invoice => the
  account of the deferred revenue is NOT used.

opw-769254
2017-09-12 11:06:12 +02:00
Cédric Pigeon 280d9986fd [FIX] prevent calling costful methods on empty recordset
Some methods are called on empty recordset causing lacking of performance.

opw:769720
2017-09-11 16:39:35 +02:00
Nicolas Martinelli 0327f3e467 [FIX] report: paper format
Make paper format mandatory on the company. If no paper format is
defined, the PDF created may have an unexpected format.

opw-770173
2017-09-11 15:46:53 +02:00
Goffin Simon 2e292a21e6 [FIX] mrp: Singleton expected in action_unbuild
In some cases, the consumed quants can be more than one.
In this case the check for the lot must be done just on the first
consumed quant. Courtesy of @jco.

opw:748472
2017-09-11 14:47:14 +02:00
Nicolas Martinelli d23667262b [FIX] account: future payment
- Create a vendor bill
- Register a payment in the future (e.g. Bank payment)

On the dashboard, this payment in the future is taken into account,
while it shows a graph up to today. Moreover, when clicking on
"Difference", the report is opened at today's date.

opw-768155
2017-09-11 13:35:30 +02:00
Nicolas Martinelli 7d72a72905 [FIX] calendar, web_calendar: change date
- Change the date of an event through the form view
  => a mail is sent to the attendees.
- Change the date of an event thanks to the drag and drop of an event
  => the mail is not sent.

It is necessary to introduce a context key in the write call so we can
make the distinction between the write triggered from the drag and drop
and the write triggered by a recomputation of fields. Indeed, when the
form view is used to change the date, `write` is called several times.
We should avoid sending the same email each time.

opw-766295
2017-09-11 13:27:23 +02:00
Christophe Simonis 7d7e94c6ef [MERGE] forward port branch 9.0 up to 46e3e739c5 2017-09-11 11:37:46 +02:00
Christophe Simonis 46e3e739c5 [MERGE] forward port branch saas-6 up to ddbc2da847 2017-09-11 11:24:25 +02:00
Christophe Simonis ddbc2da847 [MERGE] forward port branch 8.0 up to 7805cf5fef 2017-09-11 11:22:33 +02:00
Odoo Translation Bot c2866f17ff [I18N] Update translation terms from Transifex 2017-09-10 04:41:07 +02:00
Odoo Translation Bot 6740879407 [I18N] Update translation terms from Transifex 2017-09-10 00:30:05 +02:00
Fabien Meghazi 6fa705399b [FIX] http/db: handle case when db_filter is empty in the config file
In such a case the db filtering won't be applied on an empty regex so
we use the list of databases passed to `db_name` (--database) as
the database list (and we also avoid to list all the databases present
on the postgresql cluster)

As a side effect, this patch allows to strengthen the postgresql security
by preventing Odoo to list all the databases present on the cluster.
2017-09-08 18:29:26 +02:00
Nicolas Martinelli cbee332bb1 [FIX] mrp_repair: default location in multi-company
1. Create a new company
2. Create a user with access to this company and with access to repair
3. Connect as the new user
4. Try to create a new repair and the stock.warehouse access error
   should appear

opw-769160
2017-09-08 13:14:36 +02:00
Lucas Perais (lpe) 825c7c1ed6 [FIX] website_forum: fix display of images in a post
Before this commit, the images were messing up the layout of the post, with text uglily lying on their right
This commit solves the issue at rendering of the post, to ensure that current posts on prods be affected in a reversible manner.
Also, we want this commit to have minimal impact

OPW 769721

closes #19322
2017-09-08 09:44:30 +02:00
Lucas Perais (lpe) 7805cf5fef [FIX] tools: fix amount to text in fr and nl
Correct rendering of 70 and 90 in french
And manage inversion [unit]-en-[tens] in nl

opw 757048

closes #19297
2017-09-08 09:40:56 +02:00
Yenthe V.G 1d769ad5a7 [FIX] web: Don't show buttons when model has readonly access
PR #19314
2017-09-08 09:23:44 +02:00
Goffin Simon 55b8a454c9 [FIX] mrp: Unbuild order with serial number
When unbuilding an order with serial number, the quant with the right
serial number must be found in the system either it raises an UserError
explaining  what's the problem.

PS: A problem was found when we tried to unbuild two times the same MO.
After the first unbuild, we deleted it and recreated the same one.

opw:748472
2017-09-07 16:39:58 +02:00
Nicolas Martinelli 6879409723 [FIX] im_livechat: unsupported locale
- Set the browser to language 'Spanish (Latin America)' ('es-419')
- As a public user, open a livechat session.

The session doesn't open.

The root cause is the creation of a mail channel which contains
translatable fields (e.g. name). This attempts to create translations
in the 'es_419' language. However, this locale doesn't exist in Odoo,
and it triggers the constraint 'lang_fkey_res_lang'.

In this specific case, there is no real reason to translate the channel
name. Therefore, we simply avoid it thanks to a context key.

opw-766489
2017-09-07 15:54:26 +02:00
Nicolas Lempereur 73edebc371 [FIX] web_editor: enter remove or duplicate node
There is some odd behavior especially inside a editable containing
newlines.

For example in the sale description on an ecommerce item, lines could
contain newline (it is editable from backend) but as an effect of other
use case, pressing enter could have a range of unwanted side effects:

- removing all the content,
- duplicating the editable (should never happen, if we have one field
  "description_sale" we don't want to duplicate it, this has no sense)

In a product name which is in the same use case, there is no newline so
the problem is not apparent, and ENTER do nothing. This is the behavior
we should want in every instance.

If we still want a newline, we have to force it with SHIFT + ENTER key,
also this is regarding field that may or could be present in the backend
views, so it could also be edited in backend.

This change make ENTER ignored when we are editing a node directly child
of an node being edited.

A second part of the issue was that dom.removeBetween (used to remove
content inside a range) could remove the ancestor node that was an
editable. This is not wanted.

For example if we did CTRL + A inside a field with `<br />` then ENTER
or pasting something, the field would be removed and not just emptied
and could not be gotten back without editing the template manually.

This was sometimes mitigated because if a `<br />` was at the end of an
element, it would stay in this use case avoiding the issue.

note: not necessary after saas-16

fixes #17445
opw-751360
closes #19313
2017-09-07 09:38:56 +02:00