Commit Graph
117975 Commits
Author SHA1 Message Date
Khoi Nguyen 3f962dbe63 [FIX] web,*: replace core.debug by config.debug 2017-10-18 16:52:41 +02:00
Khoi Nguyen 28491aac45 [IMP] web: Regenerate assets from debug menu
This commit adds a "Regenerate Assets Bundles" entry in the debug menu,
whose role is to unlink all assets from ir.attachment, forcing their
regeneration.
2017-10-18 16:52:41 +02:00
Christophe Simonis 8096162bee [MERGE] forward port branch saas-14 up to 73822d4eaf 2017-10-18 16:06:07 +02:00
Kinjal Mehta 733306fc64 [ADD] crm: Display 'Expected Revenue' currency on quick create form
Purpose
=======

Expected revenue field on pop up have no any indication of currency due to that people enter a dollar sign in the field. Eg: $1234

then an error appears when trying to save saying that the field is invalid but the user doesn’t know why. If the currency symbol was displayed it would solve the problem.

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

'Expected Revenue' field on wizard should be monetary in order to display the currency symbol.
2017-10-18 16:00:30 +02:00
Christophe Simonis 73822d4eaf [MERGE] forward port branch 10.0 up to 388bf45853 2017-10-18 15:30:54 +02:00
Thibault Delavallée 388bf45853 [FIX] mail: indentation issue when forward-porting
Commit aab6bdd54a was incorrectly forward-ported to
10.0 at abb726d4df . Indeed share users could land
to a wrong backend or frontend page depending on the target app due to an
indentation issue.
2017-10-18 15:21:44 +02:00
Christophe Simonis de70646bc5 [FIX] website_sale: correct js syntax
Oversight of forward-port a01e76efa7
2017-10-18 15:17:40 +02:00
Simon Lejeune 542b8fd550 [FIX] stock_landed_costs: fix rev 2222ab47e4
To get 48 entries, you need the anglo saxon accounting enabled.
2017-10-18 15:12:21 +02:00
Christophe Simonis 00a14fd832 [MERGE] forward port branch 10.0 up to 2d46dbcbfd 2017-10-18 14:57:25 +02:00
Raphael Collet 2d46dbcbfd [FIX] ir_http: use meaningful ETag for images (#20283)
After setting the image on a product variant, the controller for `/web/image`
incorrectly returns the code 304 - Not Modified.  This bug occurs because
 1. the response ETag is a hash of the **last modified date** of the record;
 2. the record is actually **not** updated in that case, because
     - the image field is a non-stored computed field, and
     - its inverse method only modifies the variant's template.

Fix the issue by making the response ETag a hash of the **content**, which is
read by the controller anyway.

OPW 769302
2017-10-18 14:53:10 +02:00
Simon Lejeune 2222ab47e4 [FIX] stock_landed_costs: enable and adapt forgotten tests
stock_landed_costs.yml is adapted to validate the picking before
applying a landed cost on there. Applying a landed cost on a non
validated picking was never supported but the test fails due to
implementation changes in v11.

Due to this change, the last assert was wrong: indeed, applying a landed
cost on a delivered product creates 6 account move lines if anglo saxon
accounting is enabled. This case creates 4 landed costs on 2 delivered
stock moves, 4*2*6 == 48 account move lines.
2017-10-18 14:49:03 +02:00
Simon Lejeune e2db80d3b5 [FIX] stock_landed_costs: update price_unit
The value and remaining value fields were correctly adapted when a
landed cost was applied on a move, but not the unit price one. This is
problematic, as the product should indeed cost more.

To properly compute this value, we change the meaning of
`stock_landed_cost_value` which is now the total value of the landed
cost, not the prorated value of what is still in stock.

Also fix the computation of the quantity already delivered in case of
negative stock.

Fixes #19254
2017-10-18 14:49:03 +02:00
Christophe Simonis a01e76efa7 [MERGE] forward port branch 10.0 up to 2198220947 2017-10-18 14:34:32 +02:00
Lucas Perais 6c9e45576e [FIX] document: display create_date of attachment timezone aware (#20242)
Before this commit, when putting the mouse over an attachment in the attachment drop menu list, the date time displayed was UTC only.
After this commit, we convert that value to the correct timezone datetime.

OPW 776704
2017-10-18 14:25:22 +02:00
Christophe Simonis 2198220947 [MERGE] forward port branch 9.0 up to e0fbe7b5be 2017-10-18 14:05:42 +02:00
qsm-odoo c7f5ad87a4 [FIX] web_editor: odoo-made tables should not be layout: fixed 2017-10-18 13:37:33 +02:00
qsm-odoo f1f3a8c76a [REF] website_twitter: better adaptation to websitepocalypse
+ Some layout fixes
+ Controllers routes renaming
+ SASS -> LESS

Note: animations and layout could be further improved but the goal of
this commit was to refresh the code to master's new conventions.
2017-10-18 13:33:23 +02:00
Géry Debongnie 5b465611a0 [REF] web: remove dead template/code/files
We sometimes need to clean up stuff.  I am actually surprised that there
were no more dead templates.  We should do the same for css/less.
2017-10-18 13:31:17 +02:00
Géry Debongnie f9d08ba5b9 [REF] web: improve switch company menu
Mostly update it to new guidelines, and improve a few details
2017-10-18 13:31:17 +02:00
Géry Debongnie 1dda323359 [REF] web: refactor notification system
This commit aims to bring the code closer to an ideal state.  We want
notifications to be a simple service, easy to use, and well documented.
2017-10-18 13:31:17 +02:00
Géry Debongnie 1503ec8883 [FIX] web: make rainbowMan more solid 2017-10-18 13:31:17 +02:00
Prakash Prajapati e302ca7b3d [IMP] mail: display latest records first when previewing templates
And also avoid resetting the body if there is no record chosen.

Closes #18566 .
2017-10-18 13:20:39 +02:00
dip-odoo cad52c81e3 [IMP] purchase: add purchase representative in POs
Instead of just using create_uid as responsible, use a plain user_id
field for the PO and PO agreement responsible. This field is named
purchase representative but works like SO responsible and is now
tracked.

Field is added to various views and filters to ease the daily job
of purchase representative people.

Closes #17788 .
2017-10-18 13:20:26 +02:00
Dhawal Limbuwala 6eaf9de482 [IMP] sale: improve error message when trying to delete confirmed so lines
Closes #18521 .
2017-10-18 13:20:14 +02:00
dbh 8cfee8634c [ADD] hr: add activity mixin on employees
Scheduling activities on employees is something people working in human
resources seem to do sometimes.

Closes #19483 .
2017-10-18 13:19:56 +02:00
Goffin Simon 1108c150d9 [FIX]sale: pricelist price base
Fine tuning of c477f0764e

When setting a pricelist to show the public price discount, it ignored
the pricelist item's base field (if not 'Other Pricelist') and set it
by default on the lst_price instead.

This did not work when you based your discount on the standard_price
(= cost price) with public price discount.

Now it does.

opw:775275
2017-10-18 12:16:27 +02:00
Goffin Simon 130dc1b64f [FIX]sale: pricelist price base
Revert of c477f0764e

In some case product[pricelist_item.base] can be a product.product

opw:775275
2017-10-18 11:28:44 +02:00
Adrian Torres 333a2360d8 [FIX] website_quote: don't unlink website_description
This is a hotfix/hack for a conflict between website_quote and
website_sale, on the field website_description.
The conflict happens when both modules are installed.

Fixes #20118
2017-10-18 11:27:07 +02:00
rde 4618cbd513 [FIX] website: new class to disable button after first click
Before this commit, if you had a simple link (just a href, not handled
in JS), you couldn't simply make it clickable only once.
This could be a problem in some cases. (eg: a btn creating a record, it would
create as many record as many times you clicked on it)
The same behavior could occur for link/button redirecting to a route creating a
record. There is a window of time between the click on the btn and the moment
the page is getting redirected.
You have time to click  multiple time on it and it would call the URL multiple
time.

Now, there is a class 'js_disable_on_click' that will be handled in
website_root.js and will disabled the button after the first click.

The fix was originally aimed to fix multiple click on "Create Page" btn on 404
2017-10-18 10:58:53 +02:00
Goffin Simon 0012eb4c97 [FIX] website_sale: included taxes considered as discount in the shop
Steps to reproduce the bug:

- In Sales settings, set "Tax display" as "Show line subtotals without taxes"
- Create an article A with a customer tax set as price-inclusive.
- associate on an other article B the  pricelist P with a discount_policy
  set as "without_discount"
- Ensure that the pricelist P is used in the shop.
-Go to the shop

Bug: The article A is considered as discounted but the price is full.
The prices with included taxes were considered as discounted because
lst_price - webstie_price were always greater than 0. When the
"Show line subtotals without taxes" is checked  for Tax display,
the field website_price never includes the taxes. That's why the
included taxes are substracted from the website_price.

opw:776526
2017-10-18 10:15:03 +02:00
Goffin Simon f971ed704c [FIX]sale: pricelist price base
Fine tuning of this commit: c477f0764e

opw:775275
2017-10-18 09:49:34 +02:00
Géry Debongnie d365a289d4 [FIX] web: generate proper x2many commands in some cases
When creating a new record with a non empty default value for a one2many
field, we did send the command 0 (for each one2many line) instead of the
command 1 (update).  This was a pretty big problem, because then the
server would try to create a line with possibly incomplete data.

For example, it was not possible to create expense sheets: go to expense
menu, select one expense in the list view, click on the action menu
'submit to manager', this opens a form view with a one2many with the
selected expense, then save.  Before this commit, this would lead to a
server error.
2017-10-17 18:21:47 +02:00
rde e0fbe7b5be [FIX] website_sale: disable checkout btn if GTS unchecked at load
opw-774286

*Before this commit:
On checkout, you can enable a step to force user to have the General Terms of
Sale checked to continue the checkout. Checking/Unchecking will correctly
disabled/enabled the button.
The checkbox is already checked at page load (on the template).
BUT, if the template has been modified to set the checkbox as unchecked at load
(eg the user removed 'checked="checked"' from the template), the button will
still be enabled even if the checkbox is unchecked.

*Now:
No matter if it is checked or not on the template, the button will
correctly be enabled/disabled regarding the checkbox state at load.
2017-10-17 17:40:41 +02:00
HIRAL BHAVSAR 3285a0384c [FIX] mail: Wrong codepoint for angry emoji. 2017-10-17 17:23:30 +02:00
Nicolas Martinelli 6c8e6fb2e9 [FIX] stock: save settings
This reverts commit 0e28db88d1.
This commit should not be in saas-15.

opw-776890
2017-10-17 17:11:30 +02:00
Xavier Morel d18b160505 [FIX] website_forum: properly read the faq
On P3, "text" IO (open(f, mode='r')) will default to the encoding
provided by locale.getpreferredencoding(False) which apparently is
regularly cp1252.

Replace by misc.file_open which enforces UTF-8 decoding in text mode.
2017-10-17 17:10:31 +02:00
Martin Trigaux 727a642f5c [FIX] crm: match count with result
Followup of 4ebb5efac
2017-10-17 16:53:17 +02:00
Nicolas Martinelli a13120c039 [FIX] resource: default TZ
If TZ is not set on a user, the creation of a `hr.leave` won't populate
the `tz` field of the associated `resource.calendar.leaves` record.
However, the method `_get_leave_intervals` assumes that field field is
always filled in.

Set the TZ to UTC as a fallback.

opw-777031
2017-10-17 16:38:45 +02:00
Martin Trigaux 4ebb5efac4 [FIX] crm: match filter result with count
At 9d2f48dc and abea8d35 the `not opp.date_closed` condtion was added when
counting the number of overdue opportunites.
The result filter was still considering the closed opportunities.

opw-774421
2017-10-17 16:23:07 +02:00
Laurent Smet 6e46ba7b46 [FIX] point_of_sale: fix taxes rounding in POS
Don't round the base amount at each step during compute_all of taxes.

-opw: 776986
2017-10-17 16:22:20 +02:00
Agathe Mollé 4d56e76d52 [FIX] Fix canadian province state_ca_NL name 2017-10-17 16:18:13 +02:00
jaredkipe d7cfa8c502 [FIX]: safe_eval’ing some large scripts yield illegal opcodes
Following the 3.6 wordcode change, EXTENDED_ARGS gets used for jumps
offset by more than 256 bytes (128 opcodes), most commonly
absolute (so many script of more than 128 opcodes with conditionals
arer going to trigger the issue).

In bytecoded Python versions, EXTENDED_ARGS was only necessary above
65k opcodes: the opcode would get a separate 16-bits argument, while
wordcode opcodes get 8-bit intrinsic.
2017-10-17 16:16:42 +02:00
Wolfgang Taferner c30f8c50a3 [FIX] stock, sale_stock: blocking a process twice due to cancelled moves 2017-10-17 16:05:53 +02:00
Xavier Morel 90d9605c86 [FIX] web: encoding issue with moment locales
I don't quite get how it can trigger on user systems (as it apparently
requires resetlocale() to fail to set up an UTF-8-encoded-locale
somehow, disabling resetlocale() is how I could get the issue
triggered on my system), but anyway it's apparently possible for Odoo
to run with an ASCII system encoding, and it turns out Python 3 will
not use UTF-8 everywhere but will rather use whatever
locale.getpreferredencoding(False) yields, which in theory could be
completely bonkers.

This is an issue when using text IO with an implicit encoding, which
is what load_locale (/web/webclient/locale/<lang>) was doing.

* Fix by using binary IO
* Fix (2) by using direct-passthrough IO with specified encoding, that
  way we let the WSGI server handle the file streaming

Fixes #20075
2017-10-17 16:04:35 +02:00
fda-odoo a1e15b9fce [FIX] web: use "get_formview_id" when opening record from calendar view
Opening a record in a calendar view always showed the default form view when it is not a popup.
Example in CRM: opening an opportunity will always show a lead view.

The fix aims to use the "get_formview_id" method to find the right id of the view that must be shown instead
of using a default id.

opw-774272
2017-10-17 15:34:29 +02:00
fda-odoo a0fcd5c781 [FIX] web: use "get_formview_id" when opening record from calendar view
Opening a record in a calendar view always showed the default form view when it is not a popup.
Example in CRM: opening an opportunity will always show a lead view.

The fix aims to use the "get_formview_id" method to find the right id of the view that must be shown instead
of using a default id.

opw-774272
2017-10-17 15:25:41 +02:00
Christophe Simonis 868e718e09 [MERGE] forward port branch saas-15 up to 8d0942380b 2017-10-17 15:14:47 +02:00
alexkuhn a48b5c45aa [FIX] crm: stage auto-probability not taken into account when creating an opportunity from kanban view (#20209)
1. on CRM module -> Select Pipeline -> Create a column (e.g. 'Test')
2. Edit this Stage
3. Toggle on the field 'Change Probability Automatically'
4. Set a stage probability (e.g. 50%)
5. Create an opportunity on this stage, using the quick create widget of the kanban view
=> The probability of the newly created opportunity is not 50%, as it should be expected

It takes the default_probability, using a default_stage_id, which is the 'New' column having initially a probability of 10%. The stage_id is correctly assigned to the newly created opportunity thanks to environment variable 'default_stage_id', but not the probability.

We solved this bug by updating the probability of the opportunity, after creating the object. We cannot do it at the same time, because BaseObject.create parse the missing fields in an order where probability comes before stage_id.

This fix is limited to the quick creation of opportunity by means of its name only. In particular, it doesn't overwrite the input of the user in the form view.

opw-772310
2017-10-17 14:20:30 +02:00
Nicolas Martinelli 539a09a93c [FIX] stock: use method return
In case MRP is used with kits (phantom BOMs), the method
`action_explode` is called through the override of `action_confirm`.
However, `action_explode` modifies the recordset by deleting the move
with the original product since it is not relevant anymore.

We take this use case into account by reusing the return value of
`action_confirm`.

opw-772644
2017-10-17 13:53:00 +02:00
Raphael Collet 9ae78328ec [FIX] fields: writing on a one2many with a domain should not remove all lines
Specifically, the command `(6, 0, ids)` should only unlink/detach the lines
that satisfy to the field's domain.

Test from #18440

opw-756983
Closes #18438
Closes #18440
2017-10-17 13:50:00 +02:00