Commit Graph
129498 Commits
Author SHA1 Message Date
Pierre Masereel ab0a207a59 [FIX] point_of_sale: force load discount product
When you set up a discount product on your pos config and also some
available categories, it is possible that the discount product is not
loaded in the point of sale, which lead to an error.

Now we are forcing the loading of the discount product to allow using it
even if it is not in the allowed categories, as we don't want to create
a discount product for each category if we want to use both features.

TASK-ID: 2057436
2019-08-27 09:31:31 +00:00
Pierre Masereel d0840a5ba6 [FIX] point_of_sale: currency on default cashbox
When you are creating a cashbox as default on a config, it cannot find
the config as it is not linked to it yet.

So we are passing the currency of the config in the context to correctly
set it.

TASK-ID: 2057436
2019-08-27 09:31:31 +00:00
Pierre Masereel 8fbbf1c696 [FIX] point_of_sale: vailable categories in POS
When you are selecting the some available categories of products for a
point of sale config, it won't let you select a start categories
anymore. This is caused by changes made on onchange in rev:f44571f550dfa34ddb1a62bbe03e78a4dadf8eda
that makes the records of One2many with new_ids instead of classical
ids.

The other problem is that if you return a in an ocnchange, the domain
does not apply when you are starting to edit a record.

To fix the behavior, we are comparing the ids, instead of the recordst
makes the records of One2many with new_ids instead of classical ids.

We've also created a computed fields that contains the ids that can be
selected.

TASK-ID: 2057436
2019-08-27 09:31:31 +00:00
Pierre Masereel b8f7b472a6 [FIX] point_of_sale: specify views
In the module pos_iot, an AbstractAction overrides the buttons that
validate the session to send to terminal the balance of the day.

TASK-ID: 2057436
2019-08-27 09:31:31 +00:00
Sébastien TheysandJuhil Somaiya 30d3ac79c7 [IMP] product, *: allow multiple lines for the same attribute
* = sale, website_sale, website_sale_comparison

Purpose
=======

This allows to handle use cases such as grape varieties for wine products where
multiple values need to be set for the same attribute, but they are all
informative and should not generate a choice or variants.

The general logic that existed previously is kept:
- multiple attribute lines on a product behave as an AND between them
- multiple values on a line behave as an OR between them

Example
=======

To generate 2 variants, with one possible value for each:
Line A: val 1, val 2

To generate 1 variant, with both informative values on it:
Line A: val 1
Line A: val 2

Technically
===========

- remove the constraints that prevented this use case from working since the
refactoring done in the previous commit removed the ambiguity when two
different lines have the same value
- update the product and comparison views accordingly

Extra
=====

- make the attribute category translatable and improve its list view

Final part of task-1912579

PR: #32946

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>


Co-authored-by: Juhil Somaiya <jso@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2019-08-26 13:01:14 +00:00
Sébastien Theys 22a11a6f4d [REF] product, *: save product.template.attribute.value on variants
* account, hr_expense, mrp, sale, sale_product_configurator, stock_account,
  website_sale, website_sale_comparison

Before this commit, the `product.attribute.value` were stored on the variants.
This required filtering of attribute lines to find the appropriate matching
`product.template.attribute.value` that were used in most of the business code,
such as when computing the `price_extra`.

This also prevented to have multiple attribute lines for the same attribute,
which is needed to handle use cases such as grape varieties for wine products.
This will be done in the following commit.

After this commit, the combination of `product.template.attribute.value` will be
directly stored on the product variant.

Other changes
=============

Add `combination_indices` on product, which allows to quickly find a variant
matching a combination (1 simple indexed equality query as opposed to 1 query
with as many joins as there are attribute lines), and to add an easy
SQL constraint to ensure active combination uniqueness.

Add active field on `product.template.attribute.line` and
`product.template.attribute.value`, with the same behavior as variants:

