Commit Graph
117156 Commits
Author SHA1 Message Date
Christophe Simonis 505e42b78b [MERGE] forward port branch saas-15 up to 5a5d6d1e8e 2018-09-06 17:00:26 +02:00
Xavier Morel a3cd0ac2ce [FIX] project: add access token to task attachment display
Following CDN expansion (d98b262398)
portal attachment links now go through the CDN, which is an issue for
restricted-access attachments e.g. attachments bound to specific objects
(such as support tickets).

Add an access token to the attachment links in the /my/task template.

Cf OPW-1882014 (fixed ad-hoc by editing the relevant view on odoo.com)
2018-09-06 16:44:00 +02:00
Goffin Simon d3dc5048e4 [FIX] purchase_requistion: Duplicate purchase agreement with "Run sch…
…eduler"

Steps to reproduce the bug:

- Let's consider P a product with routes "buy" and "mto" and with
purchase_requistion = 'Propose a call for tenders'

- Let's consider a BOM B with P as component

- Create a MO for B

- Run the scheduler two times

Bug:

Two purchase agreements have been created for the the same MO.

opw:1882280
2018-09-06 16:05:13 +02:00
Nicolas Martinelli 79a7d58a1c [FIX] sale: prevent confirmation of SO
Prevent the confirmation of a SO in state 'cancel' or 'done'.

opw-1881333
2018-09-06 15:05:09 +02:00
Nicolas Martinelli 765a3bf23f [FIX] account: unreconcile cash basis
- Set up a tax as 'Based on Payment'
- Create an invoice at date D with this tax
- Pay the invoice at date D+1
- Unreconcile

A reversal entry is made at the current date, while it should be at the
payment date D+1.

We make sure to use the payment date only if the payment period has not
been locked.

Fixes #25738
opw-1870467
2018-09-06 14:45:40 +02:00
Pedro M. Baeza 89c1555096 [FIX] website: Unlink several website.page records
Avoid singleton error

This commit closes #26825

Partial backport of saas-15 - multiwebsite commit
2018-09-06 13:57:18 +02:00
Uku Lagle 900341bed8 [FIX] assetsbundle: prevent unlink old_attachments twice
When bundle contains both, sass and less, the unlink on old_attachments
will be called twice and thus results in MissingError.

This commit closes #26110
2018-09-06 13:56:39 +02:00
Jeremy Kersten 9512cdf308 [FIX] website_sale: remove useless widget on multiimage that generate log in js
remove warning:
Missing widget: checkbox for field group_website_multiimage of type boolean

This commit closes #25936
2018-09-06 13:56:39 +02:00
Goffin Simon d25719cdf2 [FIX] website_sale: customer_lead in the shop
Let's consider a product P with a sale_delay = 10
When creating a SO for P in the backend, the customer_lead is correctly
set to 10. But when creating a SO in the shop for P, the customer_lead
was not correctly set.

opw:1880577
2018-09-06 10:29:20 +02:00
Goffin Simon 3504529fb5 [FIX] sale: Server Error when trying to process card
Due to this commit: b367625248
The function "_get_payment_type" was not defined in module "sale_payment" but defined in "website_quote"
The bridge module for "website_quote" and "sale_payment" is "sale" so the first definition of "_get_payment_type"
must be in "sale".

opw:1881990
2018-09-06 08:36:04 +02:00
Christophe Simonis 213759b03e [MERGE] forward port branch saas-15 up to e1e27aa009 2018-09-05 18:17:03 +02:00
Goffin Simon 9e99e5e641 [FIX] base: Execute group config on modifications only
Fine tuning of a06747c03d
In some cases, it was not possible to change some settings

opw:1881081
2018-09-05 14:11:25 +02:00
len-odoo f4f1480a3e [FIX] web: lock handle when sorting on a different field
The resequence mechanism works if the sequence is sorted by its handle field.
Therefore sorting on another field should lock the handle, while sorting on the
handle field should unlock the handle.

opw 1867049
2018-09-05 13:09:36 +02:00
Nicolas Lempereur c0c9049f2f [FIX] base: allow get_template serialization retry
When two transactions conflicts (eg. deleting same data, see [1]) Odoo
will retry the whole transaction several times hoping for the best.

But when rendering template, the error handling would prevent this
feature. For example a recurring issue was:

- loading quickly two times the /web route
- for each recompute the assets

=> this could lead to 2 concurrents transactions that would delete
previous same attachment (ie. DELETE FROM ir_attachment where id=3).

With this changeset, when getting a template fails because of a
transaction rollback, we let the issue bubble up so our retry system is
used.

So instead of a "500 Internal Server Error" page and in log:

  bad query: b'DELETE FROM ir_attachment WHERE id IN (3)'
  ERROR: could not serialize access due to concurrent update
  "GET /web HTTP/1.1" 200 -
  "GET /web HTTP/1.1" 500 -
  ... big traceback ...
  load could not load template

