Commit Graph
129186 Commits
Author SHA1 Message Date
Xavier Morel df1aa689be [FIX] web: race condition in export widget
Looks like the race condition dates back to the introduction of
"default" export fields but #32339 made it into a hard error (rather
than silently not load the fields): setting / selecting the default
fields waited in the exports lists to be loaded, but the exports lists
are just predefined lists of fields, that's got no relation to the
loaded or default fields, which are loaded (somewhat implicitly) by
_onChangeCompatibleInput.

As a result, if the lookup of the ir.exports was faster than fetching
the model's fields, we'd execute "select the fields from the list
view" before the exports widget knew anyting about the model's own
fields.

Because the old code iterated on the loaded fields and checked if they
were to enable it would just do nothing (as it would iterate an empty
object). Because the new code iterates on the defaults fields and
looks them up in the records map, it gets an undefined and triggers an
error.

Fix by waiting on the proper RPC call.

Reported-by: Andreas Stauder (@BT-astauder)

closes odoo/odoo#35837

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-08-20 09:26:07 +00:00
Raphael Collet 9920f20e4c [IMP] models: ORM speedup
This branch is the combination of several optimizations in the ORM:

* store field values once in the cache: the cache reflects more
faithfully the database, only fields that explicitly depend on the
context have an extra indirection in the cache;

* delay recomputations by default: use method `recompute` to explicitly
flush out pending recomputations;

* delay updates in method `write`: updates are stored in a data
structure that can be flushed efficiently to the database with method
`flush` (which also flush out recomputations);

* make method `modified` take advantage of inverse fields to inverse
dependencies;

* filter records by evaluating a domain on records in Python;

* a computed field with `readonly=False` behaves like a normal field
with an onchange method;

* computed fields are computed in superuser mode by default.

Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien
Pinckaers.

closes odoo/odoo#35659

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-08-20 12:43:59 +00:00
Hiral Bhavsar e28d3aa4d3 [IMP] crm: merge lead and opportunity form views
When redirecting to record, the wrong 'form' view will sometimes be
loaded. A 'hack' has been done in crm_lead.py to redirect the user to
the relevant 'form' view based on the value of the 'type' field.

However, this solution is not clean as it does not solve all cases
(multiple crm.lead records loaded from the activity systray, reloading
the page after redirection, etc.)

Goal of this task is to solve those issues by merging crm.lead.form.lead and
crm.lead.form.opportunity form views. That way multi records actions will
always display the relevant information according to record type.

Note: Here some fields used as a twice in the form view just to stay
close to the current design. Still few things which are not possible
here for 'lead' and 'opportunity', that is
* A dynamic 'placeholder' on 'name' field.
* A 'domain' on 'partner_id' field.
* A 'widget' on 'probability' field.

Task 47118

closes odoo/odoo#32248

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-20 08:38:52 +00:00
Hiral Bhavsar b63b8e0a11 [IMP] crm: remove useless code
In this commit useless code is removed

  * method 'close_dialog' and 'edit_dialog' from crm.lead;
  * actions: crm_opportunity_report_action_graph,
    create_opportunity_simplified, crm_lead_action_activities,
	merge_opportunity_act;
  * views: view_create_opportunity_simplified

Indeed this is dead code and can be removed to clean a bit module.

Task 47118
2019-08-20 08:37:59 +00:00
David Tran df0cff2628 [IMP] sale: split _create_analytic_account() for potential inheritance
analytic account data preparation is now a hook method
This allows to modify the creation method without unecessary updates

closes odoo/odoo#35784

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-20 08:54:18 +00:00
Hetashree Chauhan c0d3d7e994 [IMP] stock,_account: usability changes
This commit will change,
1. tooltip for stock valuation accounts and costing method
2. change message when on-hand quantity is zero.
task-2006467

closes : https://github.com/odoo/odoo/pull/35328

closes odoo/odoo#35328

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-08-20 08:06:32 +00:00
wan 646a6d5a73 [IMP] account: improve the onboarding
Task 2031686

