Commit Graph
133019 Commits
Author SHA1 Message Date
Yannick Tivisse 2bbae8e70e [FIX] hr_holidays: Fix number_of_hours_display computation
Impacted versions: 13.0

Steps to reproduce: Add employee, allocate paid leave, set leave in hours.
Standard workweek is set to 40 hours. 5 days 8h per day
Global Time off: Dec.25 00:00:00 - Dec.26 23:59:59

Employee requests one week of leave, during christmas (dec.25 and dec. 26 in the week).
Manager approves.

Current behavior:
Before approval the total hours in the request is 24. The manager approves
and the total hours change to 40. Total remaining hours is also -40.

Expected behavior:
After approval the requested hours should not change and remain 24. The
total remaining hours should also be -24.

This is a similar issue as issue #41848 which has been fixed in #42710

TaskID: 2169161

Closes #42877

closes odoo/odoo#42924

closes odoo/odoo#42983

Original-signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
X-original-commit: 11a5e3d09dd57d51813fc8151c30a619d4f368b5
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-08 17:09:07 +00:00
Yannick Tivisse 416a1cc089 [IMP] hr_holidays: Correctly compute number_of_hours_display
Purpose
=======

Impacted versions: 13.0

Steps to reproduce:
- Add employee
- allocate paid leave
- set leave in hours
- Employee working hours is
  Mo: 8:30-12:30
  Tu-Fr: 8:30-12:30 and 13:00-17:30 (total of 38h per week).
- Employee requests on week of leave
- Total hours in request is 38. Manager approves.

Current behavior:
Before approval the total hours in the request is 38. The manager
approves and the total hours change to 40. Total remaining hours is
also -40.

Expected behavior:
After approval the requested hours should not change and remain 38.
The total remaining hours should also be -38.

Taskid: 2166964
Closes: #41848
X-original-commit: b89565b93d8e6905d4cc3fe9d3de8ddecb43acd4
2020-01-08 17:09:07 +00:00
Julien Mougenot 3c5194a00b [ADD] web: Custom File Input
New component: the custom file input. Its purpose is to define a input of type file
with a custom trigger (button, link, etc.).

Its construction is the following:
- attributes: behaviour of the actual input (route to call, multifile, allowed
    extensions etc.)
- inner template: the trigger that will fire the upload prompt when clicked
Once a file has been uploaded, the component will emit a 'uploaded' custom event
containing the files.

closes odoo/odoo#38423

Related: odoo/enterprise#6031
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2020-01-06 14:37:16 +00:00
Julien Mougenot 34bbdd88c0 [ADD] web: Owl Dialog
New Owl component: Dialog. It does not rely on Bootstrap but behaves the same
and does not conflict with legacy dialogs.
To call this component, you need to define it in the XML parent template instead
of calling it in the JS file, and put a flag in the parent state to toggle the dialog.
Old dialog file has also been slightly updated to ensure compatibility between both
versions.

This commit also updates a list view test which did not wait for click events to
properly trigger and would cause the new dialog system to crash.
2020-01-06 14:37:16 +00:00
Julien Mougenot ab37648cb1 [ADD] web: useFocusOnUpdate hook
Added a new custom hooks: useFocusOnUpdate.
This hook returns a function taking a DOM selector as an argument.
That function will focus the first matching element on the next repaint of
the component.
2020-01-06 14:37:16 +00:00
Mathieu Duckerts-Antoine f2046910bd [REF] web,mail: remove dead code
Removal of dead code (announcement xml and scss files).
2020-01-06 14:37:16 +00:00
Julien Mougenot 3cf49e1913 [IMP] Owl: update to 1.0.0-beta5
Update of the Owl library.
Also added "_lt" to the default test environment properties.
2020-01-06 14:37:16 +00:00
Lois Rilo 35163f7785 [CLA] ForgeFlow (former Eficent) signs Odoo CCLA
closes odoo/odoo#42984

