Commit Graph
55 Commits
Author SHA1 Message Date
Victor Feyens fba6ea5a47 [IMP] *: do not force admins to be app admins
For bugfix purposes, app administration groups have been given to
(implied by) the "Settings" group because without those rights,
opening/saving the settings crashed.

1) Do not load hidden view content

This commit uses the conditional inheritance of views
(depending on user groups) to avoid loading unnecessary view
& record content client-side.

This improves performance for admins without the specific application
admin rights, but also fixes the main bugfix problem,
caused by the webclient querying name_get for the records in relational
fields content.

Example:

sale_management adds a res.config.settings field to specify
the default sale.order.template for the current company.

If a 'Settings' user without 'sale.group_sale_manager' opens the
settings, he won't see this setting, but if a default template is
specified for the current company, the webclient will still request
the name_get of this template to the server, because the field
was present in the view, only hidden with a groups attribute.

With this commit change in sale, the field won't be in the view unless
you have the Sale manager group, avoiding the error/traceback/bug.

2) Remove implied application administration groups

Do not force the specific application groups on all 'Settings' user,
they globally do not need those rights, and if they need it, they
can add it to their account themselves.

3) Add a test to make sure settings user are able to manage settings.

4) Enforce 'settings' -> 'access rights' -> 'internal user' groups

As the previous test highlighted some 'false positives' because
it considered a settings user unable to read `crm.team`
and `stock.warehouse` records, we also took the opportunity to enforce
the fact that 'Settings' & 'Access rights' users must be internal users.

It makes no sense for a portal/public user to have access to the
settings, and didn't work anyway.

Part-of: odoo/odoo#91909
2022-06-23 23:48:29 +02:00
JF Aubert dbd09f16a2 [IMP] mrp,mrp_workorder: workorder scheduling revamp
Currently MRP only allows sequential scheduling of work orders.

This commit allows to specify the dependencies for work orders to be
scheduled in parallel or in a complex diagram.

By enabling the feature in the settings and at the bom level,
you can specify dependencies between operations:
on the operation form, select the operations on which the
current one depends.

The dependencies will be reflected in work orders during planning.

The workorders Gantt view has been adapted for you to visualize
and manipulate the dependencies.

Please note:
- work orders without predecessors will be started first
- they can all be done in parallel
- when all work orders of this step are finished, their successors
  will start
- and so on, step by step

Also, with the feature activated at the bom level and no dependency,
the parallel scheme will be applied (all operations at first step).

Finally, without activation at the bom level, the dependencies will
be created in order to satisfy the current sequential model.

Task: 2691328
Part-of: odoo/odoo#87131
2022-06-03 16:40:08 +02:00
Adrien Minet 90cf777a4d [FIX] mrp: admin rights added to admin/settings group
How to reproduce the bug:

- Install the mrp app
- Enable debug mode
- Go to Settings -> Groups
- Add Marc Demo to Administration/Settings group
- Log in to Marc Demo
- Click on the Settings App

Bug:

If, as a basic user, you are added to the Administration/Settings group,
you won't be able to open the Settings module. If you look closer at this group,
you will see that the MRP administration group is not inherited when you install the
module.

closes odoo/odoo#83118

Opw: 2697030
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-02-16 09:40:07 +00:00
Tiffany Chang (tic) 420db386d3 [IMP] mrp,stock: expand reception report to MOs
Allow use of reception report for MOs. Same behavior is expected as with
(non-outgoing) pickings. With exception that procurement group linkage
should be included when assigning.

Original Reception Report Task: 2500844
Follow Up Reception Report Task: 2632884

Task: 2662730
Part-of: odoo/odoo#79627
2022-01-20 12:30:04 +00:00
Tiffany Chang (tic) 1e2c03a47d [FIX] mrp: lock MOs by default
Previous specification of making MOs unlocked by default was confusing
for users and made it too easy to accidentally change the qty to consume
rather than the consumed amount. This fix makes it so MOs are now locked
by default and will be unlocked/locked (including existing draft /
confirmed / in progress MOs) automatically when setting is changed.
Previous setting (Lock Quantities To Consume) has been repurposed for
this. When setting is active, no lock/unlock button will be visible to
match the updated setting description (i.e. non-done MOs can
never be locked).