we would get the requested page without error and:

  bad query: b'DELETE FROM ir_attachment WHERE id IN (3)'
  ERROR: could not serialize access due to concurrent update
  "GET /web HTTP/1.1" 200 -
  SERIALIZATION_FAILURE, retry 1/5 in 0.8920 sec..
  "GET /web HTTP/1.1" 200 -

As a side node, the issue was exacerbated in some instances:

- when running a database on another server: assets are recomputed
- when a module was installed/uninstalled: assets may are recomputed
- when updating the source code: assets may be recomputed
- when starting server: requests could be stacked waiting for readiness
- when using google chrome: the "Use a prediction service to load pages
  more quickly" option may load a page two times. for example:
    -> an URL is entered in address bar
    -> a prediction request to it is started URL
    -> go to this page (Enter) when that request is not already resolved
    -> the prediction request is cancelled and a new request is started

[1] https://www.postgresql.org/docs/9.6/static/transaction-iso.html#XACT-REPEATABLE-READ

opw-1849167
closes #26778
2018-09-05 09:43:53 +02:00
Nicolas Martinelli 88a5d9a000 [FIX] web_editor: image name
Add the image name when the image is uploaded.

Complement of commits 886c07dabb and 152e3f8686

opw-1880472
2018-09-05 09:10:37 +02:00
Goffin Simon c3812c8e62 [FIX] account: Country in invoice analysis
Steps to reproduce the bug:

- Create a contact without a parent company and set a country on it
- Link this contact to a parent company that has no country defined
- Create an invoice for the contact
- Go to Accounting / Reporting / Management / Invoicing, switch to Pivot view and group by country
=> the invoice for the contact is classified under "Undefined" even though it actually has a
country set when you go see the invoice

opw:1878819
2018-09-05 09:06:52 +02:00
Nicolas Martinelli ea5912fedd [FIX] point_of_sale: pricelist
- Create 2 pricelists A and B. Pricelist B relies on A.
- Make B available in the POS, but not A
- Start a POS session

The user faces a black screen without any information on the error.

We add a simple alert so that the user knowns the source of the problem.

opw-1874397
2018-09-05 08:59:16 +02:00
Nicolas Martinelli 31981731ea [FIX] web: time display
The calendar should use the time format of the language parameters.

Partial backport of d4b5668c1a

opw-1881335
2018-09-05 08:53:35 +02:00
Jesús Alan Ramos Rodríguez 5b13a45fb8 [FIX] doc: Change name of method in documentation
invalidate_all no longer exists

Closes #26613
2018-09-04 17:04:33 +02:00
Christophe Simonis 2a13863f43 [MERGE] forward port branch saas-15 up to 653bbbc733 2018-09-04 17:02:36 +02:00
Goffin Simon 54ed832cdb [FIX] website_event: Not possible to edit badges
In 11.0, it's not possible to edit a badge, so the button "Edit Badges"
must be called "Preview Badges"

opw:1878949
2018-09-04 14:06:43 +02:00
len-odoo 80156aa919 [FIX] base: allow a user to attach documents to his profile, without administration access rights
The res.users class contains special fields that bypass access rights.
These are designed to allow a user that does not have the possibility to write
on res.users to modify their own fields, such as the mail signature.
Create and write are overriden to make it so, however the check_access_rights
isn't.
Since this method does not work at field level but at model level, there is no
easy way to resolve the incoherence.

Uploadding an image to a signature would add an attachment to the signature;
before being created, an attachment checks if the user has the rights to write
on the target model. The incoherence thus make it fail.

We add a special case when creating an attachment so that a user can write on
itself.

opw 1871243
2018-09-04 12:20:17 +02:00
Nicolas Martinelli eaff0a71bd [FIX] web: export field with '/'
- Activate lots and SN
- Go to Inventory > Inventory Adjustments
- Export a record
- Select the field 'Inventories > Lot/Serial Number'

The `name_get` of the field is exported, not its XMLID.

This is because the parsing made in order to limit the depth of export
is made on the label, not on the field name.

Actually, it is not clear WHY this limitation exists, but we keep it for
compatibility purpose.

opw-1877092
2018-09-04 11:40:19 +02:00
Nicolas Lempereur 4cb585ab4f [FIX] web: ignore default_* on group creation
When a column is created in the kanban view, the context of the window
action is fully given but it may contain default_{field_name} context
keys that are intended for the action model.

eg. on a product.product view we could have {default_type:'product'} in
the context, if we grouped by company_id and created a new company, we
would the context is propagated and we would try to set type='product'
on the company (which causes an error).

Without the change, the added test fails with:

  default_* should be removed from context, actual: "true", expected: "false"