X-original-commit: f975c8ab867030cb7ff91a791f9ffe4b2bab0dde
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-01-08 17:09:26 +00:00
Katherine Zaoral 5171a8c45d [FIX] l10n_ar, l10n_latam_invoice_document: make reference to old open and paid states on invoice
Now use direclty the posted state from account move.

* This was changed in a constraint in l10n_latam_invoice_document module, also extend the constraint docstring
* This old states where also in a view domain in l10n_ar module for account.move view. We remove the field for the view (AFIP Responsibility) instead of fix the state name.

closes odoo/odoo#42982

X-original-commit: 33a5cfe068323f7fc4c92f42fadb8e236954d93a
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-01-08 17:05:57 +00:00
Katherine Zaoral d8e33048ba [ADD] l10n_ar: Fix identification type of Anonymous Final Consumer partner
The purpose of this partner is that we do not need to report to AFIP the identification number.

Since this partner identification was configured as DNI it was throwing an error when validate an invoice for that partner in AFIP, AFIP was requesting us to sent the DNI number.

Now we activate the Sigd "Sin identificar/venta global diaria" identification type (code 99), proper configure the  it to Anonymous Final Consumer partner, with this change AFIP validate the invoice directly and does not request us the identification number.

Now we set this partner sequence to the biggest one so far to show this identification type as the last in the list of identifications types

closes odoo/odoo#42981

X-original-commit: 842306b06984f4357f9e3cfdbb58bad828a1a627
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-01-08 17:01:55 +00:00
Rémy Voet (ryv) 4b3798d917 [REM] stock: remove dead code of stock move
- Remove the unused field call string_availability_info
on the stock.move model. It was used in version 11.0
in a form view, this form views has been merge and
this fields is now unused.
- Remove onchange_quantity function, because the product_qty
can't be change (_set_product_qty doesn't allow that) and
the product_id is required.

closes odoo/odoo#42972

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-01-08 15:43:14 +00:00
malex-emesa b02c46c5ae [FIX] crm: check if name is present in measures
Fix an error which occurs during an attempt to access the string
attribute of a non existing measure
If a pivot view is defined with a "string" attribute of a field of
type "row", e.g.

   <field name="stage_id" string="Stage" type="row"/>

an error was raised "TypeError: measures[name] is undefined"

closes odoo/odoo#42971

X-original-commit: de1dbc9bfba3ec205c75590d3e38b20d30b39c39
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-01-08 15:47:09 +00:00
Jason Van Malder 1761a5c501 [FIX] website_blog: fix last update change on visit
Issue

    - Install Blog
    - Create a post
    - Remember the last update date
    - Visit the post
    - Check the last update date

    After visiting the post, the last update date changed.

Cause

    In the web_blog main.py controller, we increase the visit
    count with a write, so the write_date is updated.

Solution

    Keep the old write_date by forcing it.

OPW-2166289

closes odoo/odoo#42954

X-original-commit: 16843c63b97cda746972526f8933bf25b435d585
Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
2020-01-08 14:12:06 +00:00
wan c1e3439462 [REV] web: remove absolute position on autoresize
Reversal of ef46378cd3
The bug we tried to fix with the reverted commit was fixed by 3023cd24af
but it was causing other issues, like the text field translate button
badly positionned

closes odoo/odoo#42953

X-original-commit: d98dde0704f04e1e929bc689fe00814142a9cd40
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-01-08 14:11:45 +00:00
Jason Van Malder ddfa8768cc [FIX] web: fix question error message translation
Issue

    - Take a v13 runbot
    - Open survey's app
    - Open one of the surveys
    - Click on edit
    - Click on a question
    - Open 'option tab'
    - Make sur the field 'mandatory answer' is true
    - Try to translate field 'error message'

    -> Error

Cause

    this occur because because we try to update the model survey.question
    from the list coming from survey.survey which mean that the
    record.viewType is list and not form.

Solution

    As we are looking for the field name we can simply use
    ev.data.fieldName.

    Another solution should be to use this.viewType instead of the record
    one.

OPW-2157631