Task: 2518523
ENT PR (only fixes test): odoo/enterprise#19732
Upgrade PR: odoo/upgrade#2655
2021-07-26 11:57:50 +00:00
Tiffany Chang (tic) 48672703aa [REF] mrp: update MO lock/unlock settings
This commit updates 4 features related to a MO being locked/unlocked.

1. Manufacturing orders are by default unlocked. A new configuration
setting has been added so users can set the default to be locked.
This setting only applies to new manufacturing orders after the setting
has been changed.

2. A MO now shows the same button options regardless if it is
locked/unlocked ('scrap', 'cancel', 'unreserve')

3. Workers can always change "Consumed Quantities"/"Produced" when
clicking on a component/finished product line unless state=Done and MO
is_locked. This includes adding new components/finished products.

4. Workers can now change "To Consume" quantity when clicking on a
component line, unlocked, and not in states 'Done' or 'Cancel'.

This is part of specification 6-Lock/Unlock of overall Editing in MO
form and backorders task.

Task: 2241471
2020-06-15 16:59:41 +02:00
Simon Lejeune c660770ebd [REF] mrp: remove routing model
Set the operations directly on the Bill of Material.
Duplicate the demo data where a routing was shared.
Adapt the tests.

Remove the following feature:
    - set the same routing on parent and kit child bom
    - when planning, if the component of the kit have the same operation
      than a component of the parent bom, merge these operations

task-2241471
2020-06-15 16:59:40 +02: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 96406dc2a9 [REF] mrp: multi company
Ensure proper domains are applied and enforced on relation fields thanks
to the `check_company` attributes.

Make sure unbuild have proper sequence for each companies.

The produce wizard and workorders company is the one of the production.
The BoM line company_id is the one of its bom_id.
Added some tests.

task-1985992
2019-09-03 15:05:03 +00:00
Christophe Simonis 8dd5a85267 [MERGE] forward port branch saas-12.3 up to 60e71302a3 2019-05-13 15:26:12 +02: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
Arnold Moyaux 6f25cf1aa7 [REF] mrp: add groups for byproducts
Since mrp_byproduct is in mrp. We want to keep the byproduct as an
additional feature. So this commit add a group and hide byproducts
fields in views.
2019-04-12 08:46:07 +00:00
jbm-odoo ec07e72845 [IMP] base,*: Reorganize access rights groups
Purpose
=======

Access group terminology is missleading. Yous have to be manager to administrate
an application. This task consists to rename groups to be understandable for everyone.

Groups should be reorganised on the users form to be more explicit.

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

1/ Rename 'Manager' to 'Administrator' in users groups.
2/ Define a hierarchy on access groups by using the category_id in the manifests
   A category 'Operations/Project' will create a category Project with a parent
   category 'Operations', and something smart is already developed (in modules/db.py)
   to avoid duplicating categories.
3/ Add a group in expenses to be able to approve expenses reports for my team.
4/ Add a group in timesheets to be able to approve timesheets for my team.
5/ Remove partially the useless crap in ir_module_category_data.xml
6/ Sort access rights groups on users form according to its parent category

closes odoo/odoo#29362

Signed-off-by: "Yannick Tivisse (yti)" <yti@odoo.com>
2019-03-05 09:08:12 +00:00
Arnold Moyaux 1efc2e9ad9 [FIX] mrp: mrp user w/h inventory right 2018-11-27 11:58:02 +00: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
Raphael Collet 2f7c03d9ca [IMP] base: add regular user admin as uid 2
User 1 simply becomes a technical user (inactive, no password).
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
Yannick Tivisse ff63f5d0a3 [IMP] base_setup: Allow the admin to modify the default user acess rights
Add a link in the general settings to access easily the default_user form view in order to modify the default access rights

