Commit Graph
3175 Commits
Author SHA1 Message Date
Raphael Collet 782885ab2f [FIX] base: translations lost after synchronization
Modifying a source term in an XML/HTML translated field can lose translations
if the same term is translated in several languages.

closes odoo/odoo#29082
2018-11-27 15:06:53 +00:00
Arnold Moyaux c407d9afb9 [REF] mrp: compute state for production
Refactor production order state:
- Directly have an idea of linked workorders's state
- Computed in order to manage it in a single method
- Add tooltips for each state

Remove the None in availability selection field instead use a False

Also refactor the ready_to_produce field in order to only set as
assigned a production order that have the component for its first
workorder.
2018-11-27 11:56:56 +00:00
Haresh Shyara abcfa38f2c [IMP] stock: rename 'Make to Order (MTO)' into 'Replenish on Order (MTO)' 2018-11-26 12:24:13 +00:00
Darshil Trivedi 9e12dbc33d [FIX] base: Typo in summary of MRP II module.
This commit is related to task ID : 1893027

closes odoo/odoo#28400
2018-11-26 07:04:16 +00:00
Christophe Simonis 7a0243ec15 [MERGE] forward port branch 12.0 up to b3052b690f 2018-11-23 12:11:32 +01:00
Christophe Simonis 4cbcbe9ea4 [FIX] base: adapt property field optimization to native date(time) fields
See b6d32de31e
2018-11-22 20:33:22 +01:00
Christophe Simonis 70f9cb33ac [FIX] base: remove leftover print statements 2018-11-22 20:19:06 +01:00
Christophe Simonis b4e1be8ab0 [MERGE] forward port branch saas-11.3 up to b09f624f20 2018-11-22 20:06:48 +01:00
Raphael Collet 9d72263717 [FIX] base: partner.user_ids only shows active users
Returning inactive users breaks many features based on the partner's user ids
(among which the company switcher).

This reverts a small part of commit 14af2c7f2fe6c14afb96d7e9f2bb02b2a022eaae
which is related to #25939.  That part was not necessary and had some
unintended side-effects.

closes odoo/odoo#28947
2018-11-22 15:03:06 +00:00
Odoo Translation Bot c487d2c26c [I18N] Update translation terms from Transifex 2018-11-21 09:40:22 +01:00
Raphael Collet 5eb2fbdec3 [FIX] base: create parent XML ids before XML id
When a module creates a record from a model M that `_inherits` from some parent
model P, the method `_load_records` creates an XML id for the record, and an
extra XML id for the parent record.  The corresponding `ir.model.data` entries
must be created in the right order (parent record, then record), so that the
record is deleted before its parent record.

closes odoo/odoo#28805
2018-11-19 14:57:52 +00:00
Odoo Translation Bot b60f9bb739 [I18N] Update translation terms from Transifex 2018-11-18 01:28:38 +01:00
Katherine Zaoral edfcee0190 [FIX] base: fix name for country state of Buenos Aires
Change "Buenos Aires City" to "Ciudad Autónoma de Buenos Aires" accordingly to
http://www.afip.gob.ar/fe/documentos/TABLA%20PROVINCIAS%20V.0%20%2025082010.xls

closes odoo/odoo#28584
2018-11-20 18:11:20 +00:00
Raphael Collet b6d32de31e [FIX] base: optimize property fields
Implement the getter method in plain SQL.  This makes reading company-dependent
fields 33% faster (on 20000 partners, reading 'property_product_pricelist'
takes 3700ms instead of 5500ms.)

