Commit Graph
114031 Commits
Author SHA1 Message Date
Thibault Delavallée d350c438fe [MOV] base: move base_{demo/data}.xml into base/data 2017-11-27 11:13:18 +01:00
Adrien Dieudonne bb1602b3ac [IMP] models: avoid empty string as module name
When you import a record in Odoo, you can specify an id without
prefixing it by the name of the module. e.g. 'project_project_x'
The result of this is an empty string as module name.
(This value is valid for a required field...)

Plus, when you check metadata, you see 'false.project_project_x'.

Now, the default module name is '__import__' instead of an empty string.
We already have similar behavior with '__export__' triggered by
'export_data' method.
2017-11-27 08:18:49 +01:00
Moises Lopez 85a3e1e385 [REF] *: deal with duplicated xml_ids in views and security rules
Was part of PR #19820. Courtesy of Vauxoo
2017-11-24 15:37:28 +01:00
Moises Lopez 593bb5e30d [REF] *: improved translatability of error messages
Was part of the PR #19820. Courtesy of Vauxoo
2017-11-24 15:35:27 +01:00
qdp-odoo 87ad27748c [IMP] account: allow change 'reconcile' field on account.account
That operation was previously forbidden because it could be potentially costly as we may end up having to recompute the 'amount_residual' and 'amount_residual_currency' fields on a lot of account.move.line.

Basically, we now authorize it and manually handle the update of that field via a manual SQL query.

Was PR #19204. Was task 32125.
2017-11-24 15:29:49 +01:00
Géry Debongnie d6ff8c8351 [FIX] web: better support for async field widgets
Most field widgets are synchronous, but some of them have to do extra
work before being ready (for example, the pad widget, or widget which
needs to lazy load JS/CSS files).  Because of that, the new views have
been well tested with synchronous widgets, but not completely with async
widgets.

Some code depended upon the fact that the widget was ready immediately
after being created.  This was incorrect, and is fixed in this commit,
by adding a new hook that is called in (basic) views after a widget is
ready (meaning, start and willstart are done)
2017-11-24 14:59:14 +01:00
Alexandre Kühn fb6c9c2443 [IMP] web: FieldChar trim its value by default
With this commit, we change the behaviour of the web client with respect
to spaces in char fields.  Most of the time, starting and ending spaces
have no value, and worse, make the data not so reliable.

After this commit, field char will trim by default (so, if the user input a
char as ' abc ', the string 'abc' will be sent to the server instead).
Note that this only applies when the value of the field is changed.  If
someone open a form view, then switches to edit mode and save, nothing
will change.

This is the desired behavior most of the time.  However, in some rare
cases, this is actually harmful.  For example, if we trim the
'decimal_point' field, it will not be possible to enter a whitespace as
decimal separator.  In those cases, we introduce a new attribute 'trim',
which allow the developer to desactivate that feature.
2017-11-24 13:09:10 +01:00
Nicolas Martinelli 0a3a5919f9 [IMP] point_of_sale: close session
It regularly happens that people do not close their POS session for a
long time. When too many orders are linked to a session, the session
closing duration can therefore take a lot of time to execute. This leads
to timeout issues.

We add a label on the POS session Kanban view if it has been opened for
more than 1 day.
2017-11-24 08:58:39 +01:00
Aaron Bohy 463a214699 [REF] web,*: give evaluated contexts to load_views
*board,sale_timesheet

This rev. changes the API of load_views, as it now assumes that
the given context has no longer to be evaluated. This is more
convenient that way, as we can now call load_views with contexts
that are dict, and not instances of the Context class.
2017-11-23 11:00:55 +01:00
Aaron Bohy baae272ffd [REF] web: tests: make load_views RPCs go through mockRPC
This allows to inspect those RPCs and the given arguments as well.
2017-11-23 11:00:53 +01:00
Aaron Bohy b4609e3c25 [REF] web: test_utils: handle logging in mockEnvironment
instead of createView. This allows to log info like RPCs or
uncaught Odoo events even if we are not in a view.