The default_user manager rights declarations in all the applications have been move in a noupdate="1" definition to avoid the manual configuration overwrittings
2016-08-23 11:14:37 +02:00
Thibault Delavallée efd55ab8a5 [REF] various: rename openerp node to odoo in xml files 2016-08-10 15:48:10 +02:00
Josse Colpaert 2ddc35a530 [REF][NEWPIE] mrp: new MRP
This commit contains the core of the new MRP. It contains a whole refactoring
of the MRP application, with improved and new features, written in new API.
Among other here are the main manufacturing workflow improvements :

 - Picking type not only for pickings but also for manufacturing orders
 - Properties replaced by picking type
 - BoM can only be produced with its routing (no other)
 - Either produce without routing with only production orders, or produce with
   routing
 - By default, there is an order in the work orders (serially), but you can
   override it to be able to work in parallel
 - Time clocking on work orders and block time on work centers with reporting
   on OEE, performance, losses, ...
 - Real-time adaptation of timings on operations
 - Lots/serial numbers can be inputted like in the pickings on manufacturing
   orders.  It is also possible to input them in the work orders.
 - Material availability independent of production order state (possibility to
   start production when only part of it is there)
 - Work sheets on work orders
 - Put messages on work orders to make your workers pay attention to something
 - Full traceability link to see for each produced piece of stock, the
   consumed pieces, ...
 - Separate scrap object (a scrap is not done based on an original move
   anymore)
 - Separate unbuild system (if you want to unbuild into its original
   components)

Thanks to all people that helped during this development, notably but not
limited to Chirag A Dodiya (cod@odoo.com), Gaurav Panchal (gan@odoo.com),
Jignesh Rathod (jir@odoo.com), Mansi Trivedi (mtr@odoo.com), Pariket Trivedi
(ptr@odoo.com).
2016-07-04 16:22:37 +02:00
Yannick Tivisse 1ecba213f4 [IMP] Newly created users get all manager access right
Coming from a bug in web_settings_dashboard. Invited user didn't have any rights
when created from the dashboard, which was leading to an error.

This bug leaded to a new discussion. Better to have basic employee having user
rights for all main applications. For bigger entreprises there is an admin that
will carefully remove extra rights, if necessary. The target is small businesses,
it makes sense that every way to create a user gives the same result.

In conclusion, each new user has a full access to the applications by default

How is it implemented ?
We added an inactive default user which original access right to the groups
'base.group_user' and 'base.group_partner_manager' in base. Each
application will extend the default user's access right by adding the maximal
access right for this application.

On user creation, we will use by default the 'group_id' field from the default
user. We will in the same time remove the ugly 'default_groups_ref' key which
was passed sometimes in the context for some fields in some views, and sometimes
nothing.

So, the user can modify the access rights for the default user, but he should be
aware that removing project user access rights for a default user will prevent
a *created on the fly in a task* user will not be able to access the task.
2015-11-20 16:27:32 +01:00
Bhavik Bagdiya fede8a8cfb [IMP] mrp: usability onboarding
Various views and labelling changes
2015-03-09 21:14:28 +01:00
Richard Mathot 1ed7f42c36 [REM] mrp: removal of group_route_line_type
This group was used only to hide/display the type (normal or phantom) of BoM lines.
Adding a group to hide/display 1 field seems overkill.
2014-12-30 16:35:46 +01:00
Jamin Shah bc7aa43a26 [IMP] mrp: hide some fields on BOM, add groups to handle the displayed fields 2014-09-22 09:34:33 +02:00
Stephane Wirtel a7ff75f94a [FIX] Remove unused menu item in the mrp_securify file
bzr revid: stw@openerp.com-20131028140545-xr3mav7cb3gk45qn
2013-10-28 15:05:45 +01:00
Foram Katharotiya (OpenERP) ab83bc5d85 [IMP] add yml of mrp_users and give access rights
bzr revid: fka@tinyerp.com-20130301092805-56z3lzm8obeon6re
2013-03-01 14:58:05 +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
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 77117e046d [IMP] mrp: change xml id of usability groups
bzr revid: rco@openerp.com-20120322155244-4pbdhs0ltzf98ub1
2012-03-22 16:52:44 +01:00
Raphael Collet d23ddb0676 [IMP] mrp.config: improve code and views
bzr revid: rco@openerp.com-20120322155027-dotn5e15ca97j4ur
2012-03-22 16:50:27 +01:00
Turkesh Patel (Open ERP) 4fceaf43e0 [IMP] improved code
bzr revid: tpa@tinyerp.com-20120313090412-5p6skrd0xkkkj4kl
2012-03-13 14:34:12 +05:30
Turkesh Patel (Open ERP) 55c4d298ef [ADD] added configuration view for mrp
bzr revid: tpa@tinyerp.com-20120305105243-owrr6ks1326t1hi2
2012-03-05 16:22:43 +05:30
Raphael Collet 85b3757a60 [IMP] marketing, mrp, point_of_sale, portal: add group categories
bzr revid: rco@openerp.com-20111212135731-gdccm6nwt7ic00t4
2011-12-12 14:57:31 +01:00
ron@tinyerp.com a9519d057c [MERGE]merged lp:openobject-addons
bzr revid: ron@tinyerp.com-20110915091256-pfjf944m8asm0tga
2011-09-15 14:42:56 +05:30
Raphael Collet ba6342174e add group implications
bzr revid: rco@openerp.com-20110802130811-pkdmw43ufifz0tpj
2011-08-02 15:08:11 +02:00
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
Olivier Dony beac68b7d2 [REVERT] all: revert incorrect change of default ir.rules for multi-company
By default only records belonging to the user's company or descendant companies
should be visible. The original patch introduced visibility of records
from ancestor companies, which should be suited only for a few cases, such
as res.patner.
Original revision: 3164.24.175  sbh@tinyerp.com-20101223095216-n6psmzicdcs8is8x

