Commit Graph
117975 Commits
Author SHA1 Message Date
jem-odoo 8d4609a1db [MOV] purchase: move file in purchase_stock 2018-05-23 10:13:48 +02:00
jem-odoo 9548d218f1 [IMP] purchase: make purchase report extendable
The idea is to do like the sale report: being
able for other modules to extend the report and
add their own fields. As we are going to split
stock from purchase, we will need this.
2018-05-23 10:12:45 +02:00
Alexandre Kühn 8dbebe0242 [FIX] web: fetch name_gets on list only when there are data
Revision on 8ac98fc78a

The commit above does not check whether the list contains data or not.
As a result, if there are no data in the list, there is no reason to
fetch `name_gets`.

In fact, there could be a traceback because some parameters of this rpc
are computed from data in the list. So if there are no data in the list,
the parameters of the rpc are undefined. This was the case for a test
in enterprise.
2018-05-23 09:43:12 +02:00
Alexandre Kühn c587c0029b [FIX] web: only abandon records on discard without savepoint
Revision on https://github.com/odoo/odoo/commit/9a9da5763b38a3bce54e9c4870af0032e38cacc3

The intent of the commit above was to no abandon records in a list on
discard when these records have been created from a `default_get`.

Also, the `default_get` may also perform an `onchange` that could create
more records. The records from this `onchange` must also be included in
the "do not abandon" rule.

However, the rule was too relax, so that any following `onchanges` from
a user interaction was also considered into this rule. As a result, it was
not possible to abandon such records.

With this fix, we restrict the rule to `default_get` (already the case) and
only the `onchange` right after a `default_get`. Any record created on an
`onchange` from a user interaction after a `default_get` should be abandoned
on discard.

Representation of creating the list:

                               savepoint
   |----------|-----------|-------||--------|------->
 create   default_get  onchange1         onchange2

record in the list is created by default_get or onchange1
    => do not abandon on discard
record in the list is created by onchange2
    => abandon on discard
2018-05-23 09:43:12 +02:00
len-odoo cf82fbab5f [FIX] mrp: display info text on work orders view
When seeing the work orders view, it would display an empty black box instead of
the proper message.

The message is not displaed since creation is deactivated.

opw 1839001
2018-05-23 09:31:13 +02:00
Lucas Perais (lpe) d1df278f01 [FIX] stock: portal user can see pack operations
Have a delivery for a client, with pack operations
Connect on this user's portal

Go on the SO and then on the delivery

Before this commit, there was an Error 500
because access to fields of pack_operations was forbidden

After this commit, the report downloads well

OPW 1849520
closes #24849
2018-05-23 09:18:21 +02:00
David 682ae1cc64 [FIX] website_form: set meta field
Before this commit, if you enable website_form_enable_metadata, that
will crash with a "KeyError: 'meta'"

This commit closes #24848
2018-05-23 09:16:32 +02:00
len-odoo 4e57f94ff9 [FIX] calendar: do not create events past year 9999
datetime.date(year, month, day).weekday() is undefined for year > 9999.
When creating a google recurrent event that is set to never end,
Odoo tries to create 100 individual events.
If in Google calendar the user sets a recurring event to a custom interval,
of say a century, then the hundredth event is in 100x100 years, so in 12018.
Since 12018 > 9999, we get a traceback and synchronisation never happens.

opw 1845311
2018-05-23 09:11:20 +02:00
Adrian Torres 793438915a Revert "[FIX] iap: missing dependency (#24816)"
No dependency change in stable version, instead, an installation hook
should be used.