closes odoo/odoo#42952

X-original-commit: ad115d2710aec2b4ff7d4077714a1816cdfb433e
Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
2020-01-08 14:10:19 +00:00
Lucas Lefèvre 04bd54d0bc [FIX] base: Allow to get default with auth=none
Since dae065d, model defaults are retrieved based on the env company instead of
the user's company.

However, for a request with auth='none', the company might not be set on the
environnement (if `allowed_company_ids` is not in the context).
This makes the sql query crash, trying to compare an integer to `false`.

closes odoo/odoo#42951

X-original-commit: fa47b1b23a7fa09166c16aacf025cdcefcfaa9fd
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
2020-01-08 14:09:58 +00:00
Nicolas Seinlet d3171f2474 [FIX] sale: search on invoice_ids
some fields may depend on invoice_ids, which lead to a perf issue when
field is not searchable.

closes odoo/odoo#42950

X-original-commit: 53f363269c21eb6b2615d660f1c558c5a592e04b
Signed-off-by: Christophe Simonis <chs@odoo.com>
2020-01-08 14:09:39 +00:00
Yannick Tivisse 9e3dd15125 [FIX] hr_skills: Display correctly certification/course lines
Purpose
=======

Since https://github.com/odoo/odoo/commit/ee8106bd7aff56aa1897b18e1a967466c6937045
the resume lines generated from the eLearning/Certfication courses are
not rendered properly.

closes odoo/odoo#42940

Taskid: 2149477
X-original-commit: 85a4e3ce14e32c7005001493f562a84dabb82737
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-08 13:26:03 +00:00
Samuel Degueldre d513c662e0 [IMP] website, *: add full height option and scroll down button
*: website_blog, website_event

This commit adds a "Height" option to sections, allowing them to have a
minimum height of the user's choosing (either full screen height or half
screen height, similar to blog covers). Enabling the full screen option
also allows the user to add a "scroll down button" that will scroll down
to the next section, also similar to blog covers.

As such, the classes doing the corresponding things in website_blog and
website_event have been renamed to reuse the same code.

task-2155710

closes odoo/odoo#41623

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-01-08 14:13:36 +00:00
Alexandre Kühn e4850c1bb5 [FIX] mail: faster opening of messaging menu
Before this commit, opening the messaging menu might be slow.

This was caused by the parsing of bodies of messages with lots of
HTML nodes. Indeed, the body of a message is linkified and inlined,
and both processes were quite slow due to their implementation: each
node in the HTML were recursively parsed and re-assigning
`innerHTML`. As a result, each node was triggering an HTML parse,
which is very slow on complex nodes.

This commit fixes this performance issue by speeding up inlining and
linkifying of html strings. In the case of linkify, it now triggers
an HTML parse only when necessary, while inlining now relies on its
textContent value.

These changes should drastically improve the speed of opening and
rendering messaging menu, almost ten times faster.

Task-Id 2076299

closes odoo/odoo#42949

X-original-commit: 8db0afb50ce0853a6a8ab7ee11dd5ed876abab64
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-01-08 14:08:14 +00:00
Kevin Baptiste 9b9710f61d [IMP] hr_attendance: bring back "Create" button for managers
closes odoo/odoo#42928

Taskid: 2153158
X-original-commit: 0e634ece8436a957358ead06ef129a0580240026
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-08 11:52:59 +00:00
Vishnu Thuletiya 32d6c69b7d [FIX] project: fix sub tasks issue when callback through the breadcrum
Purpose of the task is that when creating a multi level sub-task
and going back on click of sub-task breadcrumb, sub task is not
going to visible. We need to refresh or go to the parent task
than after its visible.

so display all the sub task when click is press on sub-task
breadcrumb.
replaced action domain with 'child_of' instead of 'in' because the
child_of will return the same result as method returns.

closes odoo/odoo#42916