lp bug: https://launchpad.net/bugs/720175 fixed

bzr revid: odo@openerp.com-20110228135754-6skiy4fb9dg54xb6
2011-02-28 14:57:54 +01:00
Sbh (OpenERP) abd780fd52 [Fix] : correct security rule of company_id
bzr revid: sbh@tinyerp.com-20101223095216-n6psmzicdcs8is8x
2010-12-23 15:22:16 +05:30
rpa (Open ERP) 6caca89f87 [IMP]: Moved reference of demo user from *_security.xml to demo file
bzr revid: rpa@tinyerp.com-20101119102525-8gyj1gmm1w29rwxu
2010-11-19 15:55:25 +05:30
aag (OpenERP) eeaa68471d [IMP] IN ALL: the demo user should be in all applications name user groups, Task id: 1771
bzr revid: aag@tinyerp.co.in-20101111131855-v07piwfyp33wlmng
2010-11-11 18:48:55 +05:30
Fabien Pinckaers 37680303df [IMP] ir.rule reviewed
bzr revid: fp@tinyerp.com-20101018092840-7a6wv2vw2s6a1a2s
2010-10-18 11:28:40 +02:00
amp (OpenERP) bd426f0346 [IMP] crm,hr_*,auction,knowledge,mrp,product,project,sale,survey : access rights improvements
bzr revid: vir@tinyerp.com-20100810134529-wyqlh5d3zabd25gv
2010-08-10 19:15:29 +05:30
uco (OpenERP) 3a1c44e7b2 [IMP] mrp,mrp_procurement: Task ID-574: Changed procurement menus again to normal positions.
bzr revid: uco@tinyerp.com-20100505095326-hmtry42zddm2ldgt
2010-05-05 15:23:26 +05:30
uco (OpenERP) a212c63fb9 [MERGE]: Merged with trunk-dev-addons1.
bzr revid: uco@tinyerp.com-20100504053032-g075eja4tww5revs
2010-05-04 11:00:32 +05:30
RVO 120ca9ba17 [MERGE] merged ir.rule refactoring into addons-trunk - please check point_of_sale
bzr revid: odo@openerp.com-20100504004716-hetrwn0vkx0zi29f
2010-05-04 01:47:16 +01:00
uco (OpenERP) 0479ed81bc [ADD] mrp, mrp_procurement: Task ID-574: Remove mrp.procurement from the MRP module. Separated mrp.procurment object into new module mrp_procurement.
bzr revid: uco@tinyerp.co.in-20100429133007-ut53koctlffi8g2a
2010-04-29 19:00:07 +05:30
Rvo (Open ERP) d4cb287b1d [IMP]:changes in ir.rule demo to support the new functionaliy of ir.rule
bzr revid: rvo@tinyerp.co.in-20100428125109-wq33afl8104gx6rf
2010-04-28 18:21:09 +05:30
GPA(OpenERP),VRA(OpenERP) d549927afc [MERGE] Merged Multicompany branch
bzr revid: jvo@tinyerp.com-20091130062207-7yxysaq03yypk2be
2009-11-30 11:52:07 +05:30