* Change some labels on the dashboard
* Move the action "Take money In/Out" to a button because it was also dsplayed in bank journals and we only want it for cash journals
* Add reconciliation param on the first account config list, as well as a button to go to the form (it is an editable list)
* Add an action to duplicate accounts in batch
* Smartly detect when a cash statement can be extended instead of creating a new one, making it more obvious to the user that he may need to validate his previous statement(s)

closes odoo/odoo#35137

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-08-19 10:17:47 +00:00
jem-odoo dc066a54f1 [FIX] mail: context to read follower
As the 'allow_company_ids' are now depending on the context and impact
the access to some data, we need to provide them to some controller
(route). Json route auto-pop the context when given (0322f77279)
into the environment. In the 'read_follower' route, the `check_access_rules`
raises when you want to access a document of another company (even if
this one is in your allowed companies), simply because their is no
'allowed_company_ids' key in the context. This context key is automatically
added when calling the `rpc` method in JS (as explain in session.js
of a5b6f31cf2).
To fix the wrong access error on followers reading, we simly have to give
an empty context when calling `_rpc` in the follower widget.

Task-1999686

closes odoo/odoo#35705

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-08-20 06:51:55 +00:00
jem-odoo 070174658d [IMP] project: default company of a task
In Project app, we now ensure the company of a task. Indeed, since that
model can be billed, and is important in some business, we need to ensure
its link to a company. A task can live outside a project, so the company
of a task can not be related. Task company can be set by user, but must
be the same as the project (is set), as the task can be billed depending
on project properties.

Task-1999686
2019-08-20 06:51:55 +00:00
jem-odoo 0c5d6498d5 [FIX] sale_timesheet: created task company depends on its project
When confirming a SO creates a task, the task is in a project. The
company from the task should be the one from the project, as we will
(in the next commit) restrict the company of a task: it will only
allow a project to have task in the same company as its.

Task-1999686
2019-08-20 06:51:55 +00:00
Nicolas Martinelli ddeb7b7cb0 [FIX] account: UK country code
The country code for United Kingdom is GB.

closes odoo/odoo#35828

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-20 07:34:37 +00:00
Gert Pellin 118190f3b3 [IMP] point_of_sale, pos_restaurant: multi-user sessions
PURPOSE
=========

When working in restaurants, there are often more than one waiter working on the same floor.
But Odoo doesn't support that.
There can only be one person working on one session for the same tables.
The purpose of this task to allow several people to work on the same session (while synchronizing sessions).

SPECIFICATIONS
===============

- MultiUser is active by default.
- Allow multiple waiters to login on one PoS Config.
- All waiters login to the same session, the waiter that does the paiment is the responsible for the order (same as now).
- Synchonize the information across the multiple instances running on same floors.

Syncronisation will take place at switch of table.
(close tables automaticly if no activity, to force sync)

- Syncro cannot be done if no internet : how do we manage it ? We should inform the user the internet connection has been lost and that synchro cannot be done. What impacts? To check

Useful links
https://github.com/it-projects-llc/pos-addons
https://apps.odoo.com/apps/modules/11.0/pos_bus_restaurant/

Related PR:
odoo#32789

TASK-ID: 1891130

closes odoo/odoo#33973

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-19 14:15:25 +00:00
Pierre Masereel 761f695e0d [FIX] pos_restaurant: fix typo
Forgot to remove unused function with pudb in a248171d96

closes odoo/odoo#35822

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-19 17:53:02 +00:00
Martin Trigaux 30ab0d3a89 [IMP] base: better default for translation overwrite
Following 43d355c208, same logic
Hide it but make it checked by default

closes odoo/odoo#35819

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-19 14:55:57 +00:00
Robot Odoo 9b6a5398df [REF] mrp_subcontracting
This PR modify the subcontracting process:
- Support extra quantity
- No more interaction with the subcontract order. Everything is directly accessible on the operation
- Dropshipping with subcontracting
- Bypass reservation process
- The partner type subcontractor is removed and every partner could be set on the BoM
- Update the initial demand will trigger the rules.
- Demo data
- Subcontractor is required on the BoM (no more BoM for all partners of type subcontractor)