Task: 2157055
Closes: #42163
X-original-commit: befdce11075753d7530c8b15d1ae2b536c3caace
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-08 10:44:00 +00:00
Laurent Smet a6b137a4c0 [FIX] account: Fix next sequence number on invoices
- Create a journal.
- Create a vendor bill on this journal.
=> Odoo allows you to set a starting sequence number for your invoice.

This number must always use the sequence used when posting the invoice.
However, the invoice date was taken instead of the accounting date.

Before this commit, when setting an invoice date at Y and an accounting date at Y - 1,
the edited sequence was the one in Y - 1 but at the one in Y was used at the validation.

Manual forward-port of 42579

closes odoo/odoo#42914

X-original-commit: 525b5b1a8676e4d1ed1082505c33afb29fed6a42
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-01-08 10:39:12 +00:00
Mohammed Shekha a402dba783 [IMP] website_slides: adapt pdfjs 2.2.228
Use window.pdfjsLib instead of window.PDFJS.
PDF returned through getDocument() has _pdfInfo variable instead of
pdfInfo.

task-2124443

closes odoo/odoo#40917

Related: odoo/enterprise#6900
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2020-01-07 05:21:22 +00:00
Mohammed Shekha 5c7892fe6b [IMP] web: update pdfjs to 2.2.228
after this commit:
Worker disable is no longer supported by pdfjs since version 2.0, so
remove disabling worker code.
Used pre-built version of pdfjs as source version dependency with other
lib like SystemJS and we can not add dependency of these libs, so used
pre-built version which don't require any other dependent lib.
pdf.worker.js is always loaded and as we are using pre-built version we
don't need odoo's loader, previously we need it because worker loader of
pdfjs was loading files separately so to avoid it as we were loading
files in asset bundle we had odoo's loader file but we don't need it
anymore.

task-2124443
2020-01-07 05:21:22 +00:00
Nidhi Patel 6c39b5c90c [FIX] mrp: traceback on multiple MO deletion
_log_downside_manufactured_quantity is an api.one method since it would
log the production info on the generated acitivty.
Since commit b499c3308c, an unlink will trigger an _action_cancel on
unlinked MO.
So unlink multiple MO will call _log_downside_manufactured_quantity
with multiple records and traceback.

closes odoo/odoo#42892

Task-id: 2168386
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-01-08 09:25:37 +00:00
jbm-odoo ea4783be01 [FIX] sale_timesheet: Uom for stat button of sale
When UOM of timsheet is in days, the amount is not correct in the
stat button of sale.

closes odoo/odoo#42764

Taskid: 2160680
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-01-06 13:36:40 +00:00
Vishnu Thuletiya 80f7c3fbd6 [FIX] sale_timesheet: fix default value in service invoicing policy
Purpose of the task is to fix the default value of service invoicing
policy of existing products when sale_timesheet is installed.

when first sales app is installed and product is created with type service
then later on sale_timesheet module is installed then on that product
default value in service invoicing policy is none while the product is worked
as 'Ordered quantities' so in compute set service invoicing policy to
'Ordered quantities' for those products.

closes odoo/odoo#41515

Task: 2146778
Closes: #41515
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-10 11:11:56 +00:00
Odoo's Mergebot 5d1837d250 [MERGE] event (_*): replace state by stages and improve event management flow
PURPOSE

Improve event management by replacing static states by dynamic global
stages. It gives more flexibility and allows event users to customize their
flow according to their business requirements.

SPECIFICATIONS

From stage to state
===============

event: replace state by kanban stage

(website_)event: adapt to state removal by correctly computing availability
based on available seats.

event_sale: adapt to state removal by correctly computing availability
based on tickets sale_available field (based on number and dates)

event: add a cron that clean the event pipeline. The cron will move every
ended events in the next "ended stage". We inherit from `ir.autovacuum`
so the method `power_on` is called one time per day.

Color picker widget
===============

Move the widget ``color_picker`` from "planning" to web to use it in event
application.

Improve views
===========

Kanban view
- add a field ``sales_total_price`` which contains the total sum of all sale
  order lines (care about the currency)
