Commit Graph
116 Commits
Author SHA1 Message Date
William Henrotin d9f45ba694 [IMP] product,stock{_picking_batch}: product labels revamp
This commit removes the pdf and zpl reports for product templates and
variants. Instead, labels are printed via a new wizard allowing to
specify the label quantity, format and optional text.

There are a bunch of usual retail label sizes in pdf or zpl code

Task : 2501730

closes odoo/odoo#69690

Related: odoo/enterprise#20246
Related: odoo/upgrade#2542
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-09-01 15:01:48 +00:00
Antoine Prieels 0c3fe8736d [IMP] point_of_sale: Product configurator
Configure products with create_variants = 'never' from the POS

closes odoo/odoo#54956

Taskid: 208205
Related: odoo/upgrade#1522
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-07-30 13:08:24 +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
Simon Lejeune 03925faa48 [REF] product: multi company
Add an optional company_id on product.packaging to be able to share
of restrict them, similar to what's done for product.product.

task-1985992
2019-09-03 15:05:04 +00:00
Victor Feyens 2e640a37d4 [FIX] product: group_sale_pricelist implies group_product_pricelist
closes odoo/odoo#35912

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-08-22 15:27:59 +00:00
Victor Feyens 088de4f1eb [FIX] *: see pricelists when enabled
Since 
https://github.com/odoo/odoo/commit/e88fe6f380ed5682f2cedad16ba13ca43a3828c2 
, the groups to have access to pricelists is `group_product_pricelist`, 
not `group_sale_pricelist` anymore.

`group_sale_pricelist` is now a technical group enabling access to 
advanced pricelist rules (percentage/discount).
2019-08-22 15:27:59 +00:00
Victor Feyens 7d8df4bec1 [IMP][REF] product,sale,p_o_s: pricelist usability refactoring
Manage pricelists through a common configuration between sale and point_of_sale
Remove lots of technical fields

Improved Pricelist Flow
-----------------------

if pricelists enabled (product.group_product_pricelist), two modes are proposed:
* basic(default): pricelists enabled, but only with basic rules
* advanced: pricelists enabled, but with advanced rules (product.group_sale_pricelist)

When pricelists are enabled, we can always access them through the menu OR access their product-targeted rules from the products/templates views.
2019-08-14 14:03:23 +00:00
Gert Pellin ef99ea2daa [IMP] product, sale, sale_management: move discount group on product
The group 'group_discount_per_so_line' is used on reports in
point_of_sale but is created in 'sale' module and point_of_sale doesn't
depends on sale. So we've move this group on product to be able to
properly use it in point_of_sale.

TASK-ID: 2008468

closes odoo/odoo#35041

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-08-02 07:19:47 +00:00
Hetashree Chauhan 421b9dfe21 [IMP] delivery, product, sale(_management): make company consistence
Purpose of the commit is to make the multi company consistence with product,
sale order and order template.

So the Common Product Catalog setting is removed from generel settings
because its behavior wasn't really clean from a technical point of view
(disabling the rule on products access) and wouldn't work as well with
new multi-company logic.
The default logic of sharing products will be kept, but when someone
wants to limit products sharing, he will do so product by product, by
setting the company_id.

Also the default company_id on product will be blank so default product
will be a sharable by multi company.
and added company_id on sale templates so user can select his/her own
company or the templates which are common.

task-2025168
Closes: #34342
2019-07-22 05:17:00 +00:00
Simon Lejeune 0477bdb75a [REF] product, stock_account, etc: remove product.price.history table
This table tracked standard price changes.
It was used to compute the valuation at date in AVCO and standard
through `get_history_price`.

The next commits will introduce the stock valuation layers, separating
the valuation from the stock move. As a valuation layer will be created
when a standard price is updated on the product or when a stock move
impacts the valuation, the information from this table will be
duplicated.

We don't plan to adapt `get_history_price` to work with the valuation
layer since the valuation report at date and today will be the same: a
grouped list on the valuation layers with eventually a domain on the
date.

