Commit Graph
117156 Commits
Author SHA1 Message Date
Moises Lopez a87d5a2b28 [ADD] sale: add menu to product categories
It was already present in the accounting and purchase application but not in
sale menus.
Apply the same logic as in purchase and use a group_no_one

Closes #22862
2018-09-14 14:06:27 +02:00
len-odoo 8179960172 [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-14 14:00:52 +02:00
Nicolas Martinelli 6e0afe864b [FIX] website: AccessError
The AccessError made sense when it was introduced back in v10, but
doesn't make sense anymore since there is only one setting wizard.
2018-09-14 12:40:06 +02:00
Martin Trigaux a47f7ee0e4 [FIX] product: do not translate at code import
Defined as this, the label of the selection field were translated during code
import, when building the python model, not when a user access the field values
as it should (and is already the case thanks to the ORM).

Trying to translate a string when no user-context is available is not only
useless but may cause bug on services with multiple databases (e.g. a SaaS).

In a multi-worker environment, when the code is imported, the _ method will use
multiple scenarios to detect the language and get a cursor.

As we have no available cursor in the frame (method _get_cr from GettextAlias),
the fallback is made on the cursor of the request.
In a multi-worker environment, this could be a cursor linked to a database in
another language than English.
In such scenario, the selections would be translated in the language of the
other database instead of displaying it in English

opw-1881956
2018-09-14 11:20:38 +02:00
Nicolas Martinelli 2e6c1aa5d1 [FIX] stock_account: return dropship
- Set a product with real-time valuation
- Create a SO, select the Drop Ship route
- Validate the SO, the PO, and receive the picking
  => an accounting entry is created
- Return the picking

The reversed accounting entry is not created.

This is because the return of a drop ship picking is not recognized as
some kind of dropshipping.

opw-1879117
2018-09-14 10:35:33 +02:00
Lucas Perais (lpe) 148182bf91 [FIX] website: seo add words no freeze
On a website page, click on promote and add the keyword "DS1517"

before this commit, the javascript froze

after this commit, it doesn't freeze

OPW 1880341
closes #26771
2018-09-14 09:58:57 +02:00
Olivier Colson c568af83a2 [FIX] l10n_es: apply correct type to each account. 2018-09-13 16:28:46 +02:00
Toufik Benjaa 0c8a244e68 [FIX] mass_mailing: check duplicate recipients on mass mailing
- When checking if a recipient has already received a mass mailing, the
  record model for the recipient was not checked.

  Which leads to false positives.
2018-09-13 15:48:09 +02:00
Nicolas Lempereur 4ec9b55a79 [FIX] web: background layout landscape no +1 page
The report layout "background" has an image background from bottom to
top. When we transform the report in PDF, we have no idea in the
document of how many page, which orientation, width or height it will
take.

Thus to be able to have the background at the bottom of a page when
there is not enough content, we set a min-height for the body content.
This height was 1000px originally and has been decreased to 900px in
41c75ad0c3 because an empty page was possibly added (since the height of
body + header + footer was bigger than page size).

This issue is about getting a blank page when pdf is in landscape.
For example in A4 with 90ppi has a 1052px height in portrait, but 744px
height in landscape so we always get at least two pages with possibly a
blank one.

With this commit we lower it to 620px allowing 124px headers/footers.

opw-1881059
closes #26962
2018-09-13 12:44:53 +02:00
Christophe Simonis 5cb9f8e9d5 [MERGE] forward port branch saas-15 up to a27a24c5ed 2018-09-13 12:11:17 +02:00
Nicolas Martinelli 52c89adef7 [FIX] sale_stock, stock_dropshipping: ordered qty
- Set a vendor on Product A
- Create a SO with 1 Unit of A, set the Drop Ship route
- Confirm the SO
  => a PO with 1 Unit is created
- Change the oredered quantity to 2

The PO is updated with a total quantity of 3 instead of 2.

Since the removal of procurements, the quantity is computed based on the
stock moves. However, in this case, no stock move has been created since
the PO is not yet confirmed.

In this specific case, we fall back on the PO line quantity. The logic
is similar to `_quantity_in_progress`.

opw-1879118
2018-09-13 11:52:15 +02:00
Nicolas Martinelli dee5ce3be1 [FIX] account: open balance account when partner change
`line.amount` is `undefined`, leading to an incorrect account selected.

opw-1878890
2018-09-13 11:44:21 +02:00
Nicolas Martinelli ad584540d4 [FIX] account: tax account
Use the cash basis account for cash basis taxes.

Follow-up of 1b47575372

opw-1858492
2018-09-13 11:43:12 +02:00
Goffin Simon daa6cea439 [FIX] mrp: Upating the quantity of a MO
Steps to reproduce the bug:

- Create three stockable products P1, P2, P3
- Create a BOM for P1 with P2 and P3 as components
- Create a MO with 5 P1
- Check the availability and plan it
- Go on the WO and process only 3 P1
- Go to the MO and update the quantity to 3

Bug:

From this point, it was impossible to pass the MO to the state= 'done'

With this fix, you can now, click on "Post inventory" and the button
"Mark as Done" will appear.

opw:1874227
2018-09-13 10:03:57 +02:00
Géry Debongnie cd62900878 [IMP] web: add fail fast feature to qunit test suite
With this commit, we introduce a new 'fail fast' feature to our qunit
test suite: when it is activated, the qunit test suite will immediately
stop after the first failed test.

It is accessible as a flag in the url (failfast), or by clicking the
checkbox in the UI. It is currently not activated by default.

Note that this commit also change the url for the runbot phantomjs test
in order to activate this feature.  This allows us to increase the global
timeout for the js test suite without fear!

Backport of 611c836a46
2018-09-13 08:56:08 +02:00
len-odoo 83292e522a [FIX] doc: add documentation for widget formatter support in pivot view
Commit:
https://github.com/odoo/odoo/commit/8c1204954ef571e51e94ddf4070043ec2d5de3c6
put back support in v11 for formatter widgets in pivot views.
We document this feature.

opw 1876445
2018-09-12 19:46:40 +02:00
Nicolas Lempereur db0e84f3e3 [FIX] web: revert ignore default_* on group creation
This reverts commit 4cb585ab4f.

When creating from the kanban view:
- crm.stage
- hr.recruitment.stage
- project.task.type
- helpdesk.type
- mrp.eco.stage

We go from a dashboard of eg. "GroupRecord" named "group_id" in the
record. And when a stage is created, "default_group_id" is used. With
the change the stage was not linked to the current "grouping".

We could probably use "search_default_group_id" instead but the behavior
may be present in existing customization.

opw-1884217
closes #26943
2018-09-12 17:43:39 +02:00
Wolfgang Taferner 8e15dc87a4 [IMP] account: extract_payment_vals + explicit communication hand-over 2018-09-12 15:12:42 +02:00
Nicolas Lempereur 8e77632e58 [FIX] *mail_thread: don't modify modified help
The 'help' of window action is often fiddled with, adding thing before,
after or arround it.

For example in CRM leads, we add at the beginning "Click to add a new
opportunity" with an arrow towards the button, and after if there is a
mail alias: "All email incoming to * will automatically create new...".

But for crm.lead, hr.expense, sale.order this would not take into
account that the fiddled "help" can be edited, so if we edit 2 times
help in studio or backend action editing, we would get:

  Click to add a new opportunity
  Click to add a new opportunity
  Click to add a new opportunity
  [Original help content]
  All email incoming to * will automatically create new...
  All email incoming to * will automatically create new...
  All email incoming to * will automatically create new...

And see several "arrows" towards the button (in enterprise the
additional ones are on same color background).

With this commit we do what is done in "mail.thread" by default which is
not fiddling with the `help` if has been fiddled before (if it contains
"oe_view_nocontent_create" class).

note: this is the 11.0 version of #26912

opw-1877663
closes #26911
2018-09-12 13:18:35 +02:00
Goffin Simon 561ee39356 [FIX] sale_timesheet: Validating an invoice with timesheets
Steps to reproduce the bug:

- Go to  Timesheets > Settings and set Invoicing policy to “Approved Timesheets Only”
- Create a expensable product P with Type "Service", Invoice based on
“Timesheets on tasks” and Service Tracking “Create a new project but no Task”
- Create a new SO using P and confirm it. A project PR will be created
- Add a task TA to PR
- Add two timesheets(T1, T2) to TA, one for the current date(T1) and one for a future date(+1 month, T2)
- Go to  timesheets and  validate”  the timesheet T1
- Go to the SO and now the delivered_qty is equal to 1, so create the invoice I
- Validate I

Bug:

T1 and T2 were linked to I instead of just T1 (because invoice based on
“Approved Timesheets Only”)

opw:1879051
2018-09-12 11:08:56 +02:00
Nicolas Martinelli a2acef42a0 [FIX] account: reconciliation models
The reconciliation models are not available in the Manual Reconciliation
widget. This is simply because they were not loaded.

opw-1878944
2018-09-12 10:24:24 +02:00
Nicolas Martinelli d3d3455e17 [FIX] web: lock handle when sorting on a different field
This makes runbot Enterprise fail. Reverts until a proper solution is
found.

This reverts commit f4f1480a3e.
2018-09-11 21:48:03 +02:00
Christophe Simonis cf7cb147f2 [FIX] rating: remove useless header in icon title 2018-09-11 19:46:05 +02:00
Christophe Simonis 49a7295ce9 [MERGE] forward port branch saas-15 up to 48aac01c13 2018-09-11 19:06:22 +02:00
Nicolas Lempereur 3d09560ffc [FIX] calendar: keep recurring after edited one
Since 76b7242 if we have a recurring event with 3 occurences:

 [4th 4:00-4th 5:00] [14th 4:00-14th 5:00] [24th 4:00-24th 4:00]

And we detach the first one to modify it, then when getting the
info of reccurring events not detached the system get:

- starts: [14th 4:00] [24th 4:00]
- stops: [4th 5:00] [14th 5:00] [24th 5:00]

And wrongly apply the current filtering over:

 [14th 4:00-4th 5:00] [24th 4:00-14th 5:00]

So the issue hides recurrences of event wrongly if:

- they have not been detached
- they don't have a duration of 0
- one or several previous events have been detached
- the stop date of the nth previous event occurrence (nth equaling
  number of detached previous events) is not in the current filtering.

With this change, the stops are also filtered based on start of
occurrence + duration.

Without the change, the added test fails with:

 False != '27-20120301120100' : Last event should be found searching it by date range

note: 11.0 version of 10.0 #26887

opw-1866151
closes #26901
2018-09-11 16:27:58 +02:00
Goffin Simon 5a1f874602 [FIX] base_address_extended: contact address is not updated
When the module "base_address_extended" was installed, the contact addresses
of a company were not updated when the company address was updated.

opw:1879968
2018-09-11 11:30:44 +02:00
Nicolas Martinelli 1b47575372 [FIX] account: cash basis in statement
- Set up a 10 % tax with a 'Tax Due' as 'Based on Payment'
- Create a bank statement of 110, Reconcile
- Create a new AML for the reconciliation using the mentioned tax for an
  amount of 100
- Validate

The tax amount does not appear in the Generic Tax Report.

This is a specific case where the reconciliation process creates the
payment itself. Therefore, the tax amount should appear in the report.

To do so, we explicitly send the `tax_exigible` value on the AML, and
propagate it to the tax line.

opw-1858492
2018-09-11 10:30:45 +02:00
Nicolas Martinelli 097963624f [FIX] stock: prevent location change
Changing the partner on a picking triggers an onchange which might
modify `location_id` or `location_dest_id`. However, when the picking is
not draft anymore, these fields are not supposed to be changed.

opw-1872635
2018-09-11 10:21:14 +02:00
Lucas Perais (lpe) 816f386161 [FIX] mail: action send mail no default_type
Have a send email automated action on invoices upon validation (write)

Go onto the credit notes, create one, and validate

Before this commit, at the creation of the attachment (the invoice pdf), there was a traceback
because default_type was in the context containing 'out_refund'
And that attachments also have a field 'type'
So the default_get of the latter got a value that wasn't correct for its field

After this commit, we clean the context of the default_type context key since it
is irrelevant beyond that point

OPW 1868638

closes #26621
2018-09-11 09:35:44 +02:00
Lucas Perais (lpe) f5e145d2b9 [FIX] payment_stripe: regex to match so_ID
Before this commit, when paying a confirmed SO with the token access with Stripe,
Clicking on the button "pay now" wouldn't do anything, because the id of the SO couldn't be retrieved

After this commit, the regex that does just that is more generic and the flow works

OPW 1881192
closes #26884
2018-09-11 09:30:25 +02:00
Christophe Simonis c3ea0a7811 [MERGE] forward port branch saas-15 up to 7563abbde8 2018-09-10 17:27:02 +02:00
Nikunj Ladava 2ea7d9b10e [IMP] payment: Improved error message for an empty field in payment.acquirer form view
- payment.acquirer have many fields with 'required_if_provider'
   attribute and while saving form it gave an error like "Required
   fields not filled", so it was confusing to know  which required fields were empty.

 - after this commit, it is displayed like "Required fields not filled (field name)"

opw:1881054
2018-09-10 16:46:21 +02:00
Adrien Dieudonne 15e1b2a469 [FIX] test_main_flows: automatic install of account_accountant
'account_accountant' is only defined in enterprise.
Before this commit, many of us forgot to manually install it
before running main_flow_tour in enterprise.
Plus, it was difficult to know that a required module is missing
when a step failed. The error was not clear.

Now, the post hook will check if this module exist (it's the case in
enterprise) and will install it.
2018-09-10 14:48:47 +02:00
Nicolas Martinelli 5be17f7bc6 [FIX] point_of_sale: mandatory picking type
Make the picking type mandatory, otherwise any picking will be created
without one, which will cause stock issues.

opw-1873326
2018-09-10 13:11:28 +02:00
Nicolas Martinelli fb22a4db2a [FIX] sale: analytic account in confirmed state
- Activate analytic accounting
- Create a SO, validate
- Edit, and in the tab 'Additional Information' set an 'Analytic
  Account'
- Save

The analytic account is not saved.

The domain applied on the field is:
`attrs="{'readonly': ['|',('analytic_account_id','!=',False),('invoice_count','!=',0),('state','=','sale')]}"`

This means that once the account is set, the field becomes read-only.
However, a read-only field is by default not sent to the server.

opw-1882448
2018-09-10 13:07:22 +02:00
Lucas Perais (lpe) 8fca115b04 [FIX] web_settings_dashboard: give context to search_read planners
Before this commit, the planner section of the settings weren't translated.
This was because the context was not sent along with the search_read that fetches planners data

After this commit, the planner section is correctly translated

OPW 1881092
closes #26766
2018-09-10 12:04:13 +02:00
Lucas Perais (lpe) bb12890977 [FIX] mail: activity don't loose text of feedback popover
On an activity, click Mark as done, the popover pops over
Now write some text in it, but click somewhere else, like to copy/paste something
The popover looses focus, and your text disappears

After this commit, we store the value of the popover when hiding it,
then, when when showing back the popover, the value is reinjected

OPW 1873999
closes #26315
2018-09-10 11:24:42 +02:00
Nicolas Martinelli 0f2292018e [FIX] account: manual reconciliation with tax
In the Manual Reconciliation widget:
- Link 2 entries that do not balance
- Create the write-off line with a tax

When reconciling, the following error occurs:
"It is mandatory to specify an account and a journal to create a
write-off."

Two new lines are sent to the server: the write-off, and the tax of the
write-off. The latter causes the issue, since it doesn't contain the
field `journal_id`.

Actually, the tax of the write-off is not necessary since the taxes will
be recomputed automatically thanks to the context key `apply_taxes`.

opw-1875822
2018-09-10 10:10:46 +02:00
Lucas Perais (lpe) 9671ccb509 [FIX] website_quote: option product discount report print
Before this commit, the suggested products section on a printed SO always showed
the discount, even if it was 0.0

After this commit, we display discounts only if they are different from 0.0

OPW 1882942
closes #26847
2018-09-10 09:58:16 +02:00
Odoo Translation Bot 01d853e295 [I18N] Update translation terms from Transifex 2018-09-09 04:11:03 +02:00
Romain Derie 3a496f18fa [FIX] web: forward-port 10.0->11.0 (CORS error handle)
CORS error was firsly fixed with 4bd8e3e2ed in 11.0
Then it was cherry-pick'd and improved in 10.0 with 9f1438d5f1.
But the improvement was lost during forward port from 10.0 to 11.0.

This commit adds the lost fix.

Closes #26812
2018-09-08 12:58:53 +02:00
Jeremy Kersten e1b142bd9f [FIX] website_sale, website_sale_stock: fix deps
Commit d25719cd use in website_sale the field sale_delay defined in stock and
so only available with the module bridge website_sale_stock only.

After this commit, website_sale without stock works again.

This commit closes #26855, closes #24671
2018-09-07 23:05:30 +02:00
rocketgithub a5d28e0e95 [FIX] base: correct currency code for Guatemala
The correct code is GTQ, QTQ does not exists
https://www.xe.com/currency/gtq-guatemalan-quetzal
2018-09-07 14:24:06 +02:00
rocketgithub 9647faa825 [CLA] signature for rocketgithub
Done at #26781
2018-09-07 14:23:50 +02:00
jcoux c5dce48fbe [CLA] Signature for jcoux
Closes #26841
2018-09-07 14:21:05 +02:00
len-odoo 9b602ae648 [FIX] base: allow to use Python builtins in views
Py.js does support Python builtins, e.g. abs, len, str, which can
be used in views if the view validation accepts it.

opw 1879160
2018-09-07 11:38:22 +02:00
Nicolas Martinelli 7e83ea8d57 [FIX] point_of_sale: restrict price control
- Activate the Price Control option in the POS
- Connect as Admin => you are allowed to modify the price
- Switch the user to Demo => you are still allowed to modify the price
- Switch back to Admin => you are not allowed to modify the prices

The two last steps are clearly incorrect.

The reason is the following.
The function `applyAccessRights` is bound to `'change:cashier'` event of
the `pos` at:

https://github.com/odoo/odoo/blob/d25719cdf2b8a863c1a855f2e42e9c3a43580f66/addons/point_of_sale/static/src/js/screens.js#L389

When switching the user, 2 steps are performed:
1. Set the cashier on the `pos`
2. Set the cashier on the `pos.db`

https://github.com/odoo/odoo/blob/d25719cdf2b8a863c1a855f2e42e9c3a43580f66/addons/point_of_sale/static/src/js/models.js#L646-L647

Step 1 will trigger the function `applyAccessRights`, which calls
`pos.get_cashier`. However, the latter retrieves the user on `pos.db`
first, and falls back on `pos`.

https://github.com/odoo/odoo/blob/d25719cdf2b8a863c1a855f2e42e9c3a43580f66/addons/point_of_sale/static/src/js/models.js#L642

This means that we retrieve the cashier in the `pos.db` before it is
actually set (in step 2).

To avoid this, we explicitly retrieve the cashier on the `pos`, then
fall back on the usual `pos.get_cashier` function.

Closes #26814
opw-1871189
opw-1881172
2018-09-07 09:29:38 +02:00
Aaron Bohy a51a5b70d3 [FIX] web: FieldDomain: reset field with a new domain
Before this rev., there was a crash when a FieldDomain was reset
with a new domain (e.g. coming from an onchange). For instance, it
crashed in Email Marketing > create new Mass Mailing > select
mailing lists. Introduced by 68332a01.

opw-1882850
2018-09-07 08:37:45 +02:00
Christophe Simonis 737ca0eb42 [FIX] web: adapt newly added test (2) 2018-09-06 17:27:50 +02:00
Christophe Simonis 63f95760ef [FIX] web: adapt newly added test
Oversight of previous forward-port
2018-09-06 17:23:27 +02:00