Commit Graph
127316 Commits
Author SHA1 Message Date
Jeremy Kersten f727cd2645 [IMP] base, model, website[*]: add get_base_url helper
Before this commit, when we want to make an external url, we need to know
if the record is related to a specific website or not, and choose base_url
or website domain.

Now each model have a fonction get_base_url (public to be callable from email
template, ...) and website override this function to add the website domain if
the record is website specific.

closes odoo/odoo#34089

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-13 09:26:54 +00:00
Lucas Lefèvre 22437e331a [IMP] hr_contract: Sync employee and contract calendars mismatch
Purpose
=======

An employee and its current contract should have the same
calendar. Currently, if the contract's calendar is changed,
the employee's calendar is not changed.
In the same way, if a contract is created directly in `open`
state, the employee's calendar is not changed.
Finally, the calendar synchronization when the employee
contract is changed is only done in payroll, for no reason.

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

Fix the three issues described above.

If the employee's calendar is nonetheless manually changed, a warning
should be displayed if there is a mismatch between both calendars.
2019-06-13 10:02:10 +02:00
Romain Derie 55e7b702bb [REM] base, website: remove deprecated code from qweb and bundle
The _get_asset method was deprecated since df4072b0b4
Last use of this deprecated method was removed with d7da1d648c

Also, remains and to_html were deprecated since 9cd982bcc8
test_assetsbundle was still using the deprecated method to test..

Closes #33432

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2019-06-12 14:02:34 +00:00
Antoine Prieels 283313a06c [FIX] point_of_sale: New IoT Box build dependency
A new dependency (`polib`) has been added in commit:
a7621137cb

Since it is used in the part of the code that is copied to the IoTBox,
we need to add it to the list of packages that are installed during the
build of the image.

closes odoo/odoo#33990

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-06-11 07:38:49 +00:00
Sergio Teruel c470c08e30 [IMP] sale_stock: custom group on so line
Allow to create a specific procurement group for
each so line. The purpose for different group is to
have a specific behavior for each delivery depending
it's group. It also allow to pass extra values to
procurement group creation that would be common between
multiple line (instead of passing the common values to
each lines values argument).

closes odoo/odoo#33765

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-06-12 08:54:50 +00:00
Varun Raval cbd77876fc [IMP] web,mail: support line break in activity feedback
Purpose of the commit is when writing feedback on an activity it
doesn't have a line break in it so feedback was printed in a single line.

After this commit feedback will support line break.

Split the line by '\n' in feedback xml template to avoid t-raw.
Avoid `preventDefault` in kanban record when hitting <ENTER> on a textarea.

Task #1965831

closes odoo/odoo#33212

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-12 09:26:55 +00:00
Pierre Rousseau 047e0ba708 [IMP] iap: align buy credits to the left
In the settings, align the link 'buy credits' to the left.

Task-ID: 2007611

closes odoo/odoo#34027

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2019-06-11 11:52:35 +00:00
MaxLarue 00d0789bd9 [IMP] hr_expense: reduce employee visibility on report creation
When creating or editing an expense report, we have to select the corresponding
expenses. Since it is constrained that these expenses belong to the same
employee as the one from the report, it is not practical to see other
expenses in the dialog when adding them.

This commit extend the domai of the field in the expense report form so
that it doesn't show expenses from other employees.

task #1999537

closes odoo/odoo#33932

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-06-06 07:54:02 +00:00
Kaushalya Mandaliya 8922ab710d [IMP] im_livechat: display country with a known partner name
When talking via the Live Chat to a known partner,
should be able to see his country with his name to avoid checking
the partner view form to get that information.

And improving a test case, in which we're checking for the known partner's
country name along with his name in the chat window title.

task-1940407
closes #31346

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-10 04:43:32 +00:00
qsm-odoo d7da1d648c [IMP] website, *: improve customize dialog no-reload updates
* base