- this field is used in ``event_sale``
- display the number of expected and confirmed
- when clicking on these buttons, redirect to the tree view with the correct filter
- display this new field in the kanban view
- display the location instead of the country in the kanban view

Form view
- Change the order of the buttons in the header of the event form view
- Preview Badge > Contact Attendee > Contact Speaker
- Add a note field on the model `event.event`

Search
- Remove the default filter "Upcoming/Running"

Track improvement
===============
1. the color of a track is now based on the color of the stage
2. the default date of a track is the ``date_begin`` of its event

LINKS

Task #2088538
PR odoo/odoo#39486
Enterprise PR odoo/enterprise#6460

Related: odoo/enterprise#6460
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-01-08 10:49:01 +01:00
Debauche Stéphane a321963d19 [IMP] event: add a cron that clean the event pipeline
The cron will move every ended events in the next "ended stage"
We inherit from `ir.autovacuum`, so the method `power_on` is called one time per day.

Task #2088538
2020-01-08 09:11:51 +00:00
Debauche Stéphane bd61b6cd38 [IMP] website_event_track: improve event.track
1. the color of a track is now based on the color of the stage
2. the default date of a track is the ``date_begin`` of its event

Task #2088538
2020-01-08 09:11:51 +00:00
Debauche Stéphane e3ff893bb7 [MOV] web: move the widget `color_picker` from "planning" to web
Task #2088538
2020-01-08 09:11:50 +00:00
Debauche Stéphane f59a68983c [IMP] event: improve some view
Kanban view
===========
- add a field ``sales_total_price`` which contains the total sum of all sale order lines (care about the currency)
- this field is used in ``event_sale``
- display the number of expected and confirmed
- when clicking on these buttons, redirect to the tree view with the correct filter
- display this new field in the kanban view
- display the location instead of the country in the kanban view

Form view
=========
Change the order of the buttons in the header of the event form view
Preview Badge > Contact Attendee > Contact Speaker
Add a note field on the model `event.event`

Search
======
Remove the default filter "Upcoming/Running"

Task #2088538
2020-01-08 09:11:50 +00:00
Debauche Stéphane 412ff994f1 [IMP] event: replace state by kanban stage
Purpose
=======
Remove the state on the event and add a stage.
So, we can have more control on the event flow, and we will have less constrains.

Website event
=============
Before
------
People can register for an event if "seats are available" and if the state is "confirmed".

After
-----
People can register for an event if `event_registrations_open` is True,
- Event: seats are available and the event is not finished
- Event sale:  One or more ticket has `sale_available` set to True

Task #2088538
2020-01-08 09:11:50 +00:00
Antoine Vandevenne (anv) d670685050 [FIX] doc: correct erroneous installation instructions
This commit corrects erroneous instructions in the documentation page for the installation of Odoo.

Additionally, the following changes are made:
- Add new instructions where the steps were not clear or complete enough.
- Replace some installation flows for an easier onboarding.
- Rework some parts of the page structure and display.
- Add a "running odoo" section for Mac OS.
- Fix display error in views.rst

task-2072822

closes odoo/odoo#42900

X-original-commit: 82471da5d63f07796c6df1639aa30cc4894d5891
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2020-01-08 08:40:04 +00:00
Yenthe666 42be67dc75 [IMP] base: add model constraint search view
The constraint view in Odoo has no good quick search options to filter/group and find
specific constraints easily.
This commits allows you to easily group and search for the most used values of
constraints. This will make the finding of constraints easier for functional people.

closes odoo/odoo#41288

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-01-07 13:05:16 +00:00
Tonow-c2c 53a7dcea4d [CLA] Add Thomas Nowicki in Camptocamp organisation
closes odoo/odoo#42882

X-original-commit: e3f120963229f587d00389ca1beef82b7b544da1
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-01-07 17:09:30 +00:00
rso-odoo c14cc595f3 [FIX]mrp: change description if there is no workorder
task-2128553