This reverts commit e9e0f4afc3.
2018-05-23 09:06:40 +02:00
Ivan Yelizariev e9e0f4afc3 [FIX] iap: missing dependency (#24816)
The module uses web_settings_dashboard, but doesn't have it in dependency
2018-05-23 08:43:05 +02:00
Josse Colpaert 8b328665f7 [FIX] mrp: workorders of sub-BOMs
- Create the following BOM structure:
```
  Prod 1 (Manufacture)
  |
  --- Prod 2
      Prod 3 (Kit)
      |
      --- Prod 4
	  Prod 5
```
- The BOMs for Prod 1 & 3 must have a routing set, to generate
  workorders
- Create a MO for 1 unit of Prod 1, process to the end

2 units of Prod 1 are created instead of 1.

This is due to the WO for Prod 3 not having a `next_work_order_id`.
Therefore, `record_production` adds an extra quantity at:
```
production_move.quantity_done += self.qty_producing
```

To prevent this, we set as `next_work_order_id` of the BOM of Prod 3 the
WO of Prod 1.

Closes #19527
opw-1817398
2018-05-23 08:29:27 +02:00
RomainLibert db649229a1 [FIX] pos: rename pos_pricelist_setting
To avoid two fields having the same label we rename this one.
2018-05-22 18:07:03 +02:00
Pierre Masereel 7e6b259c78 [FIX] stock: is_initial_demand_editable computation
When we perform a planned transfer (which is the default behaviour now)
we are not able to set a quantity done on move lines in a confirmed
move because, the field 'is_initial_demand_editable' is true but should
not.

To fix this, we set 'is_initial_demand_editable' to true when it is not
a planned transfer AND the state of the move is draft, which is the
desired behaviour.

This behaviour come from rev:https://github.com/odoo/odoo/commit/ffb79761c1225c8a9c9303db4781f1b40b5d9944
2018-05-22 17:13:45 +02:00
Christophe Simonis 3d7b238b8e [FIX] core: correctly decode 8bit mail headers
When an header contains surrogates, an Header object is returned when
read headers from Message objects.

Also, correctly join header parts in python3.
2018-05-22 16:45:59 +02:00
Christophe Simonis ea3385b41c [MERGE] forward port branch saas-15 up to 9622455f9e 2018-05-22 16:30:03 +02:00
Christophe Simonis 9622455f9e [MERGE] forward port branch saas-14 up to 32a35ccda5 2018-05-22 16:02:56 +02:00
Ankit Joshi e434690fe3 [IMP] pos: ease starting steps by adding general settings
In order to facilitate the usage of the pos app, we need to add a global
settings menu (res_config_settings).

Related to task #34026
Closes #19443
2018-05-22 15:44:34 +02:00
Christophe Simonis 32a35ccda5 [MERGE] forward port branch 10.0 up to 45e2ee0a9b 2018-05-22 15:19:10 +02:00
Darshil Trivedi 4699f3c2bf [IMP] stock: scheduled date as current datetime on return.
When a picking is returned, the scheduled date stay unchanged. This date can be
in the past if the return is made at least one day after the transfer. This commit
set the return day as scheduled date
2018-05-22 15:00:30 +02:00
Darshil Trivedi 7eff8d39a7 [IMP] stock: add scheduled date on picking.
When a picking is in 'Done' state, we add the effective date on the form in
addition to the effective date. The user can know the date when the picking was effectively
made.
2018-05-22 15:00:30 +02:00
Christophe Simonis 45e2ee0a9b [MERGE] forward port branch 9.0 up to 0fd06e5948 2018-05-22 14:23:55 +02:00
Randall Castro 42fb77ceba [FIX] l10n_cr: backport of 9da8378a0a
[FIX] l10n_cr: adapt state code

Change res.country.state code to follow ISO 3166-2:CR
https://www.iso.org/obp/ui/#iso:code:3166:CR

Backport asked at #24673
2018-05-22 14:05:21 +02:00
Damien Bouvy d5c7370a93 [FIX] base: avoid faulty image url for 1000+ users
Starting with the 1000th user, the kanban view returns the id value
as '1,001', which, for some reason, does not go well when trying to
find the attachment by url...

Use `raw_value` instead, which does not format the id value.
2018-05-22 13:36:37 +02:00
Nicolas Lempereur 076ececb57 [FIX] stock: no loop in traceability report
Depending on the situation, it is possible to have move with origines
and destinations that have a loop.

A simple example is a return of a return, the origin and destination of
the return of a return is the return itself.

opw-1845444
closes #24787
2018-05-22 12:50:20 +02:00
Mathieu Duckerts-Antoine e7ecdb8c46 [MOV] mail: move crons into their own data file
Purpose is to avoid mixing various data types in the same generic mail_data
file. We already have 2 crons and the upcoming moderation feature will add
some more. Let us put them in their file to ease the finding.

This commit is linked to task ID 29521.
2018-05-22 12:29:08 +02:00
William Henrotin f7cda99d20 [FIX] stock: correct picking view
The commit ffb7976 introduce a wrong domain in the picking form view.
This commit correct it to the previous value
2018-05-22 11:58:53 +02:00
Hiral Bhavsar 0ccf63cae4 [IMP] sale: new test cases for sale
This commit provides a test suite for sale flow and unit tests.
We split tests in different files to try regrouping them by
testing purpose:

1/ test_access_rights.py checks employee, sale person, sale manager
and portal access rights. It is executes in post-install mode to be
sure other addons does not break the security rules.

2/ test_onchange.py checks the onchange using the SFF mecanism in
order to simulate what a sale person really does in its day-to-day
job.

3/ test_sale_pricelist.py execute a sale flow with different pricelist,
as this is a delicate aspect.

4/ test_sale_to_invoice.py contains tests about refund, discount and
downpayment, as none of those were tested.

Task #43928
2018-05-22 11:52:51 +02:00
Hiral Bhavsar ef37686b2a [MOV] sale: 'test_product_id_change' to 'test_onchange'
Renaming this file as, in next commits, we
will add more tests about onchange in that
file.

Task #43928
2018-05-22 11:52:44 +02:00
jem-odoo 13a9e4d93a [FIX] sale: missing triggers on invoice_ids
As 'invoice_ids' on sale.order is a computed field, creating
a refund should invalidate this field as 'invoice_ids'
should contain invoices, refunds, ...
When using the refund wizard, the credit note will be linked
to the SO lines (see `_refund_cleanup_lines` override in sale).
Without the new trigger, invoice_ids will not be recomputed, and
executing 'sale_order.invoice_ids[1]' will not return the refund
account.invoice.
This commit fixes it.
2018-05-22 11:52:37 +02:00
jem-odoo c71ee8e2d2 [FIX] sale: stop browsing recordset
`currency_id` variable is a recordset, so stop browsing it again !
In the meantime, if those variable had a meaningfull name, this
error would never occured !
Coming from 7a282c9965
2018-05-22 11:52:30 +02:00
jem-odoo dafb9b2638 [FIX] sale_expense: expense count of SO should be compute in sudo
Without this commit, reading all fields of sales
order will raise an access error if user does not
have access to hr.expense documents. An since
the expense count is displayed on the form view, this
can be annoying.
This commit makes the computation of the expense
count done by 'sudo', as there is not critical
informations at stake.
2018-05-22 11:52:19 +02:00
David Arnold c88d5cf1f8 [FIX] l10n_cr: update copyright
DevCO ceased to exist

Closes #24830
2018-05-22 11:37:17 +02:00
Samuele Carli 1d245deddd [ADD] base: add missing Sud Sardegna italian province
Close #24485
2018-05-22 10:45:39 +02:00
Samuele Carli cd9e432579 [CLA] WohthaN signs the CLA
Done at #24485
2018-05-22 10:45:26 +02:00
stefanorigano b637b5aeb8 [REF] hr_attendance: revamp design
Improve mobile layout, uniform templates design, simplify and revamp SCSS

Related to task #1822709
Closes #24645
2018-05-22 10:43:10 +02:00
Jeremy Kersten 2a43614c3c [FIX] web_editor: avoid traceback when open img editor
In some case, (e.g.: demo data), datas_fname is undefined and match of
undefined will crash and block the modal to be opened.

Uncaught TypeError: r.datas_fname.match is not a function
2018-05-22 10:39:35 +02:00
stefanorigano 716640bb67 [FIX] hr_attendance: invert icons for sign-in/out
Set the right employee's possible states.

Before the restyling, the main title was always “Welcome!” regardless
of the user state (checked_in or checked_out). Using conditional titles
has exposed the issue.
2018-05-22 10:38:05 +02:00
oco-odoo 943075fd94 [FIX] purchase: anglosaxon stock valuation: use correct currency rates to determine whether or not to create a price difference line for invoices. (#24815)
Before that, the following scenario (tested in purchase/tests/test_anglosaxon_valuation_reconciliation.py) failed:
- create a PO
- change of currency rate
- create and validate vendor bill in foreign currency
- receive goods
- change of currency rate
- return the goods
- change of currency rate
- refund the bill

At the end of it, both invoices (bill and refund) were not in 'paid' state, but they should have been! The anglosaxon stock valuation code had some issues in the way it managed currency rates. The main one was that we converted the computed valuation_price_unit variable in company currency using the date of the invoice as a reference, which was wrong in case the invoice was a refund, as it should then use the date of the valuation for this. This problem caused the code to detect an exchange rate difference between refund and valuation as a price difference, hence generating a line in the price difference account, which caused the debtor account line of the associated account.move to be wrong, and hence impacted the residual field of the invoice ("amount due", in GUI). Finally, as this field contained an inconsistent value, the refund invoice was not marked as paid after reconciling it with the original one.

Solving this needed to refactor the code quite a bit, so that we don't convert everything in invoice currency in the end, but rather do it directly everytime we compute a part of valuation_price_unit. The test had also to be partly re-written as it was too naive in the way it used currency rates, we needed something closer to a real utilisation of the program.
2018-05-22 10:20:49 +02:00
Josse ColpaertandNicolas Martinelli bf65cd83ab [IMP] mrp: add check for unproduced finished lots
- Create a Finished Product tracked by SN
- Add a BoM with routing (in several steps) to that product: component A
  should be consumed in 1st step and component B in 2nd step
- Create a MO, plan it, go on the first WO and produce the finished
  product with SN 0001
- Then go on the second WO and produce the finished product with SN 0002
- Back on your MO, you'll see that
    Finished Product = SN 0002
    Component A has been consumed for SN 0001
    Component B has been consumed for SN 0002
- Mark the MO as done

No blocking error is raised so I'm consuming a product for a finished
product I'm not really producing. Traceability report will be wrong too.

We raise a blocking error to avoid this use case.

opw-1832098

Co-authored-by: Nicolas Martinelli <nim@odoo.com>
2018-05-22 09:45:47 +02:00
Géry Debongnie b709e22fa2 [FIX] project: reintroduce subtask_project_id field
The subtask_project_id field was removed by task #38498, amongst many
other changes.

This change makes some workflows much more difficult: for example, using
a different project with its own columns is kind of awkward.  It
requires many more clicks and custom filters to achieve the same result
as previously.

With this commit, we simply reintroduce the field and use it to set the
default project_id of a subtask.
2018-05-22 09:39:41 +02:00
Odoo Translation Bot b658aeb3b7 [I18N] Update translation terms from Transifex 2018-05-20 07:04:05 +02:00
Odoo Translation Bot 9dd56e1972 [I18N] Update translation terms from Transifex 2018-05-20 04:09:56 +02:00
Odoo Translation Bot b6419117d9 [I18N] Update translation terms from Transifex 2018-05-20 00:26:31 +02:00
Joren Van Onder 0fd06e5948 [FIX] pos_mercury: set the paid amount to what is authorized by Mercury
Mercury can partially approve transactions in case a card does not
have enough credit available to cover the full amount.

Before this the payment amount was kept as the full purchase amount
leading to a difference between what Mercury charged and what Odoo
registered as charged.

opw-1840946
2018-05-18 13:23:08 -07:00
Christophe Simonis 8383181b8f [MERGE] forward port branch saas-15 up to 021d0e6a98 2018-05-18 18:59:06 +02:00
Christophe Simonis 021d0e6a98 [MERGE] forward port branch saas-14 up to cabe0951af 2018-05-18 18:54:26 +02:00
Christophe Simonis cabe0951af [MERGE] forward port branch 10.0 up to 9001a75f23 2018-05-18 18:53:56 +02:00
Carlos Dauden 9001a75f23 [IMP] analytic: Performance on _compute_debit_credit_balance
Courtesy of Carlos Dauden.
Was PR #24660
2018-05-18 17:39:00 +02:00
Alexandre Kühn 8ac98fc78a [FIX] web: show names of many2one on default_get
Before this commit, some records in a list did not show the name of their
many2one fields.

This case occurs when the records in the list are created from a default_get,
and the records do not fit in a single page. In that case, the records in the
first page correctly display the names of their many2one fields, but not the
records in the other pages.

Fixes #24547
2018-05-18 17:30:34 +02:00
Alexandre Kühn 6f7031e9fb [FIX] web: pass unique ids on name_get rpc
Before this commit, when a list contains records with many2one fields that
contain the same values, duplicate ids were passed to the server on rpc
`name_get`.

For instance, if 40 records in a list refer to a Unit of Measure with id "1"
whose displayed_name is "unit(s)", the server receives a long list of ids with
simply the value "1". Also, the server responds with a list of displayed_name,
in this case a list of 40 strings "unit(s)".

With this commit, we always pass unique ids to the server on rpc `name_get`.
2018-05-18 17:30:34 +02:00