Before this commit, if an option was customized thanks to the customize
dialog, the page was not reloaded, only the new scss <link/> elements
were retrieved and replaced in the DOM.
There were two problems with this:
- The <script/> and <style/> tags were also retrieved for no reason (as
the whole result of t-call-assets was returned)
- This made use of a deprecated ir.qweb method that we want to remove
(see https://github.com/odoo/odoo/pull/33432)

This commit removes the use of the deprecated method by improving the
system: only the <link/>'s new URLs are returned on customization.

closes odoo/odoo#34040

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2019-06-11 16:06:07 +00:00
Jeremy Kersten b5091c7017 [ADD] website: ability to restrict groups on website menu
Courtesy of @Yenthe666

This commit closes odoo#32580

closes odoo/odoo#34039

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-11 15:41:25 +00:00
Robot Odoo b4480db386 [MERGE] hr_payroll_account: Group accounting entries on payslips
Purpose
=======

From a busines point of view

Integration with accounting. A period of pay include journal entries and
payments. We need to generate both from a batch.

The entries must be grouped
- 1 line for salaries
- 1 line for all ATN
- ...

Payroll generate a Sepa document to send to the bank

+ as this part is managed by an accountant add menu entries in the
accounting app.

From a functional point of view:

Debit and credit accounts are defined on the rules (hr.salary.rule)
The journal should be defined on the structure to be foced

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

- Usability: the module l10n_be_hr_payroll Should install the accounting
(right now it install invoicing). On the structure, add a journal m2o.

- On rule: add group accouting items on salary rule

- Improve method 'action_payslip_done' to support multiple entries by move.
Generate only one big entry with all payslip. Generate one total line total
for reconciable if group is set.
Now the payslips are no longer calculated individually,
all accounting entries are grouped together when the pay slips are
validated.
This allows you to have a single accounting entry for all validated
payroll records.

- Buttons on batch
- Add 2 buttons on the batch form
- "Create Entry": it will generate a grouped entries according config of
the rule
- "Payment": it generate an xml with all line to send to the bank
See https://www.odoo.com/documentation/user/11.0/accounting/receivables/customer_payments/payment_sepa.html
- Payroll directly generate the xml (no payments in accounting)

- Button on payslips: Everything should be done through the payslips
- create draft entry
- Create SEPA payment xml
- Make appear those buttons on the form only if batch is not set

- Belgian rules for the entries:
- In data for Belgium: https://docs.google.com/spreadsheets/d/1HlnwoExR_O833sij01p7UizSkrMqcm6oF4GvOeIz5lg/edit#gid=0
example of one of our OD: https://drive.google.com/file/d/0B_hhLmdks1wEdXZSQzJIeVBDOXNiNVctczJzUTBQZVBuNkgw/view?usp=sharing

- Create a Journal salaries (type miscelaneous) and apply all structure on
this journal

- Create new accounts to manage this.

- Sepa for payroll should be an option in the setting of payroll
(like in accounting)

- Configure the accounts on the rules when setting a CoA on a company.

Now the payslips are no longer calculated individually,
all accounting entries are grouped together when the pay slips are
validated.

This allows you to have a single accounting entry for all validated
payroll records.

Other notable point in this commit:
- When installing the Belgian Localisation or when installing the
Belgian CoA on a company, configure the accounting data (journal,
accounts on the salary rules)
- Don't create automatically a payslip batch when creating a payslip

TaskID: 1935200

closes odoo/odoo#32924

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-12 01:37:45 +02:00
Martin TrigauxandRaphael Collet 8f88570ca1 [FIX] base: proper removal of xmlid after update
Context:
After a module update, the records present in ir_model_data table but not in
self.pool.loaded_xmlids are considered as no longer needed and should be
removed.
An exception is done with noupdate=true entries.

Bug 1:
Entries with noupdate=NULL are not considered in the evaluation and are ignored
while it may be worth deleting.

Bug 2:
Some records with their external id being automatically created are not present
in self.pool.loaded_xmlids and may get removed after updating a module.

By a lucky coincidence, bug 1 make it so that records targeted by bug 2 are
ignored and not deleted (the "automagically" created ir.model.data often lack
a noupdate value).

Fix Bug 1:
Use a COALESCE to find both records with noupdate=NULL and noupdate=false

Fix Bug 2:
Depends on the source of the generated external id:

- ir.model:
The entries created through _reflect_model were not loaded in
self.loaded_xmlids
Use the proper ORM method _update_xmlids that correctly populates
self.pool.loaded_xmlids

- ir.model.category:
The categories were generated when the db was initalised, doing SQL was not
avoidable.
Create the categories in noupdate to avoid it being considered for removal.

- ir.property:
Are always created in noupdate in data files but in stock_account it was
manually created without being in noupdate

closes odoo/odoo#32881

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>


Co-authored-by: Raphael Collet <rco@odoo.com>
2019-06-11 12:04:08 +00:00
Arnold Moyaux 2843dcfaa0 [FIX] mrp: print selected quantity
When using the print unfolded button, it will print only 1 product
and not the selected quantity on the report.

Task: 1939278

closes odoo/odoo#32340

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-06-11 12:44:51 +00:00
Arnold Moyaux 36b976ccee [FIX] mrp: display all information for pdf
mrp_plm in OE uses the child_bom and prod_id from lines obtains
by _get_pdf_line in the case of a pdf report. It was already pass
by _get_bom_lines with the html report. It implies that the pdf and
html report could be different.

Task : 1939278
Closes #32340
2019-06-11 12:44:14 +00:00
Florian Gilbert 9d758e9cfe [IMP] hr_contract: Hide bank account when no partner is set on employee
As the bank account should be linked to the same partner than the
address_home_id, it makes no sense to display it if this field is not
set.
2019-06-11 09:31:56 +02:00
Florian Gilbert 2b5b22dcdc [IMP] l10n_be: Add some accounts in the Belgian CoA
Mainly for payroll purpose
2019-06-11 09:31:56 +02:00
Robot Odoo 5c0f4e8122 [MERGE] sale_rental: new renting application
New Rental App (sale_rental) : community side.

1. Product configurator:
Refactoring to ease product configurator extension (e.g. rental configurator)
Closes #33371

2. Event_sale
Fix tests of event configurator s.t. they still work when sale_rental is installed (with its extension of the product configurator).

3. Sale
XML names for XPath in rental extension
Minor UI changes

[Enterprise PR](https://github.com/odoo/enterprise/pull/3939)

Related to #30855
Task 1909410

closes odoo/odoo#32210

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-06-09 01:43:44 +02:00
Victor Feyens 9cfe599973 [FIX] event_sale_product_configurator: remove files brought back by conflict 2019-06-07 11:33:42 +00:00
Victor Feyens 1f0721acf0 [FIX] Purchase description string 2019-06-06 06:52:26 +00:00
Victor Feyens bbc963ef11 [FIX] Sales description string 2019-06-06 06:52:26 +00:00
Victor Feyens 0085bb87d1 [FIX] event_sale : fix event_configurator tests to satisfy runbot when rental_configurator is installed. 2019-06-06 06:52:26 +00:00
Victor Feyens e7a9c24315 [IMP] sale : name for xpath 2019-06-06 06:52:26 +00:00
Victor Feyens ebc64a089a [REF] product_configurator
Purposes:

* Remove bridge module event_sale_product_configurator
* Ease developement of product configurators AND product-based sale_order_line configurators
* Fix the tests for those extensions
	* Note that despite the widget being extensible, the tests from the other configurators can easily crash when other configurators are installed because of query counts or limited data available in tests environments.

Technical clarifications:

A main product_configurator widget base in odoo/addons/sale, set on the product_product and product_template on the sale_order_line inline list, providing:

* 5 hooks:
	* _onTemplateChange for product_product configurators based on product templates
	* _onProductChange for sale_order_line configurators based on product_product
	Those two hooks are expected to return a boolean promise to know whether the line has been configured or not, avoiding the opening of multiple wizards.
	* _isConfigurableProduct
	* _isConfigurableLine
	If true, a pencil button is shown next to the product/product_template, calling _onEditProductConfiguration when clicked.
	* _onEditProductConfiguration
		Called when clicking on edit pencil button.

Examples :

Product configurator : odoo/addons/sale_product_configurator module --> product_configurator (true one, the one in sale doesn't do anything until extended)
Sale Order Line configurator : odoo/addons/event_sale/ --> event_configurator, future rental configurator
2019-06-06 06:52:26 +00:00
Xavier-Do 154703d21c [IMP] core: log traceback in one group
Traceback coming from tests are currently logged
line by line. This will implies that runbot will have one
ir_logging entry per line which is not practical. More than
that, the log prefix can make the traceback less readable
because of line returns and difficult to copy paste.

This commit simply remove this feature. After discussion with odo
and chs, we will also remove the docstring from test shortDescription
since most of the time this information is not clear and can be accessed
in source code if needed.

closes odoo/odoo#33911

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-06-05 14:34:33 +00:00
RomainLibert 6d34a19ba8 [FIX] hr_holidays: fix multi company issue in onchange
If you are logged into a company that differs from the company of your
employee, you won't be able to read the informations on that employee,
and you will have a crash.
Instead of taking the employee linked to the current user, we use search
in order to first apply the ir.rules hence we ensure that we will be
able to read the needed informations.

closes odoo/odoo#33903

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-05 11:35:49 +00:00
RomainLibert 9761342c12 [FIX] hr_holidays: add method to override selection of calendar 2019-06-05 11:35:49 +00:00
Jeremy Kersten 521f7d36c1 [IMP] odoo: ignore unsupported args from controller
Before this commit, call a controller defined as:

```
@http.route('/route', type='http', auth='public')
def controller_func(self, foo):
do_it()
```

and called with url like /route?foo=1&bar=2

will crash with an exception:
`TypeError: controller_func() got an unexpected keyword argument 'bar'`

Now, we remove the extra parameters if the controller doesn't support it.
This case is not uncommon, you can easily arrive in this case with utm or
debug as extra parameter.

closes odoo/odoo#33962

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-06-08 13:53:57 +00:00
Christophe Monniez f167ae7d6e [FIX] core: change ready code warning into info
In JS tests, when the ready code takes too much time, a warning is
logged. As a consequence, the runbot updates the github status as a
failure, causing real pain to people who simply wants to merge their
features.

With this commit the warning is changed into an info and the runbot will
be happy.

closes odoo/odoo#33931

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-06-06 07:43:58 +00:00
Romain Derie 9813ee4eb8 [IMP] doc: adapt doc to new test asset and JS test file structure
Adapt doc to d7cd97a9b

closes odoo/odoo#33921

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-06-05 16:04:25 +00:00
Martin Trigaux c5bb52f33e [FIX] test_translation_import: avoid selection clash
export.selection.withdefault and export.selection both have a selection field
with Foo and Bar as possible selections.
When doing
self.env["base.update.translations"].create({'lang': 'fr_FR'}).act_update()
the base.update.translations wizard exports the translations of ALL modules,
including the ones of the test_impex module.

The generate po entry is something like:

#. modules: test_impex, test_translation_import
#: selection:export.selection,value:0
#: selection:export.selection.withdefault,value:0
#: selection:test.translation.import,import_type:0
msgid "Bar"
msgstr "Bar in french"

but may also be

#. modules: test_translation_import, test_impex
#: selection:export.selection,value:0
#: selection:export.selection.withdefault,value:0
#: selection:test.translation.import,import_type:0
msgid "Bar"
msgstr "Bar in french"

(not sure where the indeterminism comes from)

which creates 3 translation entries that are sometimes linked to the module
test_impex (ignored when exporting the translations of test_translation_import)
but are sometimes linked to the module test_translation_import instead

In the second case, this makes 3 more translations that is was supposed to
exist.

This commit hides the symptom by making sure there is no longer a clash
when exporting the translations of the module test_translation_import.
A real fix to avoid creating unnecessary translations during an execution of
the base.update.translations wizard must also be made in the future.

It is assumed the unnecessary translations problem was already present before
a7621137cb but polib introduced the indeterminism
making the test fails from time to time.

closes odoo/odoo#33958

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-06 14:10:08 +00:00
b14921d847 [FIX] website_sale: fix concurrent update
Since forward-port, `/sale/get_combination_info_website` and `_cart_update`
would lead to a concurrency error.

Indeed, the session would not have an order_id at first. Then both rpc would
be sent at the same time:
- `cart_update` would create an order and add it in the session
- `/sale/get_combination_info_website` would end up calling `_compute_cart_qty`
which would call `sale_get_order` and would set the `sale_order_id` to none,
just aftet the `_compute_cart_qty` would actually add an order in the
session, simultaneously.

closes odoo/odoo#33993

Signed-off-by: Christophe Simonis <chs@odoo.com>


Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Christophe Simonis <chs@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2019-06-08 10:14:52 +00:00
Romain Derie 8c7423298f [IMP] website_sale: move code from JS tour to python
In order to setup the tour environment, the tour would create and write on
some records.
This part of code could be moved from JS to python to avoid potential
concurrent error and to gain time.
2019-06-07 16:16:51 +00:00
Christophe Simonis 04d21a99d7 [FIX] account: avoid infinite recursion on account.move.line defaults
Now that `.new()` compute default values, calling `new()` from
`default_get` should avoid the recursion itself.
2019-06-07 12:37:49 +02:00
Christophe Simonis 83d0eaedc7 [FIX] web: temporary disable failing test 2019-06-07 12:37:49 +02:00
Christophe Simonis 8670584299 [FIX] core: in onchanges, verfiy that x2many are the same records
Comparing the length of the recordset is not enough for determining if
there is changes on m2m.

This also fix the merge of f14ae73a98 and
d0bb596f1d

Oversight of previous forward-port.
2019-06-07 12:37:49 +02:00
Sébastien Theys 3b63c7c2a6 [FIX] website_slides: fix typo introduced in cd4cd51 2019-06-07 11:17:10 +02:00
fja-odoo 5ab24668f4 [FIX] sale, website_sale: move #buy_now disable
Some code was not correctly merged during forward port.

commit introducing the new method
https://github.com/odoo/odoo/commit/51ef8514eaddaebbdfee73230cfe955735d02f67

commit introducing the issue:
https://github.com/odoo/odoo/commit/71a50a2214748fec413c5a0f042d0e7172ae6ea9
2019-06-07 11:16:20 +02:00
David Monjoie 83f0bc2280 [FIX] web: fix field signature xmlDependencies loading 2019-06-06 16:10:15 +02:00
Romain Derie d02c0eb4c9 [FIX] survey: fix forward port
d273bdfed7 got ported from 12.0 to master but this file does not exist as it
has been renamed with fdbf11643f
2019-06-06 15:08:04 +02:00
Romain Derie aebbd0317f [FIX] mail, web: directly load async debug.xml during QUnit tests
Before this commit, the test `list: edit view menu item` would sometimes crash
as now the debug manager loads its templates with an `xmlDependencies` where it
was not the case before (included in base.xml), see 73327db065.
2019-06-06 15:08:04 +02:00
Christophe Simonis 4f18c7c44b [FIX] test_mail: correct test
*/ Adapt test to new version
*/ do not use removed method `do_in_onchange`
*/ remove duplicated test
2019-06-06 13:33:16 +02:00
Christophe Simonis 71a50a2214 [MERGE] forward port branch saas-12.3 up to 409679866b 2019-06-06 11:54:35 +02:00
Robot Odoo a7621137cb [MERGE] Use polib to parse .po files
Remove ugly custom po files parser and use polib for reader and writer.
Refactor reader/writer to use a class and have an abstraction for csv or po files.

Task-id: 1986334

closes odoo/odoo#32165

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-06 09:45:37 +02:00
Martin Trigaux 55dd375c84 [FIX] tools: ensure 0 res_id are handled
if an POEntry has an occurrence with a 0 res_id
    >>> entry.occurrences.append(("selection:report.paper,format", 0))
    >>> str(entry)
    #: selection:report.paperformat,format
    ...

Use the string '0' to bypass this
2019-06-05 09:44:11 +00:00
Martin Trigaux 376f7983b0 [IMP] test_translation_import: reexport the .pot file
To be sure it is synchronized with the reality to make the maintenance easier
2019-06-05 09:44:11 +00:00
Martin Trigaux eab46cdca6 [IMP] tools: remove custom pofile writer
And create a generic class to handles it, using polib for po files
2019-06-05 09:44:11 +00:00
Martin Trigaux 632fa044c3 [IMP] tools: remove custom pofile reader
Use polib library that handles this correctly
The complexity of the parser is moved to the library
2019-06-05 09:44:11 +00:00
Martin Trigaux 3c568aec0b [FIX] base,website_sale,fleet: do not use a space in xmlid
This probably a bad idea for odoo but is definitly a bad idea for pofile

As shown in gettext reference, the spaces are used as separator in po files
https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html
For instance
    #: src/msgcmp.c:338 src/po-lex.c:699
    #, c-format
    msgid "found %d fatal error"
    msgstr "..."

The line "model_terms:ir.ui.view,arch_db:website_sale.search count"
was considered as two references:
- 'model_terms:ir.ui.view,arch_db:website_sale.search'
- 'count'

Correct external id of fleet, even if not translatable
2019-06-05 09:44:11 +00:00
Martin Trigaux d0805f2e6d [IMP] base: remove deprecated code
The types view, field or help no longer exists
2019-06-05 09:44:07 +00:00