closes odoo/odoo#42853

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-01-08 05:14:08 +00:00
jerome hanke (jhk) d560aac62a [FIX] website_sale: base url for shop tour
Steps to reproduce:
- install sales, website, ecommerce
- go into debug mode and open your browser's console
- debug menu > start tour > shop

Previous behavior:
tour does not find trigger for the first step

Current behavior:
tour starts properly

opw-2126704

closes odoo/odoo#42870

X-original-commit: 7e0da0b9cd2c8fc22d3fd3125b48102992bf3479
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-07 14:46:05 +00:00
Carlos MayoandAaron Bohy 9f49709ef3 [FIX] web: many2many_checkboxes: react to domain changes
Let's assume a many2many_checkboxes widget in a form view with a
dynamic domain (depending on another field in the view). At first
rendering, the widget contains a checkbox for each value matching
the domain.

Before this rev., if the user changed the value of the field used
in the domain, the many2many_checkboxes wasn't redrawn, so it still
displayed the values matching the previous version of the domain.

Closes #38509
Closes #40173

closes odoo/odoo#42867

X-original-commit: 1ace56f9a8cb56fb39235468dd13447bcbbee40a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2020-01-07 14:37:06 +00:00
Romain Derie c86bff6a02 [IMP] website: load theme images also when module install through CLI
Themes image would not be shown correctly in the theme selection if the
`website` module was installed in CLI.
Indeed, the code supposed to load the theme images was done in the kanban view
during theme selection after installing module through apps screen.

Now, this code is encapsulated and called in post_init hook of website.
This was also needed for an improvement on `test_themes` module, see
https://github.com/odoo/design-themes/pull/195.

closes odoo/odoo#42206

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-01-07 16:11:52 +00:00
Simon Lejeune 387f199ee7 [FIX] stock_landed_costs: remaining_value and multiple lc
Steps to reproduce:
Create one product with FIFO and automatic inventory valuation.
Purchase product with 10 quantity and cost price 100 and mark shipment as done.
Add landed cost for done incoming shipment with 2 cost lines
E.g. 1. Freight Charges - 100
2. Duty and Charges - 50
So ideally after first outgoing shipment total cost should get updated in product is
(1000 + 100 + 50) / 10 which is 115

The issue is that we increment `remaining_value` on the wrong layer.

Fixes #41923

task-2167659

closes odoo/odoo#42871

X-original-commit: 8b89a5e4a85071055bc152b11cf150e62a5c5211
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-01-07 14:47:06 +00:00
Odoo's Mergebot ef82574418 [MERGE] partner_autocomplete_address_extended: remove broken module and ensure base_address_extended effectively works
PURPOSE

Remove partner_autocomplete_address_extended and ensure base_address_extended
effectively works.

SPECIFICATIONS

Commits a6e1eb9 and 8a1815b added among a lot of other things
a bridge module between ``partner_autocomplete`` and ``base_address_extended``.
It is used only to redefine the ``_split_street_with_params`` method from
``base_address_extended``. This method is used to find street name, number and
number2 from an address, given a format coming from the country.

However the override completely fucks up the original method purpose and uses
an hardcoded regex coming out of the blue. Parameters like country format is
not taken into account which is annoying when trying to parse country dependent
data.

Tests from ``base_address_extended`` crash completely when used with the
``partner_autocomplete_address_extended`` implementation.

Considering the original complete specifications from commits
"""
For Name field or M2O, gives a list of companies
Data comes from Odoo IAP Service
"""

Or specs found in the original task ID 1867818 pad
"""
If Extended Address module is installed, the street number should be correctly
splitted Or the complete address is put in street2 if impossible to parse
"""

We think that this implementation is broken by design. Indeed there is no
mention of street2 anywhere in the code, and this implementation ensure street
will never be correctly split. We therefore remove it completely.

In this merge we also

  * clean and improve tests in base_address_extended. Purpose is to make tests
    easier to understand and more data oriented. Tests about company / partner
    address fields are added to ensure coherency;
  * reorganize python code of base_address_extended according to guidelines;
  * rename compute / inverse methods of base_address_extended;
  * remove dead code from base partner model;

