Commit Graph
74 Commits
Author SHA1 Message Date
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
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
Yannick Tivisse 4587816198 Revert "[IMP] base: Remove unused module categories"
This reverts commit 382fbd3520.
2018-09-10 14:23:43 +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
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
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
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) 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
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
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
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
Dharti Ratani (OpenERP) abf966ceb5 [IMP]Adding an option in purchase wizard to hide costing method
bzr revid: dhr@tinyerp.com-20120822121515-1r7e8ufv6ojm5cdm
2012-08-22 17:45:15 +05:30
Alexis de Lattre 5101771cd9 Harmonize the noupdate flag on security XML files :
- ir.rule objects are noupdate="1"
- all other objects are noupdate="0"

bzr revid: alexis@via.ecp.fr-20120713170838-pjsysliyt6twazrc
2012-07-13 19:08:38 +02:00
Jagdish Panchal (Open ERP) a0a009beed [IMP] Stock: add new field in res_config.py and put Product Variant group from Usability to Hidden in user form
bzr revid: jap@tinyerp.com-20120426091817-otqj1iwr2g752jzh
2012-04-26 14:48:17 +05:30
Jagdish Panchal (Open ERP) e54af9838e [IMP] Product,procurement: rename UOM to Unit of Measure everywhere
bzr revid: jap@tinyerp.com-20120425112950-vkru89laterdbx5m
2012-04-25 16:59:50 +05:30
Raphael Collet 416375ba2b [IMP] product,mrp: move group_mrp_properties into module product, to add use on sale order lines
bzr revid: rco@openerp.com-20120404134731-3syvingajqrxgysg
2012-04-04 15:47:31 +02:00
Raphael Collet ba1454149c [IMP] groups: remove auto-inclusion of admin in groups, and make the inclusion explicit in groups
bzr revid: rco@openerp.com-20120404090830-nteimn2kvz8nkk7h
2012-04-04 11:08:30 +02:00
Raphael Collet bc6aa2adcc [IMP] product: move group_uos into category 'hidden'
bzr revid: rco@openerp.com-20120403101154-zcda9iui7zve4pzh
2012-04-03 12:11:54 +02:00
Raphael Collet 7205e2e096 [FIX] stock: misconfigured xml ids
bzr revid: rco@openerp.com-20120322152755-i9ihcm3iac3eyne0
2012-03-22 16:27:55 +01:00
Raphael Collet 1278fdb069 [IMP] stock.config: rename usability groups as part of module stock
bzr revid: rco@openerp.com-20120322150511-luwd99vtm4v4pmdr
2012-03-22 16:05:11 +01:00
Raphael Collet 182f22fc75 [MERGE] branch trunk-v62_warehouse_config-tpa (new stock config wizard)
bzr revid: rco@openerp.com-20120322144357-2k9xpu7ct1i13dl4
2012-03-22 15:43:57 +01:00
Raphael Collet c59d3bea1f [MERGE] parent branch trunk-v62_config
bzr revid: rco@openerp.com-20120322124403-n10zeae7nxld8sy8
2012-03-22 13:44:03 +01:00
Raphael Collet ff05f5dd8f [IMP] product: rename xml ids of new usability groups
bzr revid: rco@openerp.com-20120321100144-h5f6jjuz45p2qi6r
2012-03-21 11:01:44 +01:00
Turkesh Patel (Open ERP) 5be3d4c4e9 [MRG] merge with lp:~openerp-dev/openobject-addons/trunk-v62_config_product-uco
bzr revid: tpa@tinyerp.com-20120313103015-p37q8zu28xlujnd1
2012-03-13 16:00:15 +05:30
Turkesh Patel (Open ERP) 81656c3e7e [MRG] merge with lp:~openerp-dev/openobject-addons/trunk-v62_config_product-uco
bzr revid: tpa@tinyerp.com-20120313093252-y1hduni2ptvjanb9
2012-03-13 15:02:52 +05:30
Ujjvala Collins (OpenERP) 65d466b4fe [ADD]: Added remaining groups for suppliers and stock packaging.
bzr revid: uco@tinyerp.com-20120312105655-gzs4nci80gzlsnld
2012-03-12 16:26:55 +05:30
Ujjvala Collins (OpenERP) e2c8783f1b [ADD]: Added common configuration for UoM per product group.
bzr revid: uco@tinyerp.com-20120312102702-xp63smj3qcn1eu31
2012-03-12 15:57:02 +05:30
Turkesh Patel (Open ERP) 523a765b3b [ADD] add groups in product
bzr revid: tpa@tinyerp.com-20120306124425-zlw6c0eqayf48zxr
2012-03-06 18:14:25 +05:30
Turkesh Patel (Open ERP) d4ccb87316 [ADD] add new purchase configuration
bzr revid: tpa@tinyerp.com-20120302124357-j26l817ms3s1xn5c
2012-03-02 18:13:57 +05:30
Raphael Collet 70bb0dd810 [IMP] base_contact, event, knowledge, product, project, sale_mrp: avoid redefinition of sale groups
bzr revid: rco@openerp.com-20111212145128-zx64v0uwf8n0lwyu
2011-12-12 15:51:28 +01:00
Raphael Collet 5aa61b26e8 [IMP] product, project, purchase, purchase_requisition: add group categories
bzr revid: rco@openerp.com-20111212140528-g8oxverkipswionf
2011-12-12 15:05:28 +01:00
ron@tinyerp.com 10871711fe [IMP]Improved rule(Access parent and child both company) product_template, product_pricelist,
product_pricelist_item, product_pricelist_version, 
stock_production_lot, stock_production_lot_revision

bzr revid: ron@tinyerp.com-20110915111906-kt58lylqutzkod21
2011-09-15 16:49:06 +05:30
ron@tinyerp.com e9913a2ce5 [IMP]product:Improvements into rules
bzr revid: ron@tinyerp.com-20110609122630-yx0xx6tc7pasqr2j
2011-06-09 17:56:30 +05:30
ron@tinyerp.com 035922f429 [FIX]mrp,stock,stock_location,stock_planning,product:Add company rules
lp bug: https://launchpad.net/bugs/788139 fixed

bzr revid: ron@tinyerp.com-20110608124833-dg77wajhwl41uhal
2011-06-08 18:18:33 +05:30