Commit Graph
4565 Commits
Author SHA1 Message Date
Krupal Oza 6d17897dff [IMP] various: Clean the kanban view design
PURPOSE
=========================

The goal of this task is to set up some kind of guidelines to make
kanban views consistent.
It is fine having different kanban views, but if a UI element is shared
among several kanban views, it should behave/look the same so the user
knows what to expect.

Kanban views can be split into two types:
==> 'documents' kanbans, such as res.partner, crm.lead, etc.
    - those records are created/edited often, numerous
    - 'opening' the card means accessing the record
==> 'dashboard' kanbans,such as stock.picking.type,account.journal, etc.
    - those records are not created/edited often, there are much less numerous
    - usually presented as dashboard, where 'opening' the card means
accessing a set of related 'documents' (clicking on a account.journal
to access account.move, or stock.picking.type to access stock.picking)
    - configuration of the 'card record' is done through a dropdown to
access configuration

Here are some guidelines for consistency. Bear in mind that those are
not rules, but guidelines for consistency that we'd like to keep in
mind when designing.

==> 'documents' kanbans
 - the record is accessed through global click
 - the user avatar is at the bottom right
 - the activity widget is at the bottom left (in last position if
there are other elements)

==> 'dashboard' kanbans
 - the record is accessed through a 'Configuration' option in the card dropdown
 - there is no global click, and therefore no focus shadow
 - the dropdown icon (o_kanban_manage_toggle_button) is always visible,
with icon fa-ellipsis-v
 - the listview counterpart should be presented as a dedicated
configuration menu, and shouldn't be in the 'dashboard action'
 - links in the body of the card are structured as follows: link with
<count>+label, then any additional aggregated metrics (not link) to the right
example https://drive.google.com/file/d/1ZP6HDHTtC7cQ6rDWgqLoPs6U8JCeNVkW/view?usp=sharing

==> global guidelines
 - the title font color is #212529, with 500 weight
 - the subtitle font color is #666666, with 400 weight
 - the font size is 1.083rem
 - text overflow is handled through linebreak, not ellipsis
 - numerical values are aligned to the right
 - the kanban state widget is at the bottom right

SPECIFICATION
=================

AS per guidelines Improved follwing kanban/dashbaord view
 - hr_job
 - hr_department
 - hr_work_entry
 - hr_appraisal
 - fleet_vehicle
 - product_template
 - sale_subscription_template
 - crm_team
 - res_partner
 - event
 - stock_picking_type
 - mrp_eco_type
 - maintenance_team
 - quality_alert_team
 - account_journal

Added the department menu on employee with default kanban view
Added sequence in hr_work_entry list view

TaskID: 2206372
Related Enterprise PR: https://github.com/odoo/enterprise/pull/10341
Closes: #50536
2020-05-18 12:11:22 +00:00
Martin Trigaux d9287caf94 [IMP] *: convert to private methods
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id

Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
2020-05-14 13:59:10 +02:00
Jordi Ballester Alomar 8f34b34abd [FIX] product: Display weights and packages in product variants
closes odoo/odoo#50679

X-original-commit: ffa32607c15798a9bc6ea1f37b714e5dabfd0be4
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-05-05 15:10:03 +00:00
Victor Feyens 1828d6db0d [FIX] product/populate: wrong population size model attribute.
The attribute defined isn't the right one, thus on population,
those models are populated with the default _populate_sizes defined in base.

closes odoo/odoo#50464

X-original-commit: ad7436bb9d2b965f926aa2d1f45a89ea5f6dfc9f
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-04-30 12:05:06 +00:00
Martin Trigaux 2d00263127 [I18N] *: export saas-13.3 translations
closes odoo/odoo#50031

X-original-commit: 15a7a9f9d71a0b9c46d7caf2f4fbf09a5a4c63fe
Related: odoo/enterprise#10140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-04-23 07:13:48 +00:00
Arnaud Joset b3149d84a0 [IMP] product: pricelist convert boundary dates to datetime
Before this commit, pricelist boundaries were dates. It was not possible to get a modified price at a precise time: e.g. modify the formula at 12h00.

closes odoo/odoo#49030

Taskid: 2221094
Related: odoo/upgrade#1055
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-09 14:52:31 +00:00
Victor Feyens 6fd2d9b898 [FIX] product,website_sale: partner pricelist fallback
When no pricelist property is defined for a customer, we use a search as
fallback, without considering the current companies.