They become archived if they can't be unlinked. This allows to keep the database
consistent, such as archived variants correctly keeping all their values, sales
order lines keeping their custom and no_variant. This is done with the help of
`ondelete=restrict` on the corresponding m2m fields, and the `unlink` methods
falling back to archiving when `unlink` is restricted.

Part of task-1912579

PR: #32946
2019-08-26 13:01:13 +00:00
Christophe Monniez 191213bca2 [FIX] tests: avoid warning during a setUpClass failure
Since 735ee54 the logs are improved by getting additional informations
from the traceback. When the test fails during the setUpClass, the test
object received by the getCallerInfo method is not a TestCase instance
but an _ErrorHolder. Although they should have the same API, as stated in
unittest documentation, the _ErrorHolder does not have  a
_testMethodName attribute leading to a warning.

With this commit, the warning is skipped in that particular case.

closes odoo/odoo#36108

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2019-08-27 08:43:09 +00:00
wan 8f4c8ef2db [IMP] account: add the ability to exclude from journal groups
Task 2034896

* Change the logic from selecting journals to include, to journals to exclude
* Add a placeholder for the account.journal.group name
* Rename the field name for back-to-basics

closes odoo/odoo#34779

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-08-27 08:02:52 +00:00
Florian Gilbert d28ba99905 [REF] account: Clean accounting settings
closes odoo/odoo#35534

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2019-08-27 06:40:24 +00:00
Raphael Collet a2d6acc0c0 [FIX] website_sale: avoid non-invertible dependency
closes odoo/odoo#36020

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-26 14:14:56 +00:00
Raphael Collet 6f1dde1c38 [FIX] ir_module: missing dependencies
The fields `ir.module.module.dependency.state` and
`ir.module.module.exclusion.state` were not recomputed when the state of
their corresponding module was modified.  Add the missing dependencies,
and make them searchable.
2019-08-26 14:14:55 +00:00
Raphael Collet e5c6904a40 [FIX] models: log non-invertible dependencies as errors 2019-08-26 14:14:55 +00:00
Pierre ParidansandDharmang Soni 9c8902ed57 [IMP] web: add extension hooks to Dialog
This commit adds two methods as hooks to customize the way Dialog deals
with its buttons :

* _setButtonsTo() : to render and set the buttons into a container
element;
* _setRemoveButtonOption() : to define the remove button and
set its destination zone (header, footer)

Task ID: 2038324

closes odoo/odoo#35474

Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>


Co-authored-by: Dharmang Soni <dpr@odoo.com>
2019-08-26 14:13:06 +00:00
Pierre Paridans 96a52daa80 [REF] web: remove test coverage overlap in mobile test suite
The tests in the file `relational_fields_mobile_tests.js` - which is
part of the mobile test suite - are actually not specific to mobile.

This commit merges those tests asserts into the tests already present in
the regular test suite. It ensures that all the existing asserts remains
and the actual coverage stays the same.
2019-08-26 14:13:06 +00:00
Jeremy Kersten 0a540e0ef2 [IMP] website_blog: improve layout with latest specs
- Hide first post when latest not in full width mode
- Hide navigation Blogs when only 1, else always shown
- Compress image
- Show blog name when in one blog index, show latest when in all blogs
- Merge 2 controllers in one /blog and /blog/<record>
- ...

task-2057433

closes odoo/odoo#36091

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-08-26 14:49:43 +00:00
Romain Derie 269aa59411 [IMP] http_routing, website: allow to customize the lang in URL
With this commit it is now possible to change the lang displayed in the URL.
Eg, you could use `/fr` instead of `/fr_BE`, or even a fancier `/french`.

Task-32838

Courtesy of pla@odoo.com

closes odoo/odoo#35135

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2019-08-26 16:35:19 +00:00
Sébastien Theys f10f120de3 [IMP] base: remove default image from res.partner
Processing the default image takes too much time.

Creating 1000 partners without image takes around:
- 7s before this commit
- 1.5s after this commit

Moreover by saving the default image it's impossible to tell which partners
have a default image and which have an actual image.

After this commit, the views should handle displaying a placeholder when no
image is set, which is already the case since the default image could already be
missing if it was removed from `write`.