Visually:
- Remove the stat button for linked operation.
- Register Components is only available when a subcontract component is tracked
- Button on operations in order to correct tracked components
- Show Operation button will ask to record components until the total quantity is provided(correction on finish lines are allowed after)

More details available in each commit
Task 1962187

closes odoo/odoo#35738

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-08-19 18:48:35 +02:00
Arnold Moyaux 4055293873 [IMP] mrp_subcontracting: bypass reservation
A subcontracting receipt should be always assigned even
if the components are not deliver. It depends on the partner
and not our company.
2019-08-19 15:03:59 +00:00
Arnold Moyaux c7b947364d [IMP] stock: Hook for reservation
Before a modification on a quant, stock.move and stock.move.line
check if they satisfy the condition to impact the quant.
However in a new module this condition is hardly editable.
The purpose of this commit is to easily add condition to bypass
reservation.
2019-08-19 15:03:59 +00:00
Arnold Moyaux 673450df40 [FIX] mrp_subcontracting: return to subcontract location
Before this commit a returns would select the classic
partner location. However in the case of a subcontractor return
it should be returned to the subcontract location
2019-08-19 15:03:59 +00:00
Arnold Moyaux 5d809fd6b4 [MOV] purchase_mrp_subcontracting -> mrp_subcontracting_account 2019-08-19 15:03:59 +00:00
Arnold Moyaux a684372fdd [IMP] mrp_subcontracting: subcontractors required
Force to set subcontractors on subcontracting BoM since
it's always used in order to determine if a subcontracting
should be apply on a receipt or not. Also there is not magical
behavior has 'if there is no subcontractor on the BoM then it
means all partners...'
2019-08-19 15:03:59 +00:00
Arnold Moyaux 39c5d0f35e [IMP] mrp_subcontracting: cancel subcontract order
A subcontracting receipt cancellation should cancel the
subcontracting order and the associated document.
2019-08-19 15:03:59 +00:00
Arnold Moyaux a3aeabd44d [FIX] mrp: do not base default on active_id
Since active_id do not works allows to use a context
key that will not be modified magically.
2019-08-19 15:03:59 +00:00
Arnold Moyaux d151373941 [REF] mrp_subcontracting: views v2
- nothing tracked
The "register components" button shouldn't appear, the receipt looks normal.
- finished products tracked
The "register components" button shouldn't appear, the receipt looks normal.
- finished products not tracked and components tracked
The "register components" button appear and the burger redirects to "Produce" wizard. The user should record all the productions before being able to access SML through the burger wizard. He cannot force any SML for subcontracted products with tracked components before having recorded all the productions.
- finished products and components tracked
The "register components" button appear and the burger redirects to "Produce" wizard. The user should record all the productions before being able to access SML through the burger wizard. He cannot force any SML for subcontracted products with tracked components before having recorded all the productions.
2019-08-19 15:03:59 +00:00
Arnold Moyaux 1861200315 [IMP] mrp: inline view to ir.ui.view
The purpose is to use it independently from the MO
2019-08-19 15:03:59 +00:00
Arnold Moyaux 5b526e8756 [IMP] mrp_subcontracting: modify initial demand
Modify the initial demand for a subcontract receipt should
update the delivery to the subcontractor.
2019-08-19 15:03:59 +00:00
Arnold Moyaux a6fb45d458 [IMP] stock: allow to skip next activity
Due to subcontracting. Some documents are hidden from the users since
they are there to ease technicaly. However they are linked to useful
documents and we want to avoid to log an activity on them.
2019-08-19 15:03:59 +00:00
Arnold Moyaux cbea919a9a [FIX] mrp_subcontracting: access error on purchase
Usecase to reproduce:
- Validate a purchase_order with a user without group inventory user or manufacturing user.

AccessError on operation read for BoM. A purchase user should be able
to validate an order independently of the documents that will be
generate.
2019-08-19 15:03:59 +00:00
Arnold Moyaux 4c4a7879e9 [ADD] mrp_subcontracting_dropshipping
Allow to do a dropshipping with a subcontractor.
If the product uses the routes drophipping and have
a subcontracting BoM. Then a PO for the subcontractors
will genrate a need in the subcontracting location for
the required components.