This means you can see the pricelist of company B as pricelist for a
partner, even with company A as main current company (if both company
are enabled in the multi-company widget).

Forward-Port of #46429

X-original-commit: 68040c92c8e09218641d823d690e0ce36dcdef30
2020-04-16 11:48:56 +00:00
Victor Feyens d6893ae727 [FIX] product,sale: When multi-currency is enabled, pricelists should also be enabled
Since https://github.com/odoo/odoo/commit/7d8df4bec192e5a2ff3341dcf43d59e06a57f9a9, the groups
managing pricelists features have been updated.

But the onchange feature enabling pricelist on multi-currency activation was wrongly
adapted, it was only activating advanced pricelists, iff basic pricelists were enabled.

The wanted feature is to activate pricelist (basic pricelist features: group_product_pricelist)
when multi-currency is enabled.

Also add an implied_group on multi_currency group to enforce this behavior.

closes odoo/odoo#49633

X-original-commit: f862f9650395b02f6a43c57cdf232a309fa6948e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-04-16 08:36:03 +00:00
Nicolas Martinelli 3afa75499c [FIX] product: hide 'Configure Variant' button
The 'Configure Variant' button doesn't show any relevant information in
case of a product variant. It is only useful for a product template.

opw-2229881

closes odoo/odoo#49059

X-original-commit: d57331f5403159692591fe75c6e8e4f1e9ac6b02
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-06 13:17:13 +00:00
Raphael Collet 5ab51dee7b [FIX] *: useless old API field parameters 2020-04-07 09:25:08 +00:00
Julien Mougenot 48ee7272b6 [IMP] *: adapt qunit suite bundle inheritance
Since the test assets bundle name has been changed and its structure is different,
the inheriting assets need to be updated.

Task 2002399
2020-04-07 14:40:53 +00:00
Pierre Masereel c121a22756 [FIX] product, point_of_sale: remove error when no logo and layout
Since the wizard to set a logo and chose a layout has been removed, we
don't need anymore to throw an error if they are not set because the
report can be generated.

closes odoo/odoo#48831

X-original-commit: b7c7039667d9ec816e647a0dd30570a4a690cca2
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-04-02 08:28:24 +00:00
Christophe Monniez 748cc7e501 [IMP] base, lunch: populate res.users and lunch models
closes odoo/odoo#48636

X-original-commit: f3f2a1e4723240b6396cea943fc86291c16f4c9d
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2020-03-30 21:30:15 +00:00
jerome hanke (jhk) 91d341adce [FIX] product: barcodes can be url encoded
Steps to reproduce:
- install sales and barcodes
- go to sales > catalog > products > create
- give the product a random name and the following barcode: #1N4005-T+A
- save > print > product labels

Current behavior:
the barcode is not generated properly because it is not url encoded
everything after the # charachter is ignored

Current behavior:
barcodes are url encoded and generated properly

opw-2203716

closes odoo/odoo#48607

X-original-commit: 5aaacb825d0c408bc11c4fbb386e1d365a68594b
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-30 12:19:21 +00:00
svs-odoo 8710ce9179 [IMP] product, mrp_subcontracting: price in USD
Sets the currency of supplier info (purchase price) in demo data on USD.
The reason is the default company currency is EUR, so the supplier info
created use the company currency by default.
But once account is installed, the company currency is switched for USD.
As multi currency is inactive by default, the user can't see the product
purchase prices aren't in the same currency than all the other prices.

task-1970460
2020-03-26 11:44:56 +00:00
Victor Feyens e576f8eb33 [REM] product: rental field
Old leftover, potentially misleading w.r.t Rental enterprise
application.

closes odoo/odoo#47999

Related: odoo/upgrade#963
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-03-26 10:27:57 +00:00
Victor Feyens 57e477e8e3 [FIX] product: the pricelist discount_policy should be required 2020-03-26 10:27:57 +00:00
Victor Feyens f3f681a408 [FIX] product: missing digits on quantities fields 2020-03-26 10:27:57 +00:00
Victor Feyens 097b64075a [IMP] product: computes can be written in batch.
When the value is the same for all records, the write can be done in 
batch, this can lead to a "slight" performance improvement, depending on 
write overrides, and how the value was computed for each line.
2020-03-26 10:27:57 +00:00
Victor Feyens f93965130c [IMP] product: show the attribute extra price with product currency. 2020-03-26 10:27:57 +00:00
Goffin Simon 89ede9b576 [FIX] product: Duplicating attribute
Steps to reproduce the bug:

