Commit Graph
116747 Commits
Author SHA1 Message Date
Christophe Simonis ac63dfc8f4 [MERGE] forward port branch 11.0 up to 8dade01e2c 2018-05-04 16:10:50 +02:00
Christophe Simonis 8dade01e2c [MERGE] forward port branch saas-15 up to 333a58e4ef 2018-05-04 15:13:49 +02:00
Arnold Moyaux 972d8a1108 [FIX] mrp: tracked by product with routing
Use case to reproduce:
- Create a BOM with a byproduct tracked and a routing
- Mark the last workorder as done
- by products move line are not created
With the wizard produce (MO without routing) move lines
are created. Thus there is an inconsistency.

It happpens because workorders and produce button do not use
the same function. commit 1a09bcc622
already fix it for production wizard however it forgets workorders
process.

opw-1838707
2018-05-04 15:03:49 +02:00
Christophe Simonis 333a58e4ef [MERGE] forward port branch saas-14 up to 4e90a676da 2018-05-04 14:19:53 +02:00
Nicolas Lempereur 2b0d68bc41 [FIX] mail: activity in date tz but counts are not
When creating an activity, the date saved will be the choosen one in the
tought in the client timezone.

But when displaying the counts of activities Late/Today/Future, the date
is tought out as the one in the server timezone.

Thus we would have activity today/future/late not corresponding with the
date in the current timezone.

This is solved in this change and follow what was done in 72254129.

A second change is made so the default "Due date" is today in the
timezone and not today in UTC date.

opw-1837894
closes #24554
2018-05-05 00:38:35 +13:00
Nicolas Martinelli c3ddef161e [FIX] account_check_printing: multiple partners
- Create a bill for partner A of an amount X
- Create a bill for partner B of an amount Y
- Validate both bills
- Select both and register a payment by check.

Two payments are created with the same amount in words: X + Y.

In this specific case, we recompute the amount in words automatically.

note: this commit reintroduce the fix c52b18e65 which was lost after
changes in 10.0 (line was removed then brought back with 416d07f0b).

opw-805842
closes #24569
2018-05-04 01:33:55 -10:00
Christophe Simonis 4e90a676da [MERGE] forward port branch 10.0 up to 4b7f4f32ea 2018-05-04 13:19:12 +02:00
Romain Derie b5516d400e [FIX] website_sale_comparison: use variant id and not product id
Before this commit, the compare button from the customized view "Alternative
Products" would create the URL by joining `alternative_product_ids` which are
ids from product.template.
But the route /shop/compare is supposed to receive variants (product.product)
IDs.
Thus, it would try to search given product.template IDs in product.product
records.
It would then show incorrect items or no items at all if the ID does not exist.

Now, we create the URL with the first variant (product.product) of the
product.template.
Obviously, the first product.product is arbitrary but we can't retrieve all the
variants ids, it would most of the time returns too many items.

opw-1840321
2018-05-04 12:58:20 +02:00
Simon Lejeune 3d8c0df8bf [FIX] stock: quant: reserve and unreserve on duplicated quants
In a situation where there's a negative quant next to a positive one,
they should be merged when the scheduler runs or when the user open its
inventory view. However, if in the meantime the user reserves and
unreserves, there may be some issues.

The system will only reserve on positive quant ;
the system will unreserve on the first encountered quant (even negative)

The issue is the second part of the early break condition:
    float_is_zero(available_quantity, precision_rounding=rounding):

The issue here is `available_quantity`. In a reservation scenario, it
represents the maximum quantity we can reserve across quant. It is
useful so we do not lose time loopin over quants where nothing will be
available. In an unreserve scenario however, it represented the same
thing, which is wrong. In the case you reserved all the quantities,
`available_quantity` will be 0 we'll loop only on the first quant where
we won't do anything.

As the code doesn't check the success or failure of the unreserve, move
lines were unlinked while the reserved quantity on the quants were not
updated, resulting in the desynchronization of the move lines/ reserved
quantities.

This continues the work done at [1] to track down the "cannot unreserve
more than" errors.

[1] cce6030c0d
2018-05-04 11:52:36 +02:00
Christophe Simonis 62705aee69 [FIX] purchase: delay tests with CoA after install 2018-05-04 11:24:24 +02:00
Aaron Bohy 6e15a9cd24 [FIX] web: one2many form view with action button
Assume a one2many field inside a form, displaying field A in its
list view, and a field B in its (dialog) form view. Moreover, there
is an action button in the dialog, which updates the value of B.

Before this rev., B wasn't correctly reloaded when the button was
clicked, because the BasicModel reloaded the fields on the list
view (i.e. field A), whereas it should reload the fields in both
views.