closes odoo/odoo#36093

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-08-26 15:50:28 +00:00
Thibault Delavallée cab25b690c [FIX] payment: fix error management in payment form
PURPOSE

Test frontend and UI tools of eLearning.

SPECIFICATIONS

Recent commit 5193f0d010 introduced a tool method to parse errors and ease
their management. A variable typo was done by mistake, fixed in this commit.

LINKS

Task ID 1937768

closes odoo/odoo#36085

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-26 13:33:26 +00:00
Aurélien Warnon bee50c4284 [FIX] website_slides: fix auto-completion of Youtube lesson
PURPOSE

Test frontend and UI tools of eLearning.

SPECIFICATIONS

A slide is supposed to be automatically completed in fullscreen mode when
Youtube player reaches the last 30 seconds of the video.

This feature was broken because of wrong Promise completion and also because
Youtube API has apparently changed the way they send "events". "Playing" event
was not sent every X seconds. Function running to check the video timer has
therefore been reworked to take that change into account.

LINKS

Task ID 1937768
2019-08-26 13:33:22 +00:00
Thibault Delavallée 4c6abbb5e1 [FIX] website_slides: fix placeholder and kanban images
PURPOSE

Test frontend and UI tools of eLearning.

SPECIFICATIONS

This commit fixes issues spotted when testing eLearning in backend

  * placeholder image was referring an unexisting image;
  * kanban was still using image fields prior to some image.mixin refactoring;

LINKS

Task ID 1937768
2019-08-26 13:29:49 +00:00
Raphael Collet c7f5c4afd2 [FIX] sql_db: add flush() in savepoint()
closes odoo/odoo#36060

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-26 13:39:16 +00:00
Raphael Collet eafdf1812d [FIX] sql_db: environment retrieval in cursor 2019-08-26 13:37:25 +00:00
Kevin Baptiste 054685875c [IMP] *: finetune search views (back2basics)
The goal of this commit is to finetune search views in several modules.

TaskID: 2055972

closes odoo/odoo#36058

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-26 07:40:02 +00:00
Martin Trigaux b247aa3252 [I18N] *: export saas-12.5 source terms
That will be used a the basis for the future 13.0 version
Without demo data

closes odoo/odoo#36057

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-26 09:38:09 +00:00
Daniel Blanco 90e9ceb583 [IMP] base: regions of Chile as states
closes odoo/odoo#36055

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-08-23 14:27:33 +00:00
Nhomar Hernández ff74a97450 [IMP] l10n_pe: Refactoring of the Peruvian CoA
And making ready for the future EDI modules.

- Added related account group on the move lines to
show account moves in a way Peru is used to.
As this allows to group by the account group
and to divide the hierarchical structure.
- Completely new CoA structure and tax structure
- Minimal fields for the EDI module later
- Districts and cities as we also need codes for
the EDI.
2019-08-23 14:27:33 +00:00
Nhomar Hernández e4f5d6b967 [IMP] base: Adding peruvian states. 2019-08-23 14:27:33 +00:00
Daniel Blanco 99f4a66de8 [IMP] l10n_cl: total refactoring
and preparation for the edi module

This module now depends on l10n_latam_base
for the identification types and
l10n_latam_invoice_document for the invoice numbering.

It has its own implementation where you can choose
yourself the sequences you want to add on a journal in
a many2many.  By default, you will have the sequences
for the document types of the first journal. But you
can share them on other journals or create new sequences
for a journal.
2019-08-23 14:27:33 +00:00
Katherine Zaoral ebe291560a [IMP] l10n_ar: complete refactor of Argentinian localization
Now, it depends on l10n_latam_base for the identification
types and on l10n_latam_invoice_document for the invoice
numbering.

It is the AFIP responsibility on the partner that
determines the document type.

There are also 3 demo companies for the most important
responsibility types for yourself.
2019-08-23 14:27:33 +00:00
Katherine Zaoral 895f89ff2d [ADD] l10n_latam_invoice_document: new module to manage documents types
This module special for Chile and Argentina, although e.g.
Brasil and the Domenican Republic could use it too in the
future.