opw-1879064
closes #26676
2018-09-04 11:03:15 +02:00
Goffin Simon 15c81d74a3 [FIX] mail: Timezone issue when creating a call
Steps to reproduce the bug:
- Let's consider the today date = D
- Set on your preference a timezone which has another today date = D+1
- Go to CRM > Configuration > Activiy types > Call
- Set 0 as # Days
- Go to CRM > Pipeline > Click on a lead
- Schedule an activity of type = Call

Bug:

The Due Date = D instead of D+1

opw:1877217
2018-09-04 09:20:24 +02:00
Nicolas MartinelliandGert Pellin 9999661cd0 [FIX] payment_authorize: add first name and last name
The `createCustomerProfileRequest` requires a first name and a last
name for several payment processors.

Reference:
https://developer.authorize.net/api/reference/#customer-profiles-create-customer-profile

opw-1878218

Co-authored-by: Gert Pellin <gpe@odoo.com>
2018-09-04 08:25:46 +02:00
Nicolas Lempereur 7a453b0b7a [FIX] web_editor: focus lost with inline editor
When an inline editor is eg. in a form view, the focus is always stolen
by it.

This is because we trigger a mouseup on the editor to update its
toolbars values and informations.

In 10.0 this was not necessary since the default values were sanely set
when the editor was inside the DOM. In 11.0 the editor is not in the DOM
when this is being done and the info was wrong (eg. NaN for text size).

With this commit, we don't steal the focus and get the default like it
was done in 10.0 instead.

fixes #26366
opw-1874880
closes #26582
2018-09-03 16:51:20 +02:00
Goffin Simon af27196fc5 [FIX] sale_stock: Printing Delivery Order
Steps to reproduce the bug:

- Create a user U with manager inventory access rights and no right in sales
- Create a SO and validate it, it will create a picking P
- Lock the SO
- Log with U and try to print the delivery slip of P

Bug:

A access right error was raised.

opw:1878504
2018-09-03 16:51:47 +02:00
Nicolas Lempereur 388eff5b58 [FIX] web: load more with progressbar load more
Be in a grouped kanban view with progressbar with limit 10:

- records 1 to 10 are loaded on a column
- do "Load more..." on a column => records 11 up to 20 are loaded
- do "Load more..." 2nd time => records 11 up to 20 are loaded
- do "Load more..." 3rd time => records 11 up to 20 are loaded
- ...

While in reality it should be:
- do "Load more..." 2nd time => records 21 up to 30 are loaded
- do "Load more..." 3rd time => records 31 up to 40 are loaded
- ...

This was caused by the progressbar reloading the column's group. This
set the loadMoreOffset to 0 thus forgetting the current state.

Without the change, added tests failed with:

 records of column are loaded => actual: "1,2,2", expected: "1,2,3"

opw-1878359
closes #26628
2018-09-03 15:58:52 +02:00
Martin Trigaux 98665aca1c [FIX] transifex: actually escape strings containing a '
The report's template is wrong
should becomes

text:'The report\'s template is wrong'

but previous code had no effect
2018-09-03 15:03:09 +02:00
Goffin Simon bc913d9d2b [FIX] point_of_sale: Print receipt on Safari
As explained on stackoverflow with
https://stackoverflow.com/questions/23626998/safari-print-issue-with-javascript-window-print
There is an issue with javascript window.print() on Safari

Steps to reproduce the bug:
When clicking on button "Print receipt" in the point of sale, nothing happened.

opw:1858205
2018-09-03 13:23:21 +02:00
len-odoo b95b4035e4 [FIX] web: tab selects first many2one entry without triggering spurious create
Suppose you select a customer for a sale order.
You type the beginning of his name "think", and a name_search is triggered
which finds matching results, with first result "Think Big Systems".
There are three ways to select it: click, enter or tab.
Now there can be a warning set on this customer
("Bad client, only accept cash", or "good client, offer discount").
In that case, clicking on tab would trigger the onchange displaying the warning,
but it would also set floating to true, which means a dialog to create client
"think" would appear.
This happens if the onchange is delayed, and thus the call to reset the floating
state is triggered only after the focusout completed, instead of before.

Coauthored with @aab-odoo

opw 1866619
opw 1874475
2018-09-03 12:09:56 +02:00
Nicolas Martinelli 122f06b86e [FIX] l10n_th: withholding taxes
Withholding taxes should have a negative value.

opw-1865270
2018-09-03 12:05:30 +02:00
Nicolas Martinelli 5b89ca142d [FIX] purchase: vendor reference
In case no PO has a vendor reference, keep the value.
2018-09-03 11:57:49 +02:00
Goffin Simon d448849ba3 [FIX] delivery: Error message for unavailable delivery methods
With a fixed price delivery method, the error message was not displayed when
the address doesn't match.

Inspired from function base_on_rule_rate_shipment

The error message was not clear enough.

