24 Commits
Author SHA1 Message Date
Paweł Fertyk 6f39d0ee5f [FIX] mrp_account: fix BoM creation test without demo data
The test needs to set `product_id` field in order to check user's
access. However, the field is not visible without enabling product
variants, which makes the test fail in an environment with no demo data.
This commit fixes the issue by adding the MRP manager to the
'product.group_product_variant' group.

The issue was introduced in #162107 .

Related build error:

https://runbot.odoo.com/web#id=61998&cids=1&menu_id=405&action=573&model=runbot.build.error&view_type=form

closes odoo/odoo#162873

X-original-commit: 00b317b114cd139a4ea03a1e660e1b549f829130
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Pawel Fertyk (pafe) <pafe@odoo.com>
2024-04-24 09:28:16 +00:00
Paweł Fertyk 0217b88e48 [FIX] mrp_account: fix BoM creation for non-accounting users
Currently, recalculating `analytic_distribution` requires access to
`account.analytic.distribution.model`. This breaks BoM creation for
non-accounting users (e.g. MRP managers). This commit fixes the issue by
using `sudo()._get_distribution`.

closes odoo/odoo#162184

X-original-commit: 3872e9365e4d8cc100a6022e934292f6f6802162
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Pawel Fertyk (pafe) <pafe@odoo.com>
2024-04-18 07:28:29 +00:00
Paweł Fertyk 1bca12c443 [FIX] point_of_sale: fix product creation for non-sales users
After `_check_combo_inclusion` was added, it broke product creation for
users without sales rights (e.g. stock managers). This commit fixes
the issue by using `sudo().search`.

closes odoo/odoo#161313

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-04-12 09:53:18 +00:00
Paweł Fertyk 3e169c0c69 [FIX] mrp: fix negative values in subcontracting BoM Overview
A subcontracting BoM sometimes shows negative values in Overview, if
components are available in subcontractor's location.

closes odoo/odoo#144702

Task: 3607854
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-03-13 09:14:08 +00:00
Paweł Fertyk fae2924f77 [IMP] stock: add spacing between return slip barcodes
Original requirement:

On the return slip, the 2 barcodes are too close to each other.
So, it's too easy to scan the wrong barcode. We should add a bit
more space between the 2 barcodes (For the demo, I had to take
another document for managing the scanning)

closes odoo/odoo#142916

Signed-off-by: Steve Van Essche <svs@odoo.com>
2023-11-23 08:52:00 +00:00
Paweł Fertyk eedb2557c7 [FIX] stock: remove duplicated should_replenish field in scrap view
https://drive.google.com/file/d/1LRif1iOjiS6aLx6QdBOs3Kc7c15lyNrt/view

closes odoo/odoo#140149

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-10-27 21:36:55 +00:00
Paweł Fertyk d66ad74180 [FIX] product: fix duplicated barcode test
closes odoo/odoo#138217

Task: 3290154
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-10 18:31:05 +00:00
Paweł Fertyk c31c6f5de5 [IMP] stock: append "copy" to duplicated resources
Also, "Short Name" for duplicated warehouses was set to "COPY", because
of the 5 char limit which doesn't allow appending " (copy)" to the
original value.

closes odoo/odoo#122511

Task: 3290154
Related: odoo/upgrade#5138
Related: odoo/enterprise#42541
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-09-28 10:22:03 +00:00
Paweł Fertyk 26922c8d1d [IMP] purchase: add vendor search to products
Task: 3290154
Part-of: odoo/odoo#122511
2023-09-28 10:22:03 +00:00
Paweł Fertyk c4dc84ffca [IMP] stock: allow changing operation type in draft
Rationale: if our users want to do a pick-pack-ship manually, they were
unable to duplicate pickings by just changing the operation type.

Task: 3290154
Related task: 3010731

Part-of: odoo/odoo#122511
2023-09-28 10:22:03 +00:00
Paweł Fertyk d747d66646 [IMP] purchase_requisition: improve "Alternative Warning" popup
Changes applied also to "Alternatives" tab in RfQ.

Task: 3290154
Part-of: odoo/odoo#122511
2023-09-28 10:22:03 +00:00
Paweł Fertyk b2638565de [IMP] product: make barcode unique only within a company
Some clients use the same barcode for products in different companies,
with different configuration. It is inconvenient for those users to have
to ensure the uniqueness of barcodes across all companies.

This commit will allow products to have duplicated barcodes, as long as
they are assigned to different companies. Products without a company are
treated as belonging to all companies. Product variants require unique barcodes.