- Let's consider an attribute A with two values V1 and V2
- Let's consider a product P with V1 and V2 as attributes
- Duplicate A

Bug:

P was associated with 4 attributes V1, V1, V2 and V2

opw:2219540

closes odoo/odoo#48342

X-original-commit: 1c44aeb7d1734cd7a6dbdb80971f98553c67003b
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-03-25 12:12:23 +00:00
Victor Feyens 532c083cbb [IMP] *: remove global field definition in ir rules xml
It is a computed field, there is no need to manually set its value.
2020-03-20 16:15:40 +01:00
Julien MougenotandMathieu Duckerts-Antoine e68d3bb09d [REF] *: Adapt all modules to new control panel
Adaptation of the code throughout all modules to properly instantiate the newly
refactored control panel and update it accordingly.

Part of task 2196029

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2020-03-13 14:08:33 +00:00
jvm-odoo c7f095396e [FIX] product, purchase_stock: fix infinite loop on template name_search
Issue

	- Install purchase_product_matrix, Inventory
	- Create a (storable) Product P with default_code e.g. VOB2A
	  with a vendor V who uses a product_code e.g. VOB2a
	- Create a PO/RFQ for vendor V
	- Add a product, search "vob2" (copy/paste)

	Infinite loop

Cause

	purchase_product_matrix replace purchase.order_line.product.product
	by product.template so the name_search is different and the
	product.template's name_search loop doesn't support the case where
	you have default_code == product_code

Solution

	Check if the product's name_search returned a product containing
	product_template_ids that we did not wanted (as mentionned in the
	domain). If yes, it means that we will have an infinite loop so
	we should break.

Additional note: the issue could be in versions < 13 but
purchase_product_matrix is only in 13.0 and this is not a
very common case.

OPW-2193005

closes odoo/odoo#47576

X-original-commit: 9d5d80f77bc04be83d5b2ca0569a6ea50e26a07e
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-03-13 11:26:09 +00:00
William Henrotin f36d0ce584 [FIX] product: unarchive variant archive template
Steps to reproduce:
  * Create a template with 2 variants
  * Archive one variant
  * Unarchive this same variant

--> the template is archived
This is due to commit 6a13b565cbbad89ff1c4177b171b01f30c83edf9. If the
variant is the only one, toggle_active on the variant should be
reflected on the template. The issue is that toggle active do not count
archived variant. One active variant and one archived variant are
counted as 1.
This commit make toggle_active count all variants

closes odoo/odoo#34769

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-03-10 13:57:07 +00:00
Parth Choksi 42e6396d4a [IMP] product: barcode should not disappear on archiving product
Before this commit when a user archives the product, the barcode
field in its template used to get disappeared.

Since barcode field in template is a related field to product,
the field gets invisible in product template when the user archives
the related product.

After this commit, even when a product is archived,
its barcode will still be visible in template.

Here the barcode field is changed from related to computed.

task-1978559
2020-03-10 13:56:03 +00:00
Hemali Bhimani 80ede1d0c0 [IMP] product: min quantity int -> float
purpose of this commit is to change the field type
of min_quantity from int to float on product pricelist
object

task:2165208

closes odoo/odoo#45792

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-09 06:46:25 +00:00
Tiffany Chang (tic) 99252f3d93 [IMP] stock/mrp: Update UX
This commit updates product, stock and manufacturing views for improved
usability. Handles view only changes of overall usability improvement
task. Specifically spec numbers:

1. Add "Run Scheduler" (from stock) to the manufacturing app under operations
5. Make "detailed operations" wizard modal have more intitutive footer
   buttons (i.e. don't say "Confirm"/"Cancel" when changes aren't
   possible.
8. Rearranging of vendor pricelist view
9. Updating of tooltip content for "property_stock_account_input_categ_id"

Task: 2041853
2020-03-05 13:04:10 +00:00
Victor Feyens 917e7a1a9b [FIX] product: standard_price depends on company context
Product templates standard_price (cost) is company_dependent,
because the product_product standard_price is company dependent.

closes odoo/odoo#47041

Forward-port-of: odoo/odoo#46841
X-original-commit: 30ee9f1ac411aca9c2bf2158fca9be7db743616d
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-03-05 19:17:17 +00:00
Simon Lejeune 53e89e5006 [FIX] product: expand group on categories only when needed
Issue: on main product's kanban, if you group by categories, all
categories (even the empty ones) appear. This is not desired.

We only wanted this group_expand logic when using the products stat
button on the product category form view.

closes odoo/odoo#46966

X-original-commit: e3f1254e5b28aa801f137835d871427786fb3428
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-03-05 12:25:06 +00:00
Victor Feyens 0fd9b80d39 [FIX] product: cost_currency_id is company_dependent
X-original-commit: 0455ff88cb7c9211327b31866be54840730336dc
2020-03-03 19:09:13 +00:00
Victor Feyens d3bbe14c8d [IMP] product: improve creation performance.
The default product category and uom should be fixed on generic 
undeletable records (in data files).

And by caching those default values, we can gain up to 20% time when 
creating products without providing uom and categories.

Also remove the unnecessary defaults on the compute fields, which do the 
same as the compute (and have no use because it is a non stored field).

closes odoo/odoo#45791

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-02-20 14:51:13 +00:00
Victor Feyens 2d688510d1 [IMP] product: do not allow the deletion of the main product category 2020-02-20 14:51:13 +00:00
Martin Trigaux 0cc8610923 [I18N] export saas-12.3 source terms
closes odoo/odoo#45285

X-original-commit: bb281e98f52a2716f00d43a07446a08df698c1dd
Related: odoo/enterprise#8413
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-02-13 11:45:39 +00:00
Andrea Grazioso (agr-odoo) ed17f560fa [FIX] product: recover a uom even when the default one is deleted
Delete the uom 'kg'(kilos, kilograms), open a product form view

Traceback will popup because the hardcoded xmlid cannot find the value
in the database since has been deleted. Adding a fallback fix the issue

opw-2194659

closes odoo/odoo#45265

X-original-commit: 62baf8ba12cdf4521c6d0d0fea61ff1aa2e3f4d8
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-13 08:57:59 +00:00
Adrian Torres 97a5093117 [FIX] *: specify at least one field in search views
Without at least one field, performing a search in these models' search
view is outright impossible.

closes odoo/odoo#45177

X-original-commit: 0aabfbff3ce5d68bf37e1734ba7aa43f62803f3a
Related: odoo/enterprise#8379
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-12 11:09:05 +00:00
Nicolas Martinelli 12af185961 [FIX] api, product: search by pricelist
- Activate variants and pricelists
- Go to Product > Products Variants
- Search for anything on the 'Pricelist' filter

A traceback is raised: 'Can only create cache keys from hashable
values...'.

This comes from the following change:

https://github.com/odoo/odoo/blob/4b06fe19fa68255b7982d15e5847da2f6d6209fd/addons/web/static/src/js/views/control_panel/control_panel_model.js#L962

It returns a list instead of a string. Since a list is not hashable, it
causes the issue.

There are not much solutions since the context key `pricelist` can be a
`list` or an `int` (an ID). We force the cache key conversion to a tuple
to avoid the `TypeError` and handle the `list` use case (which was
broken on top of crashing).

opw-2187757

closes odoo/odoo#45064

X-original-commit: ec0a8767143b4c4818418281803c4f52fefa8d2a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-11 11:05:09 +00:00
jerome hanke (jhk) d657a9c29a [FIX] product: removal of hardcoded value in product template
Steps to reproduce:
- install sales
- activate units of measures and variants
- set imperial units under general settings (pounds for weight and ft³ for volume)
- create at least 2 variants on a product and access them via the smart button
from product.template

Previous behavior:
the volume remains in m³, it is hardcoded in the template

Current behavior:
the volume is printed just like the weight (generic uom notation)

opw-2186965

closes odoo/odoo#44777

X-original-commit: d7f2beac5ff856afeb684be4b13317838a0257a1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-06 17:19:55 +00:00
Victor Feyens ecc068762e [FIX] product: pricelist advanced rules UI
closes odoo/odoo#44675

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-02-05 18:07:12 +00:00
Pierre Masereel 2c079fcd10 [IMP] product,delivery: improve unit of measure display 2020-02-04 12:57:52 +00:00
Xavier Morel b1e58ab6c6 [FIX] product: deprecation warning triggered by assertion
Replace an assertRaises(StopIteration) by a next() with a default
value.

Following PEP 479, *any* StopIteration reaching the toplevel of a
generator triggers a DeprecationWarning. And while the assertRaises
looks innocuous, both _assertRaises and the underlying
clear_upon_failure are implemented with functools.contextmanager,
which wraps a generator.

As a result, exceptions raised in the assertRaises "body" get
reinjected inside the wrapped context manager[0] and if the exception
is a StopIteration it triggers the warning.

By not using assertRaises we side-step the issue.

[0] https://github.com/python/cpython/blob/b6999e5690c7006b0ba4049cfd638513c982a90c/Lib/contextlib.py#L131
2020-02-04 12:42:35 +00:00
Nicolas Martinelli 749d4730a2 [FIX] delivery, product, stock: use 'Volume' decimal precision
Use the 'Volume' decimal precision on all `volume` fields.

Complement of commit c1a5221ba2

opw-2185374

closes odoo/odoo#44473

X-original-commit: dc0111d6cdf4032fa840f9ff95f4fa687d33f77c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-03 11:10:24 +00:00
Mitali Patel 343f7d61df [IMP] product: added check_company feature on pricelist
Purpose of this commit is pricelist/pricelist item can not
created/modifided linking records of diffrent companies together

closes odoo/odoo#44391

Task: 2090409
X-original-commit: 9b62813cddb2726003b4b989c32185400059dfa1
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-01-31 13:34:49 +00:00
Hemali Bhimani f168703247 [IMP] *: updated import templates to match data model
purpose of this commit is to make import template compatible with v13

task-2146510
closes-#42279

closes odoo/odoo#44375

X-original-commit: 37aadf1227531838ada7dc3810cf463379736e96
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-01-31 12:04:45 +00:00
Arnaud Baes 97af72330a [FIX] product: Add products without 'combination_indices' to cart.
Sometimes when we try to buy a product that doesn't have any variants,
it would result in an error saying there isn't any valid combination
for that product.

This was happening because `_get_variant_id_for_combination` was
considering that the field `combination_indices` would always be
equal to `''` (empty string) in such a case.

This isn't true as `combination_indices` isn't a required field
thus allowing `null` \ `None` to be valid values for that field.

This fix will simply include products with no values set for their
`combination_indices` when searching a corresponding variant from
the `product_template`.

closes odoo/odoo#44056

X-original-commit: 03e7efc3b4592c5f063c665130011a91fcc4d683
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2020-01-27 19:51:58 +00:00
Damien Bouvy 4c427de6a3 [FIX] product: incorrect super call
Unfortunately caught in a really wide try/except clause where it was
completely silenced, causing a lot of stuff to be archived instead of
deleted.

closes odoo/odoo#43543

X-original-commit: cfa2993615150416b801ce942f18339065678648
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2020-01-20 09:56:29 +00:00
Sébastien Theys 69f0f765bd [FIX] product: flush before invalidate in write override
Since [1] `computer_hdd_attribute_lines` is archived instead of unlinked in
`TestSaleProductAttributeValueConfig` which leads to indeterminism in tests due
to the missing `flush`.

Indeed `flush` is necessary before `invalidate_cache` since [2] if the data
that are pending being written must be saved to the database before the cache
invalidation.

[1] which highlighted the issue was merged after v13.0, but it still makes sense
to merge the current fix in the earliest version possible.

[1] 5361706e5e
[2] 9920f20e4c

closes odoo/odoo#43483

X-original-commit: f721bfe2860293d1456770d57be7805920929ca0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-01-17 12:37:24 +00:00
Goffin Simon 4734315aad [FIX] product: Searching prodcut on internal ref when archived
Steps to reproduce the bug:

- Let's consider a product template P with an internal reference = I
- Archive P
- In the list view of product template select the Archived filter and
search for I with the Product filter

Bug:

P was not found.

opw:2169441

closes odoo/odoo#43414

X-original-commit: 051e8581ba05ed0e5762b6e7e18a78179822146d
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-01-16 12:52:32 +00:00
Victor Feyens 2e2e877ae5 [IMP] product: product_variant_count shouldn't be editable.
closes odoo/odoo#43305

Related: odoo/enterprise#7718
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-01-14 17:16:20 +00:00
Arnold Moyaux bce112678a [IMP] product, purchase_requisition, purchase_stock: _prepare_seller args to kwargs 2020-01-09 16:09:12 +00:00