The number of an invoice does not just depend on the journal, but
also on the document type which depends on the type of client you
will send your invoice to.  So, each of these needs their own sequence.

For the vendor bills, LATAM countries are really not used to an internal
reference number, so the internal number is immediately the one of
the vendor.

A special case is also that on certain documents, certain taxes need to be
included in the backend, but should not appear on the ticket (hidden,
but still included in the net price)
2019-08-22 16:18:40 +00:00
Katherine Zaoral f84dbf63b9 [ADD] l10n_latam_base: new module to manage multiple identification types
In Latin American countries, every partner needs
to be identified even if he does not have the usual
VAT number (whatever it is called) e.g. you can also
be identified by your identity card.

We chose to put those types also in the vat field,
but to be clear what it is, we added a selection field
before the vat field which is VAT by default, but
is e.g. RUT (VAT of Argentina) when you choose Argentina
as country.
2019-08-21 17:05:52 +00:00
wan 60dadc8ecd [IMP] account: acrual expenses/revenues
=======
Purpose
=======
Accruals are revenues and expenses that are incurred during an accounting period for which no invoices or payments were received or made.

=> We suggest a wizard allowing recognizing the Expense/Revenue in a different period keeping tax return in the invoice period.

Example:
A vendor bill received in February which was for the December consumption.
You should recognize the expense in December but the tax return is still due to February.

1) Regular Vendor Bill in february
Account          D          C
600 ACHAT    10000
411 TVA       2100
440 FOUR                12100

2) Action opening a wizard that allows specifying when we have to move the expense.
- Targeted date, accrued account (expense, revenue, taxes, ...)
- Action from account.move.line ?

3) Wizard result
a) The expense account is replaced by the accrued expense account in the original vendor bill journal entry (february)
Compte           D          C
444 FAE      10000
411 TVA       2100
440 FOUR                12100

b) A new accrual journal entry is created for the original expense account in december
Compte           D          C
600 ACHAT    10000
444 FAE                 10000

Was task 2006617

closes odoo/odoo#36053

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-08-26 12:16:27 +00:00
jbm-odoo 9cc67ea77b [FIX] ir_ui_view: Inconsistent filters on m2o
Inconsistent filters on the product_id many2one fields.

We should never use a "search_default_*" on a many2one field,
because this will only apply in the Search More popup and not
on the auto-completion.
We should always use a domain, as it will apply in both cases.

id=1944237

closes odoo/odoo#36009

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-23 09:23:25 +00:00
Fabien Pinckaers 59c6a19878 [FIX] account: compute partner ranks at post() + fixes
closes odoo/odoo#36080

Signed-off-by: Fabien Pinckaers <fpodoo@users.noreply.github.com>
2019-08-26 10:20:41 +00:00
Fabien Pinckaers 0ec6acc458 [FIX] base: multi-company code 2019-08-26 10:20:13 +00:00
Fabien Pinckaers 74b055f75c [IMP] speed improvement, no double None in _fields_triggers 2019-08-26 10:20:09 +00:00
Jinal Patel d155a0a03a [FIX] mrp_subcontracting: fix traceback while creating subcontractor
In this commit, remove 'subcontractor' as a default type
in context on 'subcontractor_ids' field.
By this commit, traceback has been fixed.

task-2058434

closes odoo/odoo#36070

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-08-26 09:18:47 +00:00
Julien MougenotandGery Debongnie 7812aec9c1 [IMP] web: editable list view resize
Added a resizing feature to all non-empty editable lists:
- added a handle to each column header, allowing resize
- column width will expand/shrink the table width
- resized columns will reset when reloading the list or sorting columns
- only available when the list contains data

closes odoo/odoo#35975

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>