This fix is twofold. First, we force the viewType to 'form' when
the record is reloaded, instead of the default ('list'), so that
fields in the form view are correctly reloaded. Second, when we
open the form view in the dialog, we add the fields of the list
view to the dict of fields of the form view, so that the form
is aware of those fields and can ask the model to reload them
(still without displaying them).

Fixes #24189
2018-05-04 10:42:05 +02:00
Thibault Delavallée 901658df26 [REM] mail: remove duplicated method
This commit remove duplicated code probably due to a forward-port of a backport
or something like that. Or maybe due to a cosmic beam.

See commits https://github.com/odoo/odoo/commit/14f80bfae66f2c81abb0b8acc0ac558c60ef1d44 and https://github.com/odoo/odoo/commit/36141931bf9a57d01747cb219fdcfdfd7978ab42.

Cheers.
2018-05-04 10:27:58 +02:00
Christophe Monniez 7202205688 [FIX] packaging: avoid traceback on virtual machine timeout
When the virtual machine used to build MS Win package takes too much
time (to build or to test the build), a warning is logged and the VM is killed.

Before this commit, the PID of the process was passed as an argument to
the warning method, causing a traceback.
2018-05-04 10:09:31 +02:00
SEINLET Nicolas b0c08a6846 [FIX] api: optimize way to retrieve records to prefetch (#24503)
Instead of searching for ids in the whole cache, search for the ones we will potentially prefetch.

Example: imagine you have 1K records in cache, and only 3 records in your prefetch set. Instead of retrieving the 1K records that have a value in cache, retrieve which of the 3 records that have no value in cache.
2018-05-04 09:59:45 +02:00
Olivier Dony c10b0b5f9e [IMP] purchase: show billing status on portal page
It's useful to display that a PO is waiting for a supplier bill on the
portal, so the supplier is reminded about that.
2018-05-03 18:34:53 +02:00
Pierre Masereel 772ce29193 [FIX] mrp: product unit of measure precision in produce wizard
The precision digit on the produce lines is not set to the product unit
of measure one. That can lead to a lost of precision when a small values
are set in the manufacturing order and not in the produce wizard.

OPW-1838077
2018-05-03 16:48:20 +02:00
Pierre Masereel 4102f38f15 [FIX] mrp: round up quantity to consume in produce wizard
When moves of a MO are generated, they are rounded up to the decimal
precision of the rounding, what is not done in the wizard.

So to keep it consistent, we also round up the quantity to consume in
the wizard.
2018-05-03 16:25:21 +02:00
Christophe Simonis 4b7f4f32ea [MERGE] forward port branch 9.0 up to f12daec1a1 2018-05-03 16:25:17 +02:00
Christophe Simonis 072c04c53c [FIX] web: correct tests after previous forward-port 2018-05-03 16:11:02 +02:00
Akash Bhavsar 8b7fb9a764 [FIX] mail: Do not close chat widnow if ESCAPE key is pressed on document viewer and keep focus on chat window input when document viewer is closed (#22741)
If document viewer is opened from chat window and when document viewer is opened then focus 
remains on it's modal, pressing escape should set focus back to chat window's input element,

if file selecor dialog is opened and if user press ESCAPE on file selector dialog to cancel file selector 
dialog then it should not close chat window instead it should set focus on chat window input and on 
second ESCAPE key chat window should be closed
also increase z-index of document viewer dialog so image remain on top of cht window

OPW: 1777937
2018-05-03 15:16:56 +02:00
Simon Lejeune cce6030c0d [FIX] stock: symmetric reserve and unreserve
When an internal locations has its `scrapped` field set to True,
reserving will increment the quant's `reserved_quantity` while
unreserving will bypass the reservation mechanism (as in a supplier
location). This leads to a desynchronisation between the
partially_available/available move lines and the quant's
`reserved_quantity`, leading later on to "cannot unreserve more than
available" errors.

To prevent this kind of issues, there's a `should_bypass_reservation`
method set on the location that we *should* use everywhere, it was
implemented by [0]. Sadly, this line was not adapted since its
implementaton in [1].

Co-authored by len-odoo <len@odoo.com>

opw 1837900

[0] e1cea2640f
[1] 0469d2e712
2018-05-03 14:03:42 +02:00
Lucas Perais (lpe) f49a6b6ebe [FIX] website_slides: avoid double slash in slide url 2018-05-03 13:52:45 +02:00
Olivier Dony 78ce64a6a7 [FIX] account: do not block reconciliation on different partners
This constraint was added during the Great Accounting Reform of v9, in
an attempt to help users avoid reconciliation mistakes.

It turns out that such mistakes are difficult to make in normal
situations, since the system only offers matching entries to reconcile,
so the constraint is largely redundant.

On the other hand, it does block legit cases of reconciliation,
such as those where a large number of lines with different partners are
reconciled together. This often happens when reversing a Journal Entry
that encompasses multiple customers, such as a POS closing entry, or a
manual entry.

To make the system more flexible, let's consider that when a manual
reconciliation breaks the "single partner" rule explicitly, it's for a
good reason, so we should allow it.

OPW: 1840437

Backport of 8e73023f68
2018-05-03 12:17:55 +02:00
Olivier Dony 8e73023f68 [FIX] account: do not block reconciliation on different partners
This constraint was added during the Great Accounting Reform of v9, in
an attempt to help users avoid reconciliation mistakes.

It turns out that such mistakes are difficult to make in normal
situations, since the system only offers matching entries to reconcile,
so the constraint is largely redundant.

On the other hand, it does block legit cases of reconciliation,
such as those where a large number of lines with different partners are
reconciled together. This often happens when reversing a Journal Entry
that encompasses multiple customers, such as a POS closing entry, or a
manual entry.

To make the system more flexible, let's consider that when a manual
reconciliation breaks the "single partner" rule explicitly, it's for a
good reason, so we should allow it.

OPW: 1840437
2018-05-03 12:16:00 +02:00
Christophe Simonis ad802d0d55 [MERGE] forward port branch 11.0 up to c591e0de7d 2018-05-03 11:21:42 +02:00
Goffin Simon c591e0de7d [FIX] stock: Scheduled Date on transfers
When creating a transfer from:

Dashboard > Planned Transfer

The scheduled date is not configurable as explained in commit:a57a290bd89bee0c50c9c1b03e7185c0497e89ed

opw:1838620
2018-05-03 11:15:28 +02:00
Goffin Simon 7353405aa4 [FIX] stock: Scheduled date purchase order wrong
When running the scheduler for a reordering rule, the delivery lead time
of the seller was not taken into account.

opw:1837550
2018-05-03 10:29:14 +02:00
Nicolas Lempereur fd44ff38a3 [FIX] stock: reserved qty, typo expected singleton
In 4322985a at one point several stock.move could be selected when we
just wanted the first one.

opw-1840719
closes #24538
2018-05-03 10:14:11 +02:00
Odoo Translation Bot d6050c9d07 [I18N] Update translation terms from Transifex 2018-05-03 10:11:45 +02:00
Goffin Simon aca19ceea6 [FIX] stock: Scheduled Date on transfers
Before this fix, it was impossible to change the date when
creating a transfer in a warehouse.

opw:1838620
2018-05-03 09:37:25 +02:00
Nicolas Lempereur f12daec1a1 [FIX] web: don't change page before saving
When we edit a list view and change page before the change has been
savec, the saving and page changing will be done concurrently thus
possibly causing an error if the page is changed before the saved is
finished: the save will try to modify the page that is no more
displayed.

In this change, the list view editable wait for the saving to be
finished before reloading its content.

note: for 9.0 up to saas-15

opw-1839149
closes #24471
2018-05-03 09:11:44 +02:00
Nicolas Martinelli f536592691 [FIX] web: inline views should share their fields
This causes issues (already 3, and counting...)

This reverts commit 27c9f838d3.

opw-1840984
opw-1841041
opw-1841000
2018-05-03 08:30:55 +02:00
Joren Van Onder a91512daf6 [FIX] gamification: support large amounts of goals in update_goals
update_goals is called through the 'Run Goal Challenge Checker'
cron, potentially on a large amount of goals.

With self containing ~400k records a worker has been observed to use
~3.4 GiB. With sensible memory limits this will probably cause the
worker to be killed.

To avoid this turn of prefetching in this initial loop. Performance
shouldn't be affected too much because in the following loop
prefetching for goals will still take place per definition.

opw-1840666
2018-05-02 16:01:50 -07:00
Christophe Simonis 87e21ccdc5 [MERGE] forward port branch 11.0 up to 521414b1c1 2018-05-02 19:36:16 +02:00
Martin Trigaux 521414b1c1 [FIX] l10n_be: remove hardcoded translations
These translations were for the first company only ('1_' part)
The process_translation part in l10n_multilang is enough to propagate the
translations of the templates to the accounts
2018-05-02 17:03:31 +02:00
Christophe Simonis f3af5745ca [FIX] website_slides: import function from right place
Oversight of previous forward-port
2018-05-02 16:32:30 +02:00
Oscar Ulises Garza Cordova cfe094acee [FIX] stock_account: valuation value on out moves
- Set the system parameter "stock.propagate_uom" to 1.
- Create a Sale Order with a product (1 Dozen).
- Confirm the Sale Order
- Validate the stock picking with 1 Dozen of quantity done.
- See the stock move form.

The value of the stock move is the price unit and not the correct value
because the amount is computed by the quantity_done (1) and not
12 Units.

Closes #24352
opw-1838335
2018-05-02 15:40:01 +02:00
Christophe Simonis 320b631c81 [MERGE] forward port branch saas-15 up to 810603f4ef 2018-05-02 15:34:42 +02:00
K. Aberer 1bf3429b23 [CLA] signature for nomadic-coding
Closes #24515
2018-05-02 14:53:41 +02:00
Christophe Simonis 810603f4ef [MERGE] forward port branch saas-14 up to 55ce6aff10 2018-05-02 14:49:58 +02:00
Christophe Simonis 55ce6aff10 [MERGE] forward port branch 10.0 up to 79bbd1dcb8 2018-05-02 13:52:12 +02:00
Nicolas Martinelli 79bbd1dcb8 [FIX] product: name search not ilike
- Create a product named 'toto'
- Perform a call to `name_search`:
  `self.env['product.product'].name_search('pouet', [], 'not ilike')`

Product 'toto' doesn't show up in the result list.

The domain should take into account that `default_code` can be `False`.

Note: the bug also occurs if the product is called 'trululu'.

opw-1837957
2018-05-02 12:58:52 +02:00
Nicolas Martinelli 5ac9d8e57f [FIX] product: variant in partner_ref
- Create a product with 2 variants (e.g. black and white)
- Create an invoice with one of the variant

The description doesn't contain the attribute name, as it would be in a
SO.

This is because the invoice uses `partner_ref`, which doesn't include
the attribute name.

opw-1839598
2018-05-02 12:39:16 +02:00
Nicolas Martinelli 8ee2a0d191 [FIX] account_asset: avoid company mismatch
On existing databases, the SQL not null constrain is not removed, making
the creation of new assets impossible. This is because a computed field
is not inserted at creation, but written afterwards.

This reverts commit 0c76bd3c63.

opw-1840661
2018-05-02 11:29:51 +02:00
Lucas Perais (lpe) 27c9f838d3 [FIX] web: inline views should share their fields
Have a One2Many
The views of that o2m define two inline views: the list and the form

in the list view, put a field that isn't in the form and used in a domain
Try to add an item to the list
The form pops up

Fill in the data and save & close

Before this commit:
It crashed when evaluating the domain on a field using the field that is not in the form

After this commit:
Subviews share their fields in a special object on the parent record
In our case, the form view checks in that shared resource if the fields it is supposed to initialize
are there.
Hence, this flow doesn't crash anymore

OPW 1837511
closes #24350
2018-05-02 11:09:50 +02:00
Christophe Simonis a33362bb51 [MERGE] forward port branch 9.0 up to 532b11ce41 2018-05-02 11:01:38 +02:00
Géry Debongnie e0424b9603 [FIX] web: fix form_view_id attribute in calendar view.
The way the calendar view selected its form view was broken for two
reasons:

- any value given in the form_view_id attribute was kept as string,
  which means that the string value would be sent to the server, and
  this is not good.
- if no value was set, the calendar view then simply did a do_action
  with the form view id set to false, which means that the default form
  view is used.  This is mostly ok, except when we are in the context of
  an action with a form view which is not the default one.  In that
  case, we clearly prefer the form view from the action.

For example, before this commit, the form view in the timesheet
application (community) is not the same as the default form view on
account.analytic.line.

Note that this commit also adds a small tweak to the mock server to
better simulate errors like the web client does (in session.js).
2018-05-02 10:51:45 +02:00
Lucas Perais (lpe) 208a400b06 [FIX] website_slides: avoid mixed content iframe when computing iframe src
Have a nginx set up with HTTPS (and the web.base.url too, obviously)
HAve a multilang website
Call a slide with the https domain with the non-default lang in the path of the resource
[https://domain/fr_FR/slide....]

Before this commit, when the iframe src is requested for by the browser
the python will transform the url of the iframe by injecting /fr_FR/

When the request for the *content* of the iframe is actually fetched by the browser, there is a mixed content
(though in the SAAS case and through cloudFlare for some reason)

After this commit, since we explicitly form the iframe src with lang, there is no error of mixed content

OPW 1839308
closes #24445
2018-05-02 10:03:22 +02:00
Lucas Perais (lpe) 472c5a4f9f [FIX] web_editor: disable button when html field loading
Commit bed33e1ca2 forgot to include the case
where the html field is in a modal

This commit accounts for that case

closes #24500
2018-05-02 09:58:04 +02:00
Nikunj Ladava 95a90689aa [FIX] l10n_fr{certification,_pos_cert}: Set server actions' 'state' to 'code'
Since these server actions are triggering python code, their 'state' field must explicitely be set to 'code'.
Currently it is taking default value for 'state' field which is, since saas-15, 'object_write' and thus not working as intended.

Was PR #22706
Was task: 1813998
2018-05-02 09:54:58 +02:00