closes odoo/odoo#28769
2018-11-19 15:38:17 +00:00
Christophe Simonis 4b8bd36219 [MERGE] forward port branch saas-11.3 up to bab2a191d2 2018-11-16 15:39:02 +01:00
Odoo Translation Bot 1da3ff5a0a [I18N] Update translation terms from Transifex 2018-11-18 03:15:42 +01:00
David Beguin e69b89b8fa [IMP] tools, mail : adds email normalization method in mail tools
In order to normalize email independently from the
mail.address.mixin model.
2018-11-20 11:37:05 +00:00
Christophe Simonis 15f686eef6 [MERGE] forward port branch 11.0 up to 468dab6748 2018-11-15 20:39:10 +01:00
Géry Debongnie abf32b8b21 [REF] *: update js test suite to use helpers
This rev. introduces robust helpers to use in the JS tests suite to
interact with DOM and components, and starts using them (almost)
everywhere.

All the helpers are exposed though testUtils.js.

There are 2 kinds of helpers:

1. Assertions
-------------
 * assert.containsNone, containsN, containsOnce check that the DOM
   (or a specific part of the DOM) contains a `selector`. It
   generates a correct error message automatically.
    ex: assert.strictEqual(form.$('.o_form_editable'), 1, "msg");
        -> assert.containsOnce(form, '.o_form_editable');
 * assert.isVisible, isNotVisible check that the DOM has an element
   visible or not. They also check that the element is actually in
   the DOM (before most tests didn't verify this).
 * assert.hasClass, doesNotHaveClass, hasAttrVAlue, check specific
   properties of a DOM element, and also validate that it is
   applied on a single existing DOM element (before most tests
   didn't verify this).
    ex: assert.notOk(form.$('button').hasClass('btn-primary'));
       -> assert.doesNotHaveClass(form.$('button'), 'btn-primary');

2. Utilities
------------
The goal of the utilities is to centralize the definition of many
standard components and interactions, ensuring that when we
refactor the JS framework, we do not need to change all the tests.

Existing mock utilities (addMockEnvironment, intercept, path,
patchDate, unpatch and fieldsViewGet) are moved to
'testUtils.mock.*'.
Existing DOM utilities are moved to 'testUtils.dom.*'.
New dom utilities are created for opendDatePicker, click,
clickFirst and clickLast. Helper `click` verifies that there is
exactly 1 element visible in the DOM you click on, `clickFirst`
and `clickLast` verify that there are more than one element on the
DOM.
 ex: form.$('button').click();
     -> testUtils.dom.click(form.$('button'));

New Form utilities: (testUtils.form.*)
 clickEdit, clickSave, clickCreate, clickDiscard, all clicks on
 the control panel buttons of the form.
 `reload` reloads the form data.

New modal, graph, kanban and pivot utils (testUtils.pivot.*,
testUtils.kanban.*, etc.).

New fields utils: (testUtils.fields.*)
 * editInput, editSelect: allow to change the value of a field,
   using a selector to identify it. They validate that the input
   exists and trigger the change event automatically.
 * editAndTrigger: allow to modify a field and trigger specific
   events after the value change
 * many2one (testUtils.fields.many2one.*)
   clickOpenDropdown, clickHighlightedItem, clickItem,
   searchAndClickItem: use a field name instead of a selector and
   do all the complex mechanism to open, filter and highlight
   many2one fields.

Joint work with aab, dam, ged, mge, svs and vsc.
2018-11-19 11:24:28 +00:00
Geoffroy Larue df81f2052f [IMP] sale: onboarding and config bar
Improve various design elements in sales onboarding and config bar :

Onboarding :
- tooltip and done button

Company info:
- Move the incoterm field from company view to account settings.

Document layout:
- layout widget relabelling and reorganizing
- paper format as required
- added a Preview button

Payment methods and sample quotation :
- Style and relabelling
2018-11-16 10:13:41 +00:00
Geoffroy Larue 911a754e01 [IMP] base, sale: contact and product form views
Various ux improvements in the product and contact form views :

Contact :
- hide/reveal fields according to customer/supplier status and
reorganize
- fields moved to stat buttons
- addresses : tooltip and relabelling

Product:
- Fix re-expense policy (dis-)appearance and fields style
2018-11-16 10:03:04 +00:00
Christophe Monniez 76d29d15bf [REF] tests: add parameter to choose chrome size
When using the HttpCase browser_js method, the window size is fixed to
1366x768.

With this commit, the default window size is still '1366x768' but a test
class that inherits from HttpCase may change it to test mobile layout
by changing the browser_size class attribute.

The browser is instanciated once per test class, for that reason the
window size cannot be changed in the class methods.

To use different sizes in tests, the tests have to be splitted in
classes.

closes odoo/odoo#28760
2018-11-16 14:35:18 +00:00
Christophe Simonis 6faad524cf [MERGE] forward port branch 12.0 up to bc744a1da4 2018-11-16 19:30:20 +01:00
Lucas Perais (lpe) 50e5f73b4e [FIX] fields, test_new_api: monetary related custom
This commit allows for not copying the currency_field attribute
of a monetary field when the monetary field is related,
and when the currency_field attribute is not explicit

Before this commit, the currency_field attribute on the related monetary
was set as the one on the distant model

After this commit, the currency_field attribute takes the field on the
current model

Though the test may appear like an incoherent use case,
it is on the contrary totally legit, as web_studio allows it

OPW 1903113

closes odoo/odoo#28144
2018-11-14 15:14:36 +00:00
Géry Debongnie aa18aaa292 [FIX] web: restore formview mode when coming back (breadcrumbs)
Before this commit, when the user is in a form view (edit mode) and
click on a stat button, a new action is added to the action stack.  When
the user then comes back to the form view by clicking on the breadcrumb,
it is supposed to be in readonly mode.  Before this commit, this was not
the case.

This bug comes from the action manager refactoring, which removed the
view manager. With this commit, we add a new action lifecycle method
which is called when the action is restored.

Note that this commit implicitely changes the semantic of actions with
'target=inline'. As far as I can tell, this only applies to the settings
form view, which can easily be fixed by overriding the restore hook.

closes odoo/odoo#28663
2018-11-14 11:19:40 +00:00
Nicolas Martinelli 79d29c51df [FIX] base_import_module, cli: deploy
The use of the `deploy` command always fails because of an incorrect
CSRF token since commit 9bae56acd4. Indeed, the latter
re-introduces the session rotation, i.e. the session ID is changed at
authentication.

Practically, what happens server-side is:
- authentication
- generate CSRF token
- create the response with the token and a change of session ID

At this point, the token generated is not correct anymore since it is
based on the 'old' session ID. Therefore, when it is reused at
uploading, an error is raised.

It is actually possible to simplify the process by performing the
authentication and the file upload in a single request. There is indeed
no real use of extracting the authentication, since the request is then
only used to upload the module.

opw-1902863

closes odoo/odoo#28653
2018-11-14 09:40:17 +00:00
Luis González a914d67661 [DOC] models.py: Fix old reference in _get_external_ids method's doc
It was referencing _get_xml_ids, whereas the method name is
_get_external_ids

closes odoo/odoo#28647
2018-11-14 04:19:38 +00:00
Pratima Gupta de97a490f1 [IMP] various: improve applications and categories name
Purpose is to ease understanding of applications / categories and their
links with the access rights labelling.

This commit is related to task 1884968 and PR #29176.
2019-01-30 14:03:33 +00:00
Juhil Somaiya f50bdf5cb4 [IMP] sale,stock,...: Set weight on consumable/storable demo products
This commit is related to task id: 1915274

closes odoo/odoo#29279
2019-01-30 12:59:27 +00:00
Xavier Morel 42fbee83ad [IMP] qweb: stop requiring t-name-flagged sub-node
QWeb's rendering currently *requires* that when loading a document
instead of rendering the document itself it will render a sub-node
with a properly labeled t-name. If a view is invoked by id, ir.qweb
will look for a child with a t-name and fix up that t-name such that
the base qweb object will find and render it.

This feature mostly exists for JS compatibility (because a single
document can contain multiple cross-linkable templates, and it was
useful for cross-implementation tests though I'm not sue they're even
checked anymore), and the <template> tag kinda took care of it,
however with a more proper qweb view it becomes more of a liability /
pain in the ass.

Note: turns out there are bits of javascript which read server
templates (???) and need to be altered to correctly handle the lack of
<templates> wrapping.
2019-01-29 10:22:17 +00:00
Adrian Torres ee6dc40a60 [IMP] fields: forbid required m2o ondelete set null
A many2one field that is required means that its column cannot contain
null values, however the default ondelete policy for all m2o fields is
`set null`, which contradicts `required=True`.

This patch will, by default, apply the `restrict` policy to required m2o
fields unless the ondelete attribute is explicitly specified. However,
if the policy specified is `set null`, a ValueError will be raised
whenever the registry registers the field as this makes no sense.

The default ondelete policy remains unchanged for non-required m2o
fields (set null)

closes odoo/odoo#30122
2019-01-29 16:17:03 +00:00
Christophe Monniez 609c3ea573 [FIX] tests: avoid check document.readyState of about:blank
In an HttpCase test, when the browser_js method is used, an optional
javascript code can be used to check that the page is ready to execute
the test.

When no 'ready' code is given it defaults to check the
'document.readyState' status.

In some rare cases (discovered by @Xavier-Do) this status is checked on
the 'about:blank' page. As the page seems ready, the test code is
evaluated and fails.

With this commit, when no specific ready code is provided, the test will
wait for a chrome devtools event that ensure the page is fully loaded
before starting the test.

cherry-pick of 03a8819652

closes odoo/odoo#30609
2019-01-28 13:16:26 +00:00
Xavier Morel a0e05e2ab9 [IMP] fields: selection fields only use strings
closes odoo/odoo#29039
2019-01-26 14:25:44 +00:00
Christophe Simonis cf52a04979 [MERGE] forward port branch saas-12.1 up to d3b8422c9c
closes odoo/odoo#30614
2019-01-28 13:58:11 +00:00
qha-odoo 5b563549fa [IMP] website_event, *: refactor website events layouts
* base, portal, website, website_event_sale, website_event_track

- The previous event registration form was not clear on mobile

- Review some layouts to match the new design general idea, using cards
  (see forum refactoring of https://github.com/odoo/odoo/pull/29235)

- Use correct bootstrap components (like a menu instead of a breadcrumb
  on event pages)

- Review options to be able to disable the left / right column and
  choose the exact options you want to appear in them

task-1858034

closes odoo/odoo#30559
2019-01-25 14:30:55 +00:00
Xavier Morel 92d5a4bce5 [REM] builtin logrotate features
It's completely FUBAR when using workers[0] and properly
reimplementing it is not really worth the effort when logrotate(8) and
newsyslog(8) exist (or cyclog/multilog/cronolog if you subscribe to
the "logrotate and newsyslog are a design that should be consigned to
history" school of thought).

[0] https://stackoverflow.com/questions/34186774/why-doesnt-timedrotatingfilehandler-work-properly-and-how-to-solve-this-issuer

closes odoo/odoo#29073
2018-11-27 14:05:03 +00:00
Yenthe V.G 246144ac51 [IMP] base: add sheet and group names on form views
To make the rendering looks better and to make it easier to do xpath
2019-01-22 10:30:02 +00:00
jbm-odoo a3daff6bc1 [IMP] hr_holidays: Rename 'leave' into 'time off' + add dashboard
Purpose
=======

We need to use an international word to define holidays and leaves, rename everything into Time Off.
Employees needs a good dashboard and leaves summary

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

1/ Add a new dashboard: https://balsamiq.cloud/sm5j0d/pg5w04r
   Create a new dashboard with a calendar and a summary of all time off and time off request
2/ Rename leaves into Time Off everywhere
3/ Improve general usability

TaskID: 1916871

closes odoo/odoo#29634
2019-01-21 11:29:30 +00:00
Yannick Tivisse 1684ec555d [IMP] hr_payroll: Manage multi company on payslips/contracts
Purpose
=======

Currently the payroll doens't manage the multi company

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

1/ Add ir.rules on hr.contract and hr.payslip to prevent users
   to access a record in another company.
2/ Add ir.rules on hr.payroll.structure to prevent users to access
   a record for another country.
3/ Remove company_id fields on models that doesn't require it, as
   hr.salary.rule.category.
4/ Make the accounting fields on the salary rules company dependent.
5/ Specify the country on the salary structures on the
   l10n_**_hr_payroll modules.
6/ Add demo data and modify the salary package tour.
7/ Make the car_atn and company_car_total_depreciated_costs fields
   compute_sudo=True, as one car can be assigned on several contract,
   for different companies

Closes #26866
Closes #25231
Closes #24683
Closes #23814
2019-01-21 12:33:03 +01:00
Raphael Collet 139595d441 [IMP] fields: allow reuse of the m2m relation if explicitly given
This allows a model to have several fields using the same relation on purpose,
for instance to show the related items filtered by domains.

Also adapt the code to handle multiple many2many inverses.

closes odoo/odoo#30338
2019-01-18 11:09:21 +00:00
Christophe MatthieuandAntoine Guenet f296992317 [IMP] web_editor,*: Refactoring the wysiwyg editor and 'html' field
* Creating a new structure by transforming all the plugins in the
  library using the odoo inheritance system. Plugins are easier to
  implement with the AbstractPlugin to add Odoo behaviors.

* From now on, the methods of the library (in this case Summernote) can
  no longer be called by other modules or files. Only the wysiwyg
  widgets can access it, to simplify the updating process. The wysiwyg
  object serves as an interface.

* Depending on the options the snippets will be loaded or not, the
  editor will be in an iframe or not... all of this is transparent from
  the outside.

* Regarding iframes, all controllers related to editing have been
  removed: the new API no longer needs them. This speeds up loading,
  eases testing and removes complexity for the same
  features.

PUBLIC FEATURES

There are several public methods on the Wysiwyg class:
* Wysiwyg.prepare (WidgetParent): returns a deferred resolved when the
  library (xml, lazy, assets...) is loaded.
* Wysiwyg.getRange (DOM): returns the range (selection in the dom)
* Wysiwyg.setRange (startNode, startOffset, endNode, endOffset): creates
  a range (selection in the dom)
* Wysiwyg.setRangeFromNode (DOM, options) that creates a range from an
  element (option available to select all, start or end)

A jQuery selector was added: :o_editable, which indicates whether the
current element is editable. That is, if it is contained in a tag with
the attribute 'contentEditable = "true"' or in a tag with the class
o_editable.
Several methods are also present:
* focusIn: makes a focus and places the cursor at the beginning of the
  element
* focusInEnd: makes a focus and places the cursor at the end of the
  element
* selectContent: makes a focus and selects the content

HTML FIELD

The HTML field can receive different options:
* style-inline: {boolean} transforms a class into an inline style when
  saving and vice versa when reading.
* no-attachment: {boolean} prevents the use of attachments (in media
  dialog)
* cssEdit: {xml_id} to use a template containing the css to loaded in
  an iframe when editing
* cssReadonly: {xml_id} to use a template containing the css to load
  into an iframe when viewing in readonly
* snippets: {xml_id} snippets template (can be used with or without
  cssEdit)
* wrapper: {template} qweb static template (containing a tag:
  id = "wrapper") that will include the content during editing (removed
  on save)

MASS MAILING

A widget was created for mass mailing. There are now two fields:
body_html and body_arch.
body_arch contains the code with the class without conversion into
inline style, useful when editing and one with the inline style that is
visible in readonly mode and sent by email.
Advantage: no spreading errors, able to update css/theme, able to do
more changes when converting to inline style so that a maximum of mail
clients have an impeccable rendering.

Co-authored-by: Antoine Guenet <age@odoo.com>
2019-01-17 08:40:21 +00:00
Raphael Collet 05861ffdf1 [IMP] fields: check for inconsistent many2many definitions
closes odoo/odoo#29323
2019-01-16 09:16:41 +00:00
Pratima Gupta 2f4ec15a37 [IMP]base: Unique barcode for customers.
If two customers have same barcode -
Current functionality : To select customer in POS, if we scan barcode, only the newly created customer will be selected.

To resolve this: Created the unique sql constraint for customer per company.
This commit is related to task# 1877329.

closes odoo/odoo#28316
2019-01-15 04:45:36 +00:00
Martin Geubelle a55fd329ab [FIX] test_main_flows: make tour pass without all modules
With the current test_main_flows dependencies, the tour does not pass in community.
Since rev. odoo/odoo@32db86e the `extra_trigger` waiting for `payment_method_id` is
never reached because the onchange who is supposed to display this field hides it
because there is only one payment method on the journal.

The second payment method is added by the module account_check_printing but we don't
want to add it in the dependencies because this module is not very common.

Note that this `extra_trigger` was meant to wait for the onchange triggered by the journal
modification on the 'Register Payment' modal but this modification is not useful as the
journal is already 'Bank (USD)' by default.

closes odoo/odoo#30023
2019-01-08 11:42:39 +00:00
Christophe Simonis d7c5bc02cc [MERGE] forward port branch saas-12.1 up to 8aa8548d8a 2019-01-09 19:59:27 +01:00
Romain Derie 37b518f174 [IMP] website, website_partner: use fields from mixin on res.partner
Currently, res.partner has:
1. `website_id` field hardcoded in website module
2. `website_published` field from website `website.published.mixin` in
   website_partner module.

At the end, the res.partner model has all the field of the mixin
`website.published.multi.mixin` without having the mixin.
As a result, we have all the multi-website fields but we don't have access to
the mixins methods & computes.

Now, we use the `website.published.multi.mixin` on res.partner in website
module even if `website_published` is not needed if website_partner is not
installed.

+ add tooltip to `website` field to prevent warning since 2 fields would have
  the same label

closes odoo/odoo#29711
2019-01-09 15:21:35 +00:00
Yenthe V.G 201bd9101d [IMP] base: Add sheet of several basic form views
Add <sheet> tag on the form view for the following models:
- res.bank
- res.country
- res.country.group
- res.country.state
- res.partner.title
- res.partner.category
- res.partner.industry

[IMP] base: add sheet to countries form and add group names for clean xpaths

[IMP] base: add sheet to contact tags form

[IMP] base: add sheet to parter title form

[IMP] base: add sheet in sectors of activity form

[IMP] base: add sheet to federal states form

[IMP] base: add sheet to country group form

[IMP] base: add sheet to bank view and add group names for cleaner xpaths

closes odoo/odoo#27324
2018-11-22 10:47:08 +00:00
sed-odoo ea5c10a11c [IMP] base: Add a new 'Approvals' module category
Will be used in a new module in the enterprise repository

closes odoo/odoo#29384
2018-12-28 10:58:50 +00:00
Denis Ledoux ec48392e39 [TODO] service/server: note to remove override that will become useless
The method override `_handle_request_noblock`
is there to solve a bug in Python socketserver library
which has been solved in
- Python 3.6: python/cpython@8b1f52b5a9,
- Python 3.7: python/cpython@9080824513,

through PR python/cpython#9952.

These revisions will be included in Python releases 3.6.8 and 3.7.2,
and the override will then become useless.
We therefore can remove the `_handle_request_noblock` override
as soon as the Python 3 releases installed on operating systems
supported by Odoo are above
- 3.6.8 for Python 3.6
- 3.7.2 for Python 3.7

closes odoo/odoo#29706
2018-12-21 11:27:44 +00:00
Florent de Labarre e0d1fd7ec7 [IMP] base: allow to group modules by state
To easily identify the one installed or in error state

closes odoo/odoo#28938
2018-12-20 15:11:10 +00:00