See sub commits for more details.

LINKS

Task ID 2158302
PR #42678

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-01-07 16:30:56 +01:00
Thibault Delavallée bfcf237fbe [REM] partner_autocomplete_address_extended: remove broken module
Commits a6e1eb9f0a and 8a1815b31e added among a lot of other things
a bridge module between ``partner_autocomplete`` and ``base_address_extended``.
It is used only to redefine the ``_split_street_with_params`` method from
``base_address_extended``. This method is used to find street name, number and
number2 from an address, given a format coming from the country.

However the override completely fucks up the original method purpose and uses
an hardcoded regex coming out of the blue. Parameters like country format is
not taken into account which is annoying when trying to parse country dependent
data.

Tests from ``base_address_extended`` crash completely when used with the
``partner_autocomplete_address_extended`` implementation.

Considering the original complete specifications from commits
"""
For Name field or M2O, gives a list of companies
Data comes from Odoo IAP Service
"""

Or specs found in the original task ID 1867818 pad
"""
If Extended Address module is installed, the street number should be correctly
splitted Or the complete address is put in street2 if impossible to parse
"""

we think that this implementation is broken by design. Indeed there is no
mention of street2 anywhere in the code, and this implementation ensure street
will never be correctly split. We therefore remove it completely.

Task ID 2158302
PR odoo/odoo#42678
2020-01-07 14:53:45 +00:00
Thibault Delavallée fecea95ed8 [IMP] base: remove dead code from partner model
``_split_street_with_params`` method is defined in base, on partner model. It
is redefined in ``base_address_extended`` without calling super. Only that
module use it. That means that the base implementation is not used anywhere
in the codebase, leading to dead code. Let us remove that method.

Task ID 2158302
PR odoo/odoo#42678
2020-01-07 14:53:45 +00:00
Thibault Delavallée 69081a244a [REF] base_address_extended: rename compute / inverse methods
Purpose is to make code follow guidelines so that we understand that
some methods are used for computed stored inverse fields.

Task ID 2158302
PR odoo/odoo#42678
2020-01-07 14:53:42 +00:00
Thibault Delavallée d160997c95 [MOV] base_address_extended: reorganize python code
Purpose is to reorganize code according to guidelines and split the main
badly named python file, to understand that 3 models are impacted: res.company,
res.country and res.partner.

Task ID 2158302
PR odoo/odoo#42678
2020-01-07 14:53:28 +00:00
Thibault Delavallée cbc2e4c103 [REF] base_address_extended: clean and improve tests
Purpose is to make tests easier to understand and more data oriented. We
now understand more clearly what is an input and what is expected.

Tests about company / partner address fields are added to ensure coherency.

Task ID 2158302
PR odoo/odoo#42678
2020-01-07 14:45:52 +00:00
Thibault Delavallée 7943b71af3 [FIX] base(_address_extended): correctly update company street information at write
Currently when writing on street field of company model, its sub-fields
(notably street_name, street_number and street_number2) are not correctly
computed again in cache.

Indeed address sub fields have no direct trigger as it depends on its
partner_id and its partner_id children (see ``res_partner.address_get()`` and
``res_company._compute_address()``).

When writing on address fields from the company record, we then invalidate
all address fields cache in order to force their computation.

This commit adds a new tool method giving the list of fields coming from the
address partner to copy upon the company.

Task ID 2158302
PR #42678
2020-01-07 14:45:48 +00:00
nje-odoo e582500c4b [FIX] website_sale: remove unused description xpath.
Invisible on group description is removed at: https://github.com/odoo/odoo/commit/cca864f5091f72eb7e766fa263ad9599188364a5#diff-92af3e72f90045de4a079$

so xpath to make it visible is useless now so removed unused xpath
from product template view.

Task-2150643

closes odoo/odoo#41308

Closes: #41308
Related: odoo/enterprise#7137
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-12-10 06:35:59 +00:00