Also remove the logLevel param from MockServer as it wasn't really
used.
2017-11-23 11:00:21 +01:00
Aaron Bohy 0670a635ac [REF] base,web: use correct Widget in settings JS tests
... instead of hacking test_utils.
2017-11-23 11:00:21 +01:00
Alexandre Kühn c36209df65 [FIX] stock: typo stock_location_shop0 model (#21165)
Fixed a typo on commit https://github.com/odoo/odoo/commit/491faac5e9f47e4d0573a1eba9579aca44b16752,
in which stock_location_shop0 was wrongfully refered
to stock.picking.type, instead of stock.location.
2017-11-23 10:37:01 +01:00
Yannick Tivisse 3be5611206 [IMP] fleet: Move model,tags and service type data to demo 2017-11-22 13:28:05 +01:00
Yannick Tivisse 491faac5e9 [FIX] stock,mrp: Create ir.model.data with _update, not create
Purpose
=======

As the 'function' tag is re-evaluated on the module update (even when noupdate="1"), the ir.model.data will be created a second time with the function 'create'.

This leads to the record deletion after the update when calling '_process_end'.

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

Use '_update' instead of 'create' and '_update_dummy'.

- _update won't create another ir.model.data if it already exists.
- _update already calls _update_dummy to avoid the record deletion.
2017-11-22 12:28:05 +01:00
Moises Lopez - https://www.vauxoo.com/ eb90eb42ce [IMP] translate: export empty translations for empty ones
Instead of use the original string by default.

Currently odoo export a PO translation file using the logic:
"If there is not a translation then use the source."

This generate a false 100% of file translated for tools based on PO
files.

This commit change this logic to:
"If there is not a translation then use empty string."

Odoo import a PO translation file supporting empty string because
if a item is empty string odoo use the original source.

Closes #17925
2017-11-21 17:56:28 +01:00
Thibault Delavallée 2c0ad82d5a [REF] sale: tests: make tests independent from mail
Purpose is to be able to move mail tests in a separate module without
breaking other tests. It seems dependency is not real, only some data
to add. It is better to have self contained tests anyway.
2017-11-21 15:00:22 +01:00
Thibault Delavallée 1b2d58daec [REF] project: tests: make tests independent from mail
Purpose is to be able to move mail tests in a separate module without
breaking other tests. It seems dependency is not real, only some data
to add. It is better to have self contained tests anyway.
2017-11-21 15:00:21 +01:00
Thibault Delavallée 5a2d789d1a [REF] crm: tests: make tests independent from mail
Purpose is to be able to move mail tests in a separate module without
breaking other tests. It seems dependency is not real, only some data
to add. It is better to have self contained tests anyway.
2017-11-21 14:59:15 +01:00
Thibault Delavallée 55edc1c2f3 [REM] mass_mailing: remove void test file
It makes mass mailing tests independent from the mail module without
having to change anything. How lucky.
2017-11-21 14:58:48 +01:00
Adrian Torres 07510cdbf0 [FIX] base_module_uninstall: ondelete cascade
Before this commit, whenever an ir_module_module that had been
installed/uninstalled at least once would be unlinked, an Exception
would be raised since the field module_id references an ir_module_module
and it is a required field.

This commit fixes this by adding an ondelete='cascade' to the field.

Fixes #20720
2017-11-21 10:55:16 +01:00
Thibault Delavallée 52f899aae7 [FIX] odoo: tests: correctly call super
Otherwise inheritance is not always possible because child classes
inheriting from the base class are not called.
2017-11-20 11:08:28 +01:00
Alexandre Kühn 23e6dd36d7 [IMP] web: hide in kanban tag's color (#20815)
New feature:

   - New Transparent tag visual (grey border & text, white bg),
   - By default, newly created kanban tags are transparent,
   - Tag's colorpicker has now a 'Hide in Kanban' checkbox,
     to select the transparent color.

Toggling off 'Hide in Kanban' sets the color of the tag as follow:

   - Previous color, if 'Hide in Kanban' was toggled on on the
     same formview session.
   - Color 1 (dark orange), otherwise.
2017-11-20 10:47:43 +01:00
Richard Mathot 7d2666d020 [IMP] hr_timesheet: desactivate project tour when people install Timesheet app
This change comes from the timesheet onboarding
2017. Since this is done for onboarding, only the
admin is impacted by this change.
2017-11-20 09:28:20 +01:00
Fabien Pinckaers a8dd444bbb [IMP] hr_expense: cleaner/shorter field label 2017-11-18 22:54:38 +08:00
Kishan Gajjar 5b356a732b [IMP] website: add facebook page snippet 2017-11-17 17:59:21 +01:00
Alexandre Kühn 21c4480821 [REF] *: renaming AppSwitcher to HomeMenu
Summary:
   AppSwitcher      => HomeMenu
   AppSwitcherMenu  => HomeStudioMenu

Details:
   application_switcher => home_menu
   application-switcher => home-menu
   AppSwitcher          => HomeMenu
   appswitcher          => home_menu
   AppSwitcherMenu      => HomeStudioMenu
   appswitcher_menu     => home_studio_menu
   app_switcher         => home_menu
   app-switcher         => home-menu
   app_switcher_menu    => home_studio_menu
2017-11-17 16:37:26 +01:00
Martin Geubelle afc0df5b0c [REF] mail: create separate files for includes
The rev. odoo/odoo@ab900bb fixes an issue in mail which needed an include
on BasicModel and FormController. As this rev. has been done in a stable
branch, the includes have been done in an existing file.

This rev. correctly separates the includes in different files.
2017-11-17 16:26:45 +01:00
Christophe Monniez 0fdf291305 [REF] db: simplify list_dbs
When trying to list db's, the db_user is searched and verified before
searching for the databases.
As it's enclosed in a db.cursor context manager, we can assume that
there is a db user at this very moment.
This commit uses a single query to find databases that belongs to this
cursor user.

Also, this commit adds a message in the logs when an exception occurs
to facilitate debugging instead of silently returning an empty list.
2017-11-17 15:23:14 +01:00
Christophe Simonis 21dd24c071 [MERGE] forward port branch 11.0 up to ca3390fd05 2017-11-17 14:22:46 +01:00
Nicolas Lempereur ca3390fd05 [FIX] web_editor: forward-port typo on click
event variable has been renamed to ev in 11.0 and the code was
duplicated.
2017-11-17 14:13:58 +01:00
Christophe Simonis 179abc3c5e [MERGE] forward port branch saas-16 up to 11ff01af9b 2017-11-17 13:40:18 +01:00
Simon Lejeune 49c3f64369 [FIX] mrp: workorder: use the reserved move lines
Rev [1] was intended to be applied when changing the lot of the produced
product on the manufacturing order, somewhere along the line the code
was also called when setting the lot_id on the work order. When used in
this context, it broke the reconciliation between the reserved move
lines and the temporary move lines because a lot_produced_id was wrongly
set.

We fix the issue by only applying the code on prod move. This is done by
checking if the move is a production one through the stock move, because
there we are able to differenciate the raw material and production move,
not on the move line where production_id is always set.

[1] 471115b06a

Fixes #20964
2017-11-17 13:32:04 +01:00
Simon Lejeune 179071bb50 [FIX] stock_account: UOM handling
Error introduced by rev 48f4ce4afa
2017-11-17 13:32:04 +01:00
Alexandre Kühn 11ff01af9b [FIX] web: delete attribute on list view
Before this fix, when adding the attribute delete=0
on a listview, it was still possible to delete records
via the menu 'Delete' in the sidebar.

After this fix, this should not be possible to delete
records when delete=0.

The attribute delete was hard-coded to true, as there was
a traceback when it was set to false. It was simply due
to a misplaced closing brackets that was hiding an
assignment, which resulted to calling a method on undefined.
2017-11-17 12:34:25 +01:00
Alexandre Kühn 056fe805a1 [FIX] web: delete attribute on list view
Before this fix, when adding the attribute delete=0
on a listview, it was still possible to delete records
via the menu 'Delete' in the sidebar.

After this fix, this should not be possible to delete
records when delete=0.

The attribute delete was hard-coded to true, as there was
a traceback when it was set to false. It was simply due
to a misplaced closing brackets that was hiding an
assignment, which resulted to calling a method on undefined.
2017-11-17 12:16:59 +01:00
Jeremy Kersten a0a5443e8f [FIX] auth_signup: properly display the error message
Was "Internal Error 500"

Introduced at c3bf161

This closes #20941
2017-11-17 12:02:05 +01:00
Yannick Tivisse 76e75be02f [FIX] l10n_be_hr_payroll_fleet: Increase max unused car limit 2017-11-17 11:25:25 +01:00
Yannick Tivisse bf7ee31105 [FIX] l10n_be_hr_payroll: Remove ucm_insurance from employer cost
This shouldn't be taken into account when evaluating the employe cost.

Furthermore, this value is stupid and should be removed in master
2017-11-17 11:25:25 +01:00
Yannick Tivisse 8c03616fb8 [FIX] l10n_be_hr_payroll: Put the car ATN after the ONSS cotisation on payslip
Purpose
=======

The ATN for a company car is not subject to the ONSS cotisations.
2017-11-17 11:25:25 +01:00
Yannick Tivisse ed28cbd7ef [IMP] l10n_be_hr_payroll: Add a name on view element to allow xpath 2017-11-17 11:25:25 +01:00
Yannick Tivisse c2acd30413 [FIX] l10n_be_hr_payroll: Set the average working days to 231/year
Purpose
=======

That's the number of work days taken into account by the social secretariat
2017-11-17 11:25:25 +01:00
Yannick Tivisse ecedb77ede [FIX] l10n_be_hr_payroll: Compute the Gross Salary with the correct ATN amounts
Purpose
=======

The ATN values on a payslip are fixed with a forfeit. See: https://finances.belgium.be/fr/entreprises/personnel_et_remuneration/avantages_toute_nature/autres_avantages

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

Count the forfeit, not the amount paid by the company.
2017-11-17 11:25:25 +01:00
fwi-odoo 9cbf0c87e2 [FIX] web: allow to reexecute functions using _.throttle in the js tests
Before this commit, it was not possible to reexecute functions using the
_.throttle function in the same test (e.g. drag and drop two elements in the
studio tests).
2017-11-17 10:52:11 +01:00
Martin Geubelle ab900bb62a [FIX] mail: keep model informed of new messages
Do not forward-port this after 11.0

After sending a message, if one switched in edit mode in the form view, the
created message disappeared.

This is because the model is not aware of messages (they are created through
their own routes, message are not handled as other one2many fields with commands)
and the widget was reset with a new datapoint instance when switching in edit mode.

In this rev. we keep the model informed of the new messages by directly writing
the message ids in the datapoint.

Note that the includes on FormController and BasicModel are one in the
form_renderer.js file to fix this issue in existing database without adding
files. Another revision will be done in master to add the correct files.

opw-781353
2017-11-17 10:47:49 +01:00
Kinjal Mehta 6f3608e945 [IMP] purchase: Display PO lines from 'Purchase' button on product form
Purpose
=======

From product stat button (purchase) on click of purchase lines open Purchase line's form view, the view is not correct and it is not intended.

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

Stat button of purchase orders in product form view, on click of line do not open form view of purchase order line only list view...not form view (restrict to open form view).
2017-11-17 10:11:18 +01:00
Nicolas Martinelli 54c2c08747 [FIX] account: initial balance
- Create manually an account move
- Add a line with a credit != 0
- Click on "Add a line" => crash

`line_ids` does not contain the credit since it was not filled in.

opw-782980
2017-11-17 10:09:05 +01:00
jem-odoo 7a951d7085 [FIX] sale: to invoice/invoiced amounts for delivered policy
This commits make the computation of amount to invoice
and amout already invoiced on sale order line works
with invoice policy based on delivered quantities.

Before this, the upselling of delivered quantities
was not working: you were seeing the upsell amount
in the amount to invoice (qty delivered > qty ordered).
Notes:
- When a product is not delivered (qty delivered = 0), its
amount to invoice is zero too
- Draft invoice are not take into account really; they are
included at sale order price (discount on draft invoice does
not impact amounts to invoice/invoiced)

Also, when a SO in state 'draft' or 'cancel', its amount
to invoice should be zero, but its invoiced amount should
take all validated invoices into account.

Finally, more correct trigger are set on the compute
method, to trigger recomputation on right moment.

This commit also compute the 2 amount fields as sudo, since
the amount should not be dependent of access right of current
user.

To check those different points, this commit provide some
more tests with ordered and delivered product, SO cancelling,
upselling or delivery, ...
2017-11-17 10:01:00 +01:00
jem-odoo 93aea80cdf [FIX] sale_timesheet: to invoice amount, take discount into account 2017-11-17 10:00:48 +01:00
Nicolas Martinelli 054477113f [FIX] mrp: missing field used in domain
opw-782997
2017-11-17 09:29:59 +01:00