task-1875873
2019-06-09 14:11:36 +00:00
Yannick Tivisse a5b6f31cf2 [IMP] base: Contextualize the multi company
Purpose
=======

Allow the user to select the allowed companies for which he wants to see records
on top of selecting his current company.

It is confusing for users to see the records from the company he is connected to
and the records of the children companies.

Instead of using the hierarchy of companies to access records across companies,
the user can now select (from his set of allowed companies) the companies for
which he wants to access records.

/!\ This means that the user will interact with records from company A when in
company B.
Example: a SO has been created and confirmed in A. When in B, I create the
invoice from it.

Specifications
==============

1/ Deprecate the parent/children hierarchy on the res.company model. The fields are
kept on the res.company model to ensure the retro-compatibility, but won't be used
accross the standard code anymore. The only functional usage for this mechanism
was to allow to see records from several companies by creating a virtual parent
company, which will be possible with the new mechanism.

2/ By default, a user will only see the records of the company he is connected
to (or records without a company). (It is still editable by the user if needed).
For that, put this information in the user context, to allow having different
configurations on different browser tabs. Instead of having domains like
['|',
('company_id', '=', False),
('company_id', 'child_of', user.company_id.id)]
you'll have something like
['|',
('company_id', '=', False),
('company_id', 'in', company_ids)]
Note that the 'company_ids' is a value that is passed in the evaluation
context on the record rule, as we already have user, or time.
company_ids is a list of the ids of all the enabled companies in the
user's context.