opw:1879204
2018-09-03 11:13:34 +02:00
Martin Trigaux 5700f960d4 [ADD] test_translation_import: new duplication test
To make sure what was corrected is tested
2018-09-03 11:02:56 +02:00
Martin Trigaux e656a350a6 [FIX] test_translation_import: correct test
Now that it is tested, actually correct it
2018-09-03 11:02:56 +02:00
Martin Trigaux a9cd97f58e [MOV] tests: move test to be executed
The test was in a folder not checked by the runbot
The test, as it, is actually failing and it will be corrected in the next commit
2018-09-03 11:02:55 +02:00
Martin Trigaux 1566c0ab3b [FIX] tools: avoid loading duplicated code translation
This commit fixes two bugs:

- a8469c45 was fixing the case where the first line was not 'code' but broke
  the usecase where a po started with code line

- Correct the usecase where a pot and po file do not have the same line of code
  by matching on res_id=0

This avoids to have a pot expecting a code message at line 42 and a translation
at line 43

Closes #26722
2018-09-03 11:02:43 +02:00
Nicolas Martinelli e6390a76a6 [FIX] purchase: overwrite vendor reference
Overwrite vendor reference only if there is a PO linked to the bill.
Otherwise, any addition of product will erase what the user just typed.

Closes #26734
2018-09-03 09:54:34 +02:00
Odoo Translation Bot d40145a42e [I18N] Update translation terms from Transifex 2018-09-02 04:09:57 +02:00
len-odoo a822d3ee41 [FIX] hr_timesheet: add float_time widget on float time field in pivot view
Since pivot views can use fancy widget attributes, we use one to display some
float time value (getting 8:30 instead of 8,5).

opw 1876445
2018-08-31 15:49:32 +02:00
len-odoo 8c1204954e [FIX] web: display values according to widgets in pivot view
The pivot view didn't take into account the widget set on the fields.
In particular this was a problem for float fields that store time values.
They are now displayed with float_time if declared as such in the view.

opw 1876445
2018-08-31 15:23:31 +02:00
Nicolas Martinelli 078c3ec492 [FIX] payment_authorize: remove incorrect fields
`firstName` and `lastName` should be filled in for Australia, but the
implementation is not correct since:
- it assumes that the name is first name + last name, which is not the
  case in all countries (e.g. France)
- it doesn't take into account that the name could be a company name

This reverts commit 26974d4e5f.
2018-08-31 13:37:25 +02:00
Nicolas Martinelli ce6400e098 [FIX] mass_mailing_event: event domain
- Create an event, add an attendee
- Click on the stat button 'Mail Attendees'

The domain is shown as 'Event', '?', [id].

This is because the domain selector widget doesn't support the `in`
operator. Supporting it is not trivial, since ultimately `field_utils`
cannot parse a list of ids for a Many2one. It's less intrusive to change
the domain, since a standard use of the method will simply contain a
single id.

opw-1878322
2018-08-31 13:15:40 +02:00
Gert Pellin 26974d4e5f [FIX] payment_authorize: add required fields for wespac Australia (#26709)
for the payment processor wespac there are required fields we do not send.

required:
•Card Number
•Expiration Date
•Amount
•First Name
•Last Name
•Address
•City
•State/Province**
•Zip Code (Postal Code/Postcode)**
•Country
•Email

** These fields are optional if the billing address is not in the U.S. or Canada. If the address is in the U.S. or Canada, the two-digit State/Province code must be provided, along with the Zip/Postal Code.
2018-08-31 11:29:38 +02:00
Magnus 4877030d64 [FIX] fatal error when trying to enable logrotate
4e5119c6e5 didn't account for
`tools.config['workers']` being `None` on windows, resulting in the
entire thing crashing when trying to execute `None > 1` in Python 3.

Fixes #26447
2018-08-30 16:20:10 +02:00
Christophe Simonis 0fd5c70940 [MERGE] forward port branch saas-15 up to 6b1b507deb 2018-08-30 15:56:03 +02:00
Nicolas Martinelli 39162d0ff0 [FIX] point_of_sale: multiple lot numbers
- Product tracked by lot:
  3 units of lot A
  2 units of lot B
- On the operation type 'PoS Order', only tick 'create new SN/LN'
- Make 2 PoS orders for 2 units.
- Close the PoS session.

The first picking (2 units of lot A) is done, but the second picking is
ready but not done.

The issue comes from the world famous error:
'Cannot set the done quantity from this stock move, work directly with
the move lines.'

We apply the same logic than in commit f0028bc837

opw-1878256
2018-08-30 15:23:04 +02:00
Nicolas Martinelli 2f87bb5169 [IMP] mrp, stock: make _set_quantity_done available in stock
The method is also useful in other modules, so make it available directly
in stock.
2018-08-30 15:23:04 +02:00