Co-authored-by: Gery Debongnie <ged@odoo.com>
2019-08-26 07:49:28 +00:00
Julien Mougenot 38910befdf [REF] web: add style tests for list view
Added tests for:
- monetary field in 'fixed width' test
- height and width consistency between edit/redonly
- textareas word-breaking on long words
2019-08-26 07:36:28 +00:00
Julien Mougenot 91ea5a2ca4 [REF] web,*: native event dispatching in test utils
*: mail,partner_autocomplete: adapted tests

Added a new function to trigger the adequate type of event on
an element (native JS event to DOM Nodes and jQuery event to jQuery objects),
and refactored the generic event-triggering functions to call this new function.
2019-08-26 07:36:28 +00:00
Yenthe666 496fc0882d [FIX] base: use correct field name
The field is named ttype, not type

closes odoo/odoo#35943

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-24 10:43:38 +00:00
RomainLibert f6f16f1934 [FIX] mass_mailing: replace customer by customer_rank
Since odoo/odoo@8b7f42ab and odoo/odoo@8766f388 fields customer
and supplier on `res.partner` have been replaced with
`customer_rank` and `supplier_rank`

closes odoo/odoo#36067

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-08-26 10:08:33 +00:00
Christophe Monniez cdb904e059 [FIX] sql_db: revert ee03fc3770
ee03fc3770 introduced a non deterministic bug by choosing an
environment in a set, so the environment is not always the good one.

closes odoo/odoo#36056

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-08-26 08:18:40 +00:00
Robot Odoo ff52295c74 [IMP] stock and mrp : Usability improvements
**Description of the issue/feature this PR addresses**:
- Task: https://www.odoo.com/web#id=1943397&action=333&active_id=131&model=project.task&view_type=form&menu_id=4720
- Pad: https://pad.odoo.com/p/r.018c7fbae8a5a0757b9b1cc5ce2b1d01

**Description:**
- Removed "Assembly station 1" from everywhere and replaced it with "Assemmbly Line 1". Renamed "Assembly station 2" to "Assembly Line 2".
- operations field on BOM will be hidden when advanced routes are not active.
- Hide sequence field in form view in BOM and added a widget handle in list view.
- Hide field "Manufacturing readiness" in MO when WO aren't active.
- Added a domain in PLM in Lot/Serial Numbers to show only variants of the product.
- Removed red and green colors from Traceability Report.
- Renamed "Cost" to "Value" on products.
- Changed tooltip of "weight for shipping" in shipping information in inventory.

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#31594

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-08-26 13:20:27 +02:00
Damien Bouvy 9fc7887908 [FIX] sale: wrong date field since 0cc30bf
Second occurence after 1699be05. Hopefully the last.

closes odoo/odoo#36048

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2019-08-26 06:53:53 +00:00
Christophe Monniez 11c6d8fd37 [REL] saas-12.5 2019-08-24 10:05:46 +02:00
Hetal Dhanak 2f2ac55142 [IMP] stock: filter data for field 'product_id' in form view
of 'stock.production.lot'

previously in the selection field 'product_id' of
'stock.production.lot', all the products were always visible
no matter from where this view was getting opened from.
which is not ideal because if a user is creating a new lot
for a specific product, i.e. let's say if he opens this view
from 'product.template', he must not be able to select a
product variant other than of the product itself.

after this commit,
  if a user opens form view of 'stock.production.lot'
  by clicking on the menu action, all the products will be
  visible.
  if he opens it from product.template, only variants of
  the given products will be visible.
  if he opens it from product.product, only that particular
  variant will be visible and it will be readonly because
  there are no other valid values.

Task-1943397
2019-08-23 13:06:42 +00:00
Hetal Dhanak 7130838316 [IMP] mrp: hide sequence field
Task-1943397
2019-08-23 13:05:59 +00:00
Hetal Dhanak ef977fe634 [IMP] mrp: hide "manufacturing readiness" upon inactive WO
Task-1943397
2019-08-23 11:06:10 +00:00
Hetal Dhanak b13dfb502e [IMP] mrp: hide "operations" upon inactive advanced routes
Task-1943397
2019-08-23 11:06:10 +00:00