3/ Out of the generic improvements brought by this task, this will illustrate
issues that could exist since several versions. For example, it should not be
possible to create a scrap order for the company A with a package of the company
B, or it should not be possible to create an invoice on the company A with
payment terms from the company B. Before the version 12.0, it was easy to
encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side
effect of the fact that the SUPERUSER_ID has become an inactive user was to
make it more difficult to introduce mismatch on the records, but haven't solved
the issue, as it was still possible to do it with parent companies
configuration. Some of these issues have been fixed in this commit, but all the
business flows should be re-tested to check if an ir.rule should be introduced
(eg: a multi company rule for stock.quand.package), if the company of a record
is correctly transfered to another record created from the first record (eg:
From a SO, create an invoice and a payment, the company of the sales order
should be transfered on the invoice and the payment, even if the company of the
sales order is A and I'm logged into the company B with the company A enabled.

4/ Currently, if I click on a button on a notification email (example 'View
Task'), I face a traceback if I'm not logged into the company of the record.
Now, if you click on a button and if you have access to the record, the correct
company will be automatically set.

5/ If I display a kanban view with several records from several companies (and
an image), all the images should be displayed.

6/ Currently if you copy paste an url, this will crash if you're not in the
correct company. This won't be fixed because it's quite impossible to do it in
a clean way. This task brings a workaround. Copy/Paste -> Traceback -> Log into
the correct company, re-copy/paste -> Ok.

7/ 2 property methods have been added on the environment to retrieve the company
on which the user is logged in and the companies the user enabled, on a specific
tab.
That way, when creating a record, instead of doing
default=lambda self: self.env.user.company_id
do
default=lambda self: self.env.company_id
On the other hand, to retrieve the enabled companies, do
companies = self.env.company_ids

8/ Modify the Company Switcher widget to allow to log into another company
WITHOUT writing on the res.users (and thus bringing cache invalidation issues
and so on). Also allow to enable several companies and see records from several
companies, and independantly of the other browser's tabs.

9/ When focusing on a tab, save the current company configuration on the local
storage. That way, when doing 'CTRL+T' or a middle click, the context is
propagated to the new tab.

10/ Improve the error message in case of multi company access errors. Now, when
the user is in debug mode, display the related names of the records and the name
of the user who brings the issue.

11/ Remove the context erasing when writing on a res.users
This is probably coming from the migration to new API of the base module.
The context was not propagated at this moment, which was a common mistake at
that time. When migrating the module, probably by using the 'black box' method,
as the context was not propagated, it was erased on the new version. This is
now an issue because the context (i.e. the enabled companies) was erased when
writing on a res.users, leading to tracebacks.
See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624

12/ Fix the crash manager on redirect warnings. The issue is the following
- Create an invoice on a company without a configured CoA.
- Set a partner
- On the onchange_partner_id, a redirect warning is raised to propose you
to configure a CoA
- Click on 'Go to the configuration panel'
- A generic warning says something like 'Do you want to discard your changes?'
- Click on yes, the page refreshes, but not on the redirect action.
Now, set correctly the action on the hash, and reload instead. The breadcrumb is
lost for example, but you reach the correct action at least.

13/ Introduce a res.group to enable/disable the multi company per tab
feature.

14/ To help the users to know which tab is in which company, add the
possibility to have a favicon per company. When creating a company,
the classical 'O' icon is colored by default in a random color.

15/ Remove the company switcher on the frontend. This was mainly there
to allow a user to swicth to the company linked to the website.
This behavior is now transparent to the user. If the website A is
activated, then the company set on the context is the company of the
website.

16/ Deprecated the _company_default_get method on the res.company
model. Remove the method _get_company on the res.users model.

17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval
context. You can now use those variables on domains in the views to
access directly to the activated company.ies on the current tab.

TaskID: 1960971

closes odoo/odoo#32341

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-13 08:57:49 +00:00
Aurélien Warnon 326dabce09 [IMP] product,(website_)sale: Product configurator naming/cleanup
Targets commit d3530eb07e

Purpose
=======

[Follow up AL review]
Code cleanup and some improved models naming for the product configurator feature (see targeted commit).
Mostly changes the "product.attribute" related models.

Updated models:

- "product.product.attribute.value" to "product.template.attribute.value"
- "product.attribute.filter.line" to "product.template.attribute.exclusion"
- "product.attribute.line" to "product.template.attribute.line"

Updated fields:

- [sale_order_line in sale/sale.py] "product_custom_variant_values" to "product_custom_attribute_value_ids"
- [product_template_attribute_value in product/product_attribute.py] excluded_for is now a o2m instead of a m2m
- [product.attribute in sale/product_product.py] "create_variant" field is now a Selection with "no_variant" (old false), "always" (old true), "dynamic" (new value)
- [product in product/product.py] "product_attribute_value_ids" to "product_template_attribute_value_ids"
2018-09-26 15:08:18 +02:00
Aurélien Warnon 856c2e9008 [IMP] product,(website_)sale: Move product options configurator into sale module
Task #1871557

Purpose
=======

- Configure a product from a sales order as easily as in the ecommerce
  The backend uses the same template as the frontend to configure a products and its options

- Display optionnal products of optionnal products in the "sale options" section

- Allow adding exlusions to some combinations of the product and/or
  to some combinations of the optionnal and accessory products

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

PHASE I

1. Improve the "Add to cart" with optional products

- When you add an option to cart, move the product to the cart & show the options of this option
- Don't open the option wizard if no option available (in case this module becomes generic,
  it's better to skip this step when it's not needed)
- Display the options right under their related product in the cart

2. Do not allow to add the product as an optional product for itself
Why ?
- No functional sense
- Creates issues in the add to cart wizard

3. Exclude some attribute combinations within the product or with related options and accessory products

- Rename VARIANT PRICES button -> CONFIGURE VARIANTS
- When you click this button and select a value, open form view rather than inline edition
- Form view of variant values:
	- Attribute
	- Value
	- HTML Color Index
	- Attribute Price Extra
	- Not Compatible with: o2m tab with 2 fields: Product AND Attribute Value (of this product)
	  [m2m tag selection]
	- in any new line, autocomplete the current product by default
	- Tooltip: A list of product and attribute values that you want to exclude for
          this product's attribue value. Also applies on optionnal and accessory products.

4. New option to configure a product in a sales order line

- This option is only visible if the corresponding option is activated in the sales settings
- It opens a wizard to select a product template, configure related attribute values
  and select optional products (based on frontend view)
- Attributes not compatible with other selected attributes should not be selectable
- Must work like in the frontend
2018-09-25 18:39:32 +02:00
Christophe Simonis 86ff929ad6 [MERGE] forward port branch saas-11.4 up to 1199451606 2018-09-10 17:06:18 +02:00
Yannick Tivisse 4587816198 Revert "[IMP] base: Remove unused module categories"
This reverts commit 382fbd3520.
2018-09-10 14:23:43 +02:00
Xavier Morel 568dd8f4c6 [FIX] product, uom: add access rights to system group 2018-08-23 21:38:57 +02:00
Yannick Tivisse 382fbd3520 [IMP] base: Remove unused module categories
The categories other extra rigths and hidden are not used now.
2018-04-26 15:13:38 +02:00
XavierDo 6a378e3839 [IMP] product: move uom in a new addon
Moves UoM models, test and data to a new addon in
order to be able to use uom without product.
A simple example is be to be able to use UoM for
timesheets.

This commit only move code, and adapt xml ids
without chaging any feature or functionnal
behavior.
Note: 'product' module now depends on new
'uom' module.
2018-02-26 14:27:26 +01:00
mdi-odoo 33a413eb29 [IMP] sale*: Improve the settings form view 2016-12-30 17:05:08 +01:00
Thibault Delavallée 1b4f96cf40 [MIG][IMP] product: migrate and clean product pricelist report 2016-08-01 15:05:33 +02:00
Yannick Tivisse 9e57185449 [IMP] base,sales_team: Move res_groups and menuitems to sales_team
Purpose:
Having the res_group defined in base and sales_team auto installed
with mail doens't make sense.

- Move the empty res_config class and the related view from
  base_setup to sales_team (base_setup only contains the 'General Settings'
  model and views
- Move the 'sale' related content from product to sale module (Access rights,
  menuitems,...)
- Set sales_team at autoinstall False. The module is installed when needed by
  crm or sale for example
- Set sales_team as a dependency of voip. (Access rights defined for configuration
  purpose)
- Set sales_team ad a dependency of subscription (Access rights issue too)

[FIX] account: move some ir.model.access to sale module
[FIX] payment: Move some ir.rule to website_sale
[FIX] stock: move some ir.model.access rule to sale_stock
[FIX] project: Move some ir.model.access rules to crm_project_issue
[FIX] mrp: Move some ir.model.access rules to sale_mrp
[FIX] calendar: move some ir.model.access rules to crm

Rename xmlids accordingly. Example: 'base.group_sale_manager' becomes
sales_team.group_sale_manager.

[ADD] sales_team: See own documents => See only his sales team
Moved the "User: Own Leads Only", "User: All Leads" and "Manager" groups from sale and crm
into sales_team module. Add the record rules so that user can see only his Own Sales Team
if "See Own Leads" is sales right and can see all sales teams if he is having sales rights
of "See All Leads" or manager.
2016-06-09 16:05:25 +02:00
Yannick Tivisse ccdb5cbfc0 Revert "[IMP] base,sales_team: Move res_groups and menuitems to sales_team"
This branch need more testing instead of doing 10 fixes. A lot of issues are occuring
when installing modules in different orders.

This reverts commit fa6e415cdb.
2016-06-06 17:26:30 +02:00
Yannick Tivisse fa6e415cdb [IMP] base,sales_team: Move res_groups and menuitems to sales_team
Purpose:
Having the res_group defined in base and sales_team auto installed
with mail doens't make sense.

- Move the empty res_config class and the related view from
  base_setup to sales_team (base_setup only contains the 'General Settings'
  model and views
- Move the 'sale' related content from product to sale module (Access rights,
  menuitems,...)
- Set sales_team at autoinstall False. The module is installed when needed by
  crm or sale for example
- Set sales_team as a dependency of voip. (Access rights defined for configuration
  purpose)
- Set sales_team ad a dependency of subscription (Access rights issue too)

Rename xmlids accordingly. Example: 'base.group_sale_manager' becomes
sales_team.group_sale_manager.
2016-06-06 15:46:52 +02:00
Srushti Patel 516ee0fda2 [REM] product_uos: remove module product_uos it is no longer supported (group_uom manage this by default) 2016-05-27 10:13:22 +02:00
qdp-odoo e4dc50bf58 [IMP] pricelists improvements. Was PR #8228 2015-08-31 16:57:32 +02:00
Yannick Tivisse 3befe66f43 [IMP] product : Improve variant usability
- Add an option in the General Settings : Use product variant.
- If this option is disabled : don't show any reference to variants
- When going on the product template view, and clinking on the stat button under the tab Variants,
  the form view should display only the information related to the variant
- Fields moves from product_template to product_product :  weight, volume, cost price,
- DO NOT display these fields on the product_template if there are more than 1 variants.
- In product variant view, set some fields readonly and add a link to edit it from Template.
2015-07-17 16:22:27 +02:00
Fabien Pinckaers 3f108c4fdf [IMP] removing complex and unuseful concepts 2015-07-02 21:27:42 -07:00
Christophe Simonis 7f2de62378 [MERGE] forward port of branch 8.0 up to 33a8989 2015-02-11 17:25:33 +01:00
Denis Ledoux 769c62ef27 [MERGE] forward port of branch saas-3 up to f92b2f8 2015-02-06 14:19:30 +01:00
Denis Ledoux f92b2f8d4d [MERGE] forward port of branch 7.0 up to 0b7db55 2015-02-06 14:02:43 +01:00
Jérome Maes 275234c067 [IMP] base_setup, product : add res.config options (in base_setup and product) to active access rules for res.partner and product.template.
The rules 'base.res_partner_rule' and 'product.product_comp_rule' are now inactive by default. This will make these models visible for all companies defined in the database, ignoring the configuration of companies set on product and partners.
2015-02-05 13:25:44 +01:00
David Monjoie d7f30de9ae [FIX] product: moved pricelist_item ACL from stock to product
Otherwise if we install sale without stock, we can create pricelist and pricelist versions, but not pricelist items.
Fix for issue 626985
2015-02-04 16:17:36 +01:00
Olivier Dony dcc74a00f8 [FIX] product, sale: access rights for product.price.history
Granting read-only access to Sales/Accounting Users is useless
as all employees already have it - removed. On the other hand
Sales Managers need write access to it in order to create
products, and they need it even when `sale` is not installed,
e.g. with `account` only.
Moved this access right to `product` module. The Sales
Manager group is defined in `base`, so that works.
2014-12-16 16:16:38 +01:00
Xavier Morel 6014d44b2b [IMP] add read access to all users for product.pricelist.type
In new API, selection field value is checked (against the selection's possible
values) at both read and write. For pricelist.type this requires read access
to product.pricelist.type.
2014-07-11 13:32:46 +02:00
Christophe Matthieu 43977deb71 [IMP] product: refactoring of product variant. The main view became the view of product template and the product product (or product variant) are created with the variant values combinaison. Bom is splitted into bom and bom line and can use the variant combinaison. 2014-05-27 09:42:52 +02:00
Quentin (OpenERP) 7ed26f1e07 [REF] product refactoring: prices.history model renamed into product.price.history + passed 'date' as real parameter instead of contextual one in get_history_price() because it makes more sense.
bzr revid: qdp-launchpad@openerp.com-20140428153355-vbuam1hfnah7m4wp
2014-04-28 17:33:55 +02:00
Quentin (OpenERP) 205a13e2f5 [MERGE] stock_account, purchase: better usability in settings to install stock_account and manage options to use costing methods and invenotyr valuation
bzr revid: qdp-launchpad@openerp.com-20140415112915-k8ba71ddo1vgu0tm
2014-04-15 13:29:15 +02:00
Quentin (OpenERP) 753f7541db [MERGE] main trunk
bzr revid: qdp-launchpad@openerp.com-20140203173000-mk092iw2wz3y0e3e
2014-02-03 18:30:00 +01:00
Thibault Delavallée b3fa81982b [IMP] product: group_product_mono is default
bzr revid: tde@openerp.com-20140121122120-r2m1r927ne2r12mi
2014-01-21 13:21:20 +01:00
Thibault Delavallée b3a4778f26 [IMP] product variant: removed override of fields_view_get and use a "one group or another"
behavior for product variant. Users are either in group_product_mono or
group_product_variant, allowing to tune the form view according to the
group the user belongs to.
product: added group_product_mono group
sale: added set_group_product_variant method that adds or remove the
group_product_mono according to the group_product_variant being unchecked
or checked.
product: updated form view accordingly

bzr revid: tde@openerp.com-20140121105046-zkbs778upjg0lpyr
2014-01-21 11:50:46 +01:00
Darshan Kalola (OpenERP) a9e87b56ce [MERGE]with lp:~openerp-dev/openobject-addons/trunk-website-al.
bzr revid: dka@tinyerp.com-20140108093659-c9it34gll0ipcll2
2014-01-08 15:06:59 +05:30
Quentin (OpenERP) 1af2ac6f9c [FIX] fixed warnings in runbot
bzr revid: qdp-launchpad@openerp.com-20131211154840-u2nk7ztggcgewm7y
2013-12-11 16:48:40 +01:00
Fabien Pinckaers 2fee01f084 [IMP] removed a feature nobody used for a huge speed improvement (4 SQL Queries per search/read
bzr revid: fp@tinyerp.com-20131202084517-80d1vdwfwpbdsqdn
2013-12-02 09:45:17 +01:00
Amit Bhavsar (Open ERP) 3c966202ef [imp] improve a typo.
bzr revid: amb@tinyerp.com-20131129052157-snnwkddyb6evdm6w
2013-11-29 10:51:57 +05:30
Amit Bhavsar (Open ERP) 82d6ca2363 [imp] add help,typo,improve search and change menu sequence.
bzr revid: amb@tinyerp.com-20131128062151-1614s0dmll83i5q6
2013-11-28 11:51:51 +05:30
Christophe Matthieu 2fab26a2d2 [IMP] point_of_sale, product: change model 'pos.category' of the pos into product.public.category in product. product.public.category is used for eg by pos and website_sale. Add some demo data for this category. Add a domain in pos 'model.js' to select non empty categories
bzr revid: chm@openerp.com-20130828151658-3isgyl93c3hwp1pc
2013-08-28 17:16:58 +02:00
Christophe Matthieu d37aebb7f0 [IMP] website: security and public access
bzr revid: chm@openerp.com-20130802035504-lokijwh57e0q3w6a
2013-08-02 05:55:04 +02:00
Cedric Snauwaert 2e52316b89 [FIX]product: rename product_variant group since it is not used in v7.0 but still in trunk and users don't understand why nothing happen when ticking the option
bzr revid: csn@openerp.com-20130305100120-h59kuj2twmzf6aos
2013-03-05 11:01:20 +01:00
Olivier Dony 3fe6987ce7 [MERGE] Harmonization of noupdate flag on security XML data, courtesy of Alexis de Lattre (Akretion)
ir.rule records are in noupdate data blocks to let the admin
alter them without fear of them being reset at next update.
Other records such as groups are in normal mode, so they
can be updated whenever necessary

bzr revid: odo@openerp.com-20121218232001-t425t4hi7qbmsip2
2012-12-19 00:20:01 +01:00
Arnaud Pineux 6b74785450 [FIX] product category access
lp bug: https://launchpad.net/bugs/1086903 fixed

bzr revid: api@openerp.com-20121212125912-bnzhcaa1mwq153vt
2012-12-12 13:59:12 +01:00