A module is needed because the picking_type_id for dropshipping
do not have a warehouse_id. The warehouse_id is needed in order to
know from which warehouse the subcontracting components should be
deliver.
2019-08-19 15:03:59 +00:00
Arnold Moyaux a29d3e5270 [IMP] mrp_subcontracting: common test file
The purpose is to use the global setup in external
module.
2019-08-19 15:03:59 +00:00
Arnold Moyaux d84952159b [ADD] mrp_subcontracting: MTO, not ressuply flow
Test the flow when a product is set as resupply on subcontract
and not MTO, it should be trigger by a reordering rule and not
by a subcontracting receipt.
2019-08-19 15:03:59 +00:00
Arnold Moyaux 7e52a1c28d [IMP] mrp_subcontracting: add demo BoM subcontracting
Add a subcontract BoM for [FURN_8888] Office Lamp with
subcontractors Azure Interior.
2019-08-19 15:03:59 +00:00
Arnold Moyaux 4d5ec8ff12 [IMP] stock, mrp: remove MTO route magical behavior
When a move is created from a location A to a location B and not
via a rule but it wants to apply the rule logic in order to know
if a move is MTS or MTO then _adjust_procure_method is called.

It will check if a rule between A and B for the selected product/
category/warehouse and if it exists it will apply the rule procure
method to the move. If not it will check if the route MTO is ticked,
and will set the move as MTO even if no rule exist. It could be
miss understanding by the user that have moves MTO without matching
rule. It would be easier to have a single proccess with rule.
2019-08-19 15:03:59 +00:00
Arnold Moyaux c3dc552185 [ADD] mrp_subcontracting: lot tracked flow test
Add a test for the following usecase:
- Subcontracted product and components tracked by lot.
- Create a receipt
- Use the register components button in order to prefill quantity
- Correct the final lot on details operation form
2019-08-19 15:03:59 +00:00
Arnold Moyaux 8c2b0a937f [IMP] mrp_subcontracting: partner on subcontract delivery
If the components have the route resupply subcontractor on order then the
delivery order triggered by the receipt do not have the origin nor the
subcontractor partner. This commit update the procurement group in
order to add those information and propagate it.
2019-08-19 15:03:59 +00:00
Arnold Moyaux 875d99812f [FIX] mrp_subcontracting: allow to create lot.
due to commit 108ee65af2a88d61526dc047043138bddc3f9b63#diff-99ad190cf09687f6efdebc1f7636062c
picking type for subcontracting order use field use_create_components_lots
instead of classic picking type.
2019-08-19 15:03:59 +00:00
Arnold Moyaux 33cf89a6c6 [REF] mrp_subcontracting: remove partner type
Replace the type subcontractor on the partner.
Instead replace it by a property for a subcontracting location.
The purpose is to have a simplier configuration. The user would
just need to add the partner on the BoM in order to start a
subcontracting process.
2019-08-19 15:03:59 +00:00
Arnold Moyaux 319ae31860 [FIX] stock: same origin documents
Create two moves with a product MTO and the same SO.
Confirm them. It will generate a new picking without origin.
However the purpose of removing origin on picking is to avoid
an endless enumaration of all documents but if they only have
one origin it should be display.

In this case, the origin was ignored because moves.mapped('origins')
result in a list of ['doc_origin','doc_origin'] and have a length
of 2 because .mapped do not return a distinct set on fields different
than Many2one, one2Many and M2M.
2019-08-19 15:03:59 +00:00
Arnold Moyaux 37200abfc5 [REF] mrp_subcontracting: lot produced/consumed management
Currently, the subcontract picking present multiple difficulties:
- The user has to introduce multiple time the lot produced.
In register components button and then create a new move line with
the show details operation button.
- Same problem with the correction system. The user has to modify the
lot in details operation and then go on the subcontract production and
unlock and edit it.