The validation needs to be triggered both on barcode and company_id, so
product template (where company_id is stored) was also adjusted.

NOTE: when a barcode is duplicated in 2 companies, an attempt to remove
both the company and the barcode from a product will result in an
error, despite the fact that a product without a company and a barcode
would have a correct configuration. This happens because the barcode
uniqueness check is performed before changing the barcode, but after
changing the company. A workaround for this problem is to remove the
barcode first, save the product, and remove the company.

Task: 3290154
Related task: 3270732

Related: odoo/enterprise#42541
Part-of: odoo/odoo#122511
2023-09-28 10:22:03 +00:00
Paweł Fertyk 26c9495e6f [IMP] stock_picking_batch: use default tree view for transfer list
List of transfers shown in the Batch Transfer form was using a simplified
view, without proper coloring etc. That list was removed, so now the
default list of transfers is used and the view is more consistent.

The change is applied both in the Batch Transfers form (in the "Transfers" tab),
and in the popup visible after clicking "Add a line" button.

Task: 3290154
Related: odoo/upgrade#5138
Part-of: odoo/odoo#122511
2023-09-28 10:22:02 +00:00
Paweł Fertyk db26958ae4 [IMP] purchase_requisition: put "Vendor" first in Blanket Order
Task: 3290154
Part-of: odoo/odoo#122511
2023-09-28 10:22:02 +00:00
Paweł Fertyk f283020298 [IMP] stock: move "Lot/Serial Number" before "From"
The reason is to make it consistent with other places where we display locations,
where lot/serial number is placed next to the source location. Initial requirement
was to move lot/serial number in between "From" and "To", but PO decided to move
it before "From", as it should be more convenient for users.

Task: 3290154
Part-of: odoo/odoo#122511
2023-09-28 10:22:02 +00:00
Paweł Fertyk f55c26948d [IMP] stock: add avatar widget for "Responsible" in picking form
Task: 3290154
Part-of: odoo/odoo#122511
2023-09-28 10:22:02 +00:00
Paweł Fertyk 716ddd97da [IMP] stock_picking_batch: add batch field to picking form
Task: 3290154
Part-of: odoo/odoo#122511
2023-09-28 10:22:02 +00:00
Paweł Fertyk f89dd00a4a [IMP] stock_picking_batch: remove link to batch from picking list
Batch ID is still visible, but it is no longer clickable.

Task: 3290154
Part-of: odoo/odoo#122511
2023-09-28 10:22:02 +00:00
Paweł Fertyk 18ebcf7ad1 [IMP] stock: remove Done and Cancelled filters in picking list
Task: 3290154
Part-of: odoo/odoo#122511
2023-09-28 10:22:02 +00:00
Paweł Fertyk 020b2ed0d9 [IMP] stock: split name in 2 lines on product label
Product's display_name can be too long and might not fit in small
labels. A decision was made to split it into default_code and actual
product name, and display both in separate lines.

Unfortunately, the logic of joining those 2 strings is embedded in the
model, so it had to be duplicated in the label.

Task: 3290154
Part-of: odoo/odoo#122511
2023-09-28 10:22:02 +00:00
Paweł Fertyk 4060f13cb0 [IMP] stock_picking_batch: change "Cancelled" status color to red
The reason is to harmonize it with cancelled transfers.

Task: 3290154
Part-of: odoo/odoo#122511
2023-09-28 10:22:02 +00:00
Paweł Fertyk 327604b499 [IMP] stock: update picking_type form layout
Moved "Reserve before scheduled date" under "Reservation Method",
as they are directly related.

Task: 3290154
Part-of: odoo/odoo#122511
2023-09-28 10:22:02 +00:00
Paweł Fertyk 7af6149a3f [FIX] mrp: add missing test for mass produce
This is a missing test for #126066 .

closes odoo/odoo#126667

Task: 3370869
X-original-commit: 1b4a0d871662670ec2a360379913d1e30feec40c
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Pawel Fertyk (pafe) <pafe@odoo.com>
2023-06-28 20:21:45 +02:00
Paweł Fertyk 357c71b768 [FIX] mrp: assign lot_id to stock moves in mass produce
Currently we skip the lot_id assignment if move.quantity_done is set,
which causes issues when using "Mass Produce" option.

closes odoo/odoo#126191

Task: 3370869
X-original-commit: 72f316a4c0ad1d443aa84051858fa6d8885b464e
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-06-23 16:35:40 +02:00