In order to facilitate those behavior. A move line will be automaticaly
created during the register components process. Also the subcontract
moves for components will be available in the detail operations tab.
2019-08-19 15:03:59 +00:00
Janusz Harkot 876c7522fc [CLA] signature for trilab
closes odoo/odoo#35787

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-19 14:24:29 +00:00
Arnold Moyaux 6c09ffb634 [FIX] mrp_subcontracting: remove hook
The hook only generate a useless rule. It has been already
generated in stock_warehouse.py. Also remove the hook method
and add it in data file.
2019-08-19 14:14:13 +00:00
Arnold Moyaux abc8253448 [FIX] mrp_subcontracting: extra move correctly handle.
Usecase to reproduce:
- Create a receipt of 1 units of a subcontracted product
- Receive 2
- Validate the receipt

-> An extra move for subcontractor of 1 has been validated but a
new move of 2 still in waiting availability and can not be
validated.

It happens due to action_done that will validate existing subcontract
order (with the initial quantity). Then the move is validated and an
extra move is created and merged in the first one. This new merged
move of 2 is then confirmed and validated. That will recreate a
subcontract order of 2 that will not be validated since it was validated
in the picking action_done at the start.

This commit will modify:
- action_done on move in order to validate the subcontract order after
the move validation and the new subcontract order creation too.
- action_confirm in order to create the subcontract order with the
additional quantity and then merge it to the existing moves.
2019-08-19 14:14:13 +00:00
Arnold Moyaux 44507c039e [FIX] mrp: change production quantity is wrong on finished moves
Usecase to reproduce:
- BoM -> 1 component for 1 final product
- Create a MO with a quanity of 5
- Update the quantity to 6

-> The move finished has an initial demand of 4
2019-08-19 14:14:13 +00:00
Pragya Ladda 438724b71f [IMP] event: add kanban view for attendees
Stat button "Attendees" of an event now redirects to Kanban view
of attendees (previously redirected to List view).

Task-ID 1935268

closes odoo/odoo#31621

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2019-08-19 13:57:30 +00:00
Robot Odoo aefc608a0f [IMP] mail: mobile: adapt discuss for mobile
Task ID : 1895453

closes odoo/odoo#35583

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-08-19 17:14:30 +02:00
Romain Estievenart 3ad7706560 [IMP] mail: adapt responsive rules to allow swipe
Removing these margins makes swipe on 'o_mail_preview'
nicer in enterprise without having blank spaces.

Note that these rules should be in enterprise.

Task ID : 1895453
2019-08-19 13:01:30 +00:00
Romain Estievenart f7fa3b7677 [REF] mail: MessagingMenu: extract "mark as read" code to dedicated method
This allow us to reuse this logic in enterprise when you swipe.

Note that we could have directly called the handler but the name
wasn't appropriate. So we preferred to extract some code in a
well named function.

Task ID : 1895453
2019-08-19 13:01:30 +00:00
Romain Estievenart dfa64cb7fe [MOV] mail: move dedicated mobile file 'discuss_mobile.js' to mail_enterprise
These files are moved to be able to add some new responsive features
implemented in enterprise.

Task ID : 1895453
2019-08-19 13:01:30 +00:00
Yannick Tivisse e631dbc182 [IMP] hr: Improve general employee form UX (back2basics)
TaskID: 2054559

closes odoo/odoo#35802

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-19 11:10:03 +00:00
Wolfgang Taferner 02f2691bff [REF] l10n_at: complete refactoring
As the available Austrian Localization was very basic and migrated for
years without any contribution or consolidation, a complete refactoring
was contributed by WT-IO-IT GmbH to move forward.

closes odoo/odoo#35642

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-08-19 09:54:06 +00:00
Meghna Jaswani 9b49f00078 [IMP] l10n_multilang: Added translate True on account.tax.report.line
Both the name and the tag_name need to be set as translatable.
As the tag_name is seen by the user for the configuration.

Unlike the financial reports that are linked to multiple countries,
the tax report is linked to just one country. This way it makes sense
to only make it translatable in multilang.

Task: 2042430

closes odoo/odoo#35436

Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-08-05 14:38:52 +00:00