Commit Graph
10348 Commits
Author SHA1 Message Date
Andrea Grazioso (agr-odoo) 4421413567 [FIX] stock: rollback to avoid quantity update on error
- Install Inventory, base_automation
- Create an automated action on stock.quant, trigger on Update, code
raise Warning('My Warning')
- Create a transfer on a stockable product with e.g. 10 quantity on hand
e.g. Initial demand is 9
⁻ Mark as todo and Check Availability: on the transfer the reserved
quantity is not updated, but on the stock.quant it is updated to 9.
You can check availability again and nothing will happen on the
transfer, the stock.quant "Reserved" will be updated each time though.

You can update the quantity on hand to 0, and you will get
products with Reserved Quantity when Quantity in Hand is 0, and no
MO/Transfer or any other activity holding the reservation.

Adding the rollback when exception is raised

opw-2245109

closes odoo/odoo#51429

X-original-commit: 3f9ac9d3bb507eafe3c074ae817641b9d9dc1c87
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-05-18 11:13:11 +00:00
Nicolas Martinelli 7f12fe51c2 [FIX] stock: edit Planned Transfer
- Activate routing
- Go to Inventory > Deliveries > New Planned Transfer
- Add a line
  => the 'Demand' field is editable
- Save
- Edit
  => the 'Demand' field is not editable anymore

The field should be editable as long as the picking is draft.

It seems working at creation because the fields `show_operations` and
`is_locked` are not yet computed yet. It happens because `picking_id` is
not in the tree view.

We change the read-only condition: if `is_initial_demand_editable` is
`True`, the field is editable.

opw-2257498

closes odoo/odoo#51428

X-original-commit: 51d4d95b186777a740cf98803148df593a71f0b9
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-05-18 11:09:10 +00:00
Raphael Collet ea3e39506a [IMP] models: use slots for BaseModel
This restricts the attributes of a BaseModel instance to `env`, `_ids`
and `_prefetch_ids`.  This way, one can only assign fields on a record;
other assignments are programming errors.

This also reduces the memory footprint of records from 168 to 64 bytes
(-62%), and makes their instanciation faster.

closes odoo/odoo#51075

Related: odoo/enterprise#10529
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-05-18 09:51:43 +00:00
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
Yannick Tivisse 7b714a3bc7 [IMP] various: Update list views with new widgets
Purpose
=======

The following task implemented new widgets/features in the listview for better UI.
https://www.odoo.com/web#id=2195254&action=327&model=project.task&view_type=form&cids=1&menu_id=4720

The goal of the current task is to use those to upgrade our listviews

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

Below are change requests on various listviews.

Remove decoration-bf="message_needaction==True" from every listview in every module.

PRODUCT - stock.view_stock_product_template_tree (product template)

remove all decorations from <tree>
set the following decorations on 'virtual_available' and 'qty_available'
decoration-danger="virtual_available&lt;0"
decoration-warning="virtual_available==0"
also set decoration-bf on 'virtual_available'
apply the same modifications on stock.view_stock_product_tree for product variants

SUBSCRIPTION - sale_subscription.sale_subscription_view_list

remove all decorations from <tree>
'stage_id' field
set <field name="stage_id" widget="badge" decoration-info="stage_category == 'draft'" decoration-success="stage_category == 'progress'"/>
'recurring_next_date' field
set <field name="recurring_next_date" string="Next Invoice" widget="remaining_days" attrs="{'invisible': [('stage_category', '!=', 'progress')]}"/>
set decoration-bf on 'code' and 'recurring_total_incl'
move 'percentage_satisfaction' before 'recurring_total_incl'
set widget="many2one_avatar_user" on 'user_id'
add <field name="activity_ids" widget="list_activity"/> after 'user_id'

ELEARNING - website_slides.slide_channel_view_tree

set widget="many2one_avatar_user" on 'user_id'
'enroll' field
set <field name="enroll" widget="badge" decoration-success="enroll == 'public'" decoration-info="enroll == 'invite'" decoration-warning="enroll == 'payment'"/>

POS - point_of_sale.view_pos_order_tree

remove all decorations from <tree>
'state' field
make visible and move it at the end of the view
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state not in ('draft','cancel')"/>
set decoration-bf on 'name'

APPRAISAL - hr_appraisal.view_hr_appraisal_tree

'state' field
set <field name="state" widget="badge" decoration-info="state in ('new','pending')" decoration-success="state == 'done'"/>
'date_close' field
set <field name="date_close" widget="remaining_days" attrs="{'invisible': ['|',('state','=','done'),('state','=','cancel')]}"/>

PAYMENT - account.view_account_payment_tree

remove all decorations from <tree>
'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state == 'posted'"/>
move 'company_id' before 'amount'

CONTRACT - hr_contract.hr_contract_view_tree

remove all decorations from <tree>
'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state == 'close'" decoration-success="state == 'open'"/>
set widget="many2one_avatar_employee" on 'employee_id'

PAYSLIPS - hr_payroll.view_hr_payslip_tree

remove all decorations from <tree>
'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state == 'verify'" decoration-success="state in ('done','paid')"/>
set decoration-bf on 'number' and 'net_wage'
move 'company_id' before 'basic_wage'
set widget="many2one_avatar_employee" on 'employee_id'

SURVEY - survey.survey_tree

'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-success="state == 'open'"/>

APPLICATION - hr_recruitment.crm_case_tree_view_job

set widget="date' on 'create_date'
set widget="priority' on 'priority'
set widget="many2one_avatar_user" on 'user_id'

TIME OFF - hr_holidays.hr_leave_view_tree

remove all decorations from <tree>
'state' field
set <field name="state" widget="badge" decoration-info="state == 'draft'" decoration-warning="state in ('confirm','validate1')" decoration-success="state == 'validate'"/>
apply the same changes in hr_holidays.hr_leave_allocation_view_tree

closes odoo/odoo#51305

Taskid: 2256589
Related: odoo/enterprise#10614
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-15 08:24:05 +00:00
Swapnesh Shah bea1613f11 [FIX] stock,stock_account: fix undefined variable and return True
Fixes #29694
Close #47204
Fix #37554

Before this commit, There was Traceback on calling this method w/o any inventories as variable `res` was not declared but Returned or Calling this methord over RPC will raise TypeError as this method does not returns amything.

In this commit, We return True at original `post_inventory` method and Declare `res` to prevent undefined variable.

closes odoo/odoo#51320

X-original-commit: cfb2f00ae2fcbe33184d76383e3b624700101a75
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-05-15 09:14:06 +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
Nicolas Martinelli a4b52411cc [FIX] stock: correct misleading tooltips
The tooltips are incorrect and lead to wrong expectations on the
behavior.

opw-2249152

closes odoo/odoo#50746

X-original-commit: bf1d83dd310983c3f3270bf7a7f5c03128fb0993
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-05-06 11:17:04 +00:00
Goffin Simon 3c2a2f7aa3 [FIX] stock: Internal note displayed in Delivery slip
Steps to reproduce the bug:

- Let's consider a consumable product P with an internal note IN in Dutch
- Create a SO with dutch partner P and confirm it
- Process the delivery and validate it
- Print the delivery slip

Bug:

The internal note IN was displayed on the delivery slip.
The internal note must never appear on a delivery slip.

opw:2227613

closes odoo/odoo#50689

X-original-commit: 4b8d9806c6ee0a85812041f25080617daa7b10f1
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-05-05 15:35:26 +00:00
Aaron Bohy 900d162809 [IMP] *: update list views
This commit adapts several views to make them use newly defined
widgets, the new decoration-xxx mechanism on fields, and to adapt
them to the new design of buttons.

Part of task 2195254
2020-05-05 10:05:12 +00:00
Nicolas Martinelli cf078da86e [FIX] stock: unreserve picking with latest scheduled date
- Create a product P with 10 units on hand
- Create a SO with 5 units, validate
- Create another SO with 5 units, validate
- Update the quantity on hand to 8

The picking linked to the first SO as 2 units unreserved, while one
would expect the unreservation on the second picking.

When unreserving, sort the move lines according to the picking scheduled
date. The latest schedule date comes first.

opw-2233331

closes odoo/odoo#49830

X-original-commit: 41c05cbfb015407dbbf7100233999ecd154267dc
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-21 08:23:30 +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
Arnold Moyaux 00114a4ee7 [FIX] stock: forecasted quantity incorrect
Usecase to reproduce:
- Install stock with demo data
- Go on drawer form view.
- The quantity forecasted and the report for forecasted quantity do not
indicate the same quantity

It happens because the quantity on forecast is wrong. It's due to the
part that select the quants. The condition wh IS NOT NULL remove all
the quants. Also using a not null on a table is probably not a good
practice.

Also complete the request is order to take quants in transit

closes odoo/odoo#49941

X-original-commit: 405522de1f97cfb7571d6096f727a4a2d03561d6
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-04-22 09:21:45 +00:00
Rémy Baranx (bar) bad0e501c0 [FIX] stock: ambiguous product_id in init query
During the upgrade of some databases to 13.0, the following traceback
was reported:

`psycopg2.errors.AmbiguousColumn: column reference "product_id" is ambiguous`

This commit fixes this issue by prefixing product_id with the table name alias 'm'.

closes odoo/odoo#49927

X-original-commit: 0e3c5d3ee1726db2641cd683a84fe59e867d4319
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-04-22 08:12:25 +00:00
Arnold Moyaux a405de0161 [IMP] stock, mrp, purchase_stock: forecast popover usability
Set the padding on the write for date. Modify the text to be consistent
with the manual and automatic orderpoint. Explains the min, max
and quantity to order mechanism.

closes odoo/odoo#48536

Task: 2161378
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-04-22 08:05:50 +00:00
Arnold Moyaux 90f067cce8 [IMP] stock, mrp, purchase_stock: allow to define vendor, bom on orderpoints
Allow to set a BoM or a vendor on an orderpoint. In this case it's
passed to the values and will be processed by _run_buy and
_run_manufacture to use them.

Task: 2161378
2020-04-22 08:04:32 +00:00
Arnold Moyaux 045416474d [IMP] stock: orderpoint fileds rename and view improvements
There is a mix between qty and quantity. Set everything to quantity

Task: 2161378
2020-04-22 08:03:36 +00:00
Arnold Moyaux db978e3609 [IMP] stock: product view usability
Route diagram directly open with a single warehouse and variant.
Move fields and group to have a cleaner view.

Task: 2161378
2020-04-22 08:03:15 +00:00
Arnold Moyaux 3f2815ab2f [IMP] stock: default min and max for orderpoint
Technicaly it's anoying to create orderpoint and explicitely
set the product_min and product_max to 0.0. If another value
should be use, it would probably not be forgotten.

Task: 2161378
2020-04-22 08:01:16 +00:00
Arnold Moyaux 712c377a0e [FIX] mrp, stock: route diagram button under routes field
Usabilty. Move the route button under the route params.
People had issue with route and didn't know that this
report exist. We hope that moving it under the route will
help user to configure their route.

Task: 2161378
2020-04-22 07:59:44 +00:00
Arnold Moyaux fc692354b6 [IMP] mrp, stock: default route on orderpoints
Set a default route on orderpoint created by the replenishment report.
First it select the first route on the product if it exists (it's
uselss since it's a preferred route on the report but it's used for
clarity). If the product has no route then it tries to guess it
with vendor pricelist or BoM on the product.

Task: 2161378
2020-04-22 07:58:04 +00:00
Arnold Moyaux 943da6df0f [IMP] stock, purchase_stock, mrp: Replenishment Report
New report to easily order missing products in each warehouse.
Orderpoint have a new type: 'manual'. Manual orderpoint are not
trigger by the scheduler but the user could create replenishment
from the report directly. The report use the forecast report in
order to detect missing quantity for today (it does not search
depending the lead time for each product warehouse due to lake
of performance). It compares missing quantity with incoming RFQ
and other ongoing orderpoint. If it still missing a new entry
for replenihsment is created (it's also automaticaly deleted if
the replenihsment has been done another way).

Task: 2161378
2020-04-22 07:52:45 +00:00
Arnold Moyaux b6fe6de9e9 [IMP] stock: orderpoint order by location
Order by location in order to have a better overview of missing product
by location

Task: 2161378
2020-04-22 07:51:50 +00:00
Arnold Moyaux e69c2c7af0 [IMP] stock: remove useless arg
_prepare_procurement_values on orderpoint never uses product_qty

Task: 2161378
2020-04-22 07:50:36 +00:00
Arnold Moyaux 35bba1a65d [IMP] stock: orderpoint respect guidelines
Task: 2161378
2020-04-22 07:50:25 +00:00
Arnold Moyaux 9ee2323c28 [REF] stock: _procure_orderpoint_confirm multi
Allow to run the execution for a subset of orderpoints

Task: 2161378
2020-04-22 07:50:13 +00:00
Arnold Moyaux 7076a86add [IMP] stock: _get_rule allows to specify route_ids
_search_rule on procurements search in a specific way in this order:
- First: route passed in the procurement values
- Second: route on product/product category
- Third: route on warehouse
- Fourth: remaining route.

However _get_rule doesn't allow to simulate the first usecase with
the route on procurement. This commit add the functionality.
(Usefull for replenishment report where a route_id could be set
on an orderpoint)

Task: 2161378
2020-04-22 07:47:16 +00:00
Arnold Moyaux 4d5060d665 [MOV] stock: stock.warehouse.orderpoint own views file
Create a file for stock.warehouse.orderpoint. It's not linked to
warehouse so it should not share the same file.

Task: 2161378
2020-04-22 07:46:23 +00:00
Goffin Simon 435e47385d [FIX] stock: Internal note displayed in Delivery slip
Steps to reproduce the bug:

- Let's consider a consumable product P with an internal note IN
- Create a SO with P and confirm it
- Process the delivery and validate it
- Print the delivery slip

Bug:

The internal note NI was displayed on the delivery slip.

Fine tuning of https://github.com/odoo/odoo/commit/038221f3180a7a8888503553dbb5eb57875ef3a6

opw:2227613

closes odoo/odoo#49860

X-original-commit: 9b6ea1cdbed02c0f2ccd3e2608e4caf12c8c24ac
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-04-21 11:56:38 +00:00
Nicolas Martinelli a834a1b235 [FIX] stock: correct qty comparison
Use `float_compare` to avoid the usual float representation comparison
errors.

opw-2215497

closes odoo/odoo#49702

X-original-commit: 500240874cd21c6950210968c8c7e8d84c1c4bee
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-17 09:27:03 +00:00
Andrea Grazioso (agr-odoo) 3101feb494 [FIX] stock: bypass permission check after settings change
Install Accounting(account_accountant), Inventory (stock)
1. Create a new user [DEMO] with the next access:
- Accounting: Advisor
- Administration: Settings
2. With the user [DEMO] , go to Accounting>Configuration>Settings
and change any value.
3. Try to save the settings.

Access error will occur "Sorry, you are not allowed to modify documents
of type 'Picking Type' (stock.picking.type)..."
This occur because when stock is installed an override in 'execute' make
the backend check for multi locations, packaging or tracking settings
and activate show_operation on stock.picking.type causing the access
error for unprivileged users
Calling the write with sudo solve the issue

opw-2233193

closes odoo/odoo#49555

X-original-commit: f560a9966dfbbacb259f0de74437743d1385d8a6
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-14 15:12:44 +00:00
Nicolas Martinelli 9640003b5c [FIX] stock: avoid crash of _get_relevant_state_among_moves
Avoid crashing if no relevant move is found.

X-original-commit: fee99ff5d3db559081240dfca4b0809dde331ce0
2020-04-14 12:00:58 +00:00
Nicolas Martinelli c54126aee5 [FIX] stock: compute quantity_done in onchange
When computing `quantity_done` in an onchange, `move.id` is a `NewId`,
not an `int`. However, the `read_group` call returns regular integers
for `move_id`.

Consequently, `rec.get(move.id, [])` is an empty list.

closes odoo/odoo#49495

X-original-commit: 2ce1ed31a9c1ec7a7467983a040e4a056f8f4e69
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-14 09:20:33 +00:00
Nicolas Martinelli 0a1ed9be1e [FIX] stock: SN generation
The generation of SN is incorrect with the following initial sequence:
`BAV023B00001S00001`.
Indeed, the sequence generated is: `BAV023B00001S`, `BAV023B00002S`.

This occurs because the same digits `00001` appear more than once.

opw-2230913

closes odoo/odoo#49408

X-original-commit: b3369bc230160d6cafec77eed0e756c6f1c576d9
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-10 12:16:26 +00:00
Nicolas Martinelli 6dc5b36739 [FIX] stock: default picking when assign S/N
- Go to Inventory > Configuration > Operation Types
- In Receipt, activate 'Show Detailed Operations'
- Go Inventory > Overview, click on 'Receipts'
- Create a picking, and in the 'Operations' tab add 5 units of a product
  tracked by unique S/N
- Click on the + sign
- Set the First SN (e.g. TEST001) and Number of SN to 5, then Assign
  Serial Numbers

Nothing appear in the Detailed Operations, and it's impossible to
validate the picking.

The stock move lines are created, but not linked with the picking.

opw-2230913

closes odoo/odoo#49383

X-original-commit: 55ffc3027d26a36fc390d5efefa2d743cdc3e09f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-10 09:58:04 +00:00
Goffin Simon 17b5476d54 [FIX] stock: Internal note displayed in Delivery slip
Steps to reproduce the bug:

- Let's consider a consumable product P with an internal note IN
- Create a SO with P and confirm it
- Print the delivery slip

Bug:

The internal note NI was displayed on the delivery slip.

opw:2227613

closes odoo/odoo#49277

X-original-commit: 038221f3180a7a8888503553dbb5eb57875ef3a6
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-04-09 08:05:01 +00:00
Krupal Oza 637a591c05 [FIX] stock: show document reference on stock moves on mobile
Before this commit, invoices do show the reference in the body of
the document, while the stock moves don't. it wasn't consistent.

After this fix, the stock move title is now displayed on mobile too.

closes odoo/odoo#49217

Task-id: 2182609
X-original-commit: 4c12aff2998c436b5bc05f119bc3d7a5f95cdfcd
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-04-08 11:20:43 +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
William Henrotin b6c629922d [FIX] stock,mrp: change procure method at cancellation
Usecase : sell a mto/manufacture product. Confirm the sale order.
Cancel the delivery and the production then
duplicate the delivery.
    - if the delivery was cancelled before the production, another
    production is created.
    - if the delivery was cancelled after the production, no other
    production is created.

In the second case, the production cancellation will reset the procure
method of the delivery. The duplication will not trigger the mto
procurement.

This commit will override the procure method of each cancelled moves and
set it to `make_to_stock'. This way, we have the same behavior independently of the flow.

Task : 2212125

closes odoo/odoo#48366

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-03-26 13:00:26 +00:00
Simon Lejeune 0172a12298 [FIX] stock: return: allow stock user to unlink line
Unlinking a return line is convenient and should be allowed for stock
user. Note that the same functionality could be achieved by setting the
quantity to 0 on the line.

related to 65530dfd6a

closes odoo/odoo#48988

X-original-commit: dc77519066993ed245ef863cdf42f6c25e10c99c
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-04-03 15:31:06 +00:00
Florent de Labarre fa896ff452 [FIX] stock: search on complete name
Using the `complete_name` allows searching more easily in case several
sub-locations have the same name.

Closes #38733

closes odoo/odoo#48846

X-original-commit: 764433669b8b9d675bd9e3ec6668c4b166901534
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-02 09:36:39 +00:00
Tiffany Chang (tic) 1ac243c21c [IMP] various: Replace incorrect use of "edition"
"Edition" is a French-English false friend word. "Edition" in English
means "version" whereas "edition" in French means "editing". This commit
updates user facing strings/documents that incorrectly use "edition" instead
of "edit" or "editing". Attempts were made to clean up English around
"edition" usage so please excuse any errors from lack of context
knowledge. Code comments and names incorrectly using "edition" were NOT
updated.
2020-03-31 10:31:35 +00:00
Adrian Torres 1daf8eb127 [FIX] *: set ondelete policy of required Selection fields
With this commit, Selection fields with `required=True` which are
extended via `selection_add` are given proper ondelete policies to
ensure the cleanup of records containing these extended options during
uninstall of the extending module.

This commit also cleans up leftover uninstall hooks that were being used
to handle the same set of problems prior to the ondelete mechanism being
implemented for Selection fields.

closes odoo/odoo#46325

Related: odoo/enterprise#9117
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-03-30 13:42:04 +00:00
svs-odoo ccb018b9d3 [IMP] stock: add quantities in starting inventory
Adds quantities in starting inventory  and adds a "Starting Inventory"
for the Chicago Warehouse. The purpose is to avoid to have negative
values in demo data.

Task #1970460
2020-03-26 11:44:55 +00:00
svs-odoo 33950bfdc3 [IMP] stock: rename warehouse
Rename warehouse of compagnies as following:
    - YourCompany           ->  San Francisco
      (WH)                      (WH)
    - My Company (Chicago)  ->  Chicago 1
      (MyCo)                    (CHIC1)
    - Chicago Warehouse     ->  Chicago 2
      (Chic)                    (CHIC2)

Also, can pass a default code through the context when create a new
company to set the `code` value when creating the default warehouse for
the newly created company.

Task #1970460
2020-03-26 11:44:55 +00:00
svs-odoo 2589d66c62 [IMP] mrp,stock: tracked product always have SN/LN
Before this commit, some tracked product quantities didn't have a SN/LN.
To avoid some issue at the use, it's better all demo data fulfill
requirements like that.

Task #1970460
2020-03-26 11:27:45 +00:00
svs-odoo a05b21d74b [IMP] *: remove sublocation for demodata
Demo data product's quantities are no more put in sublocation as by
default, multilocation aren't active.

Also, adapts `test_location_usage` because as we moved quantities from
sublocations to the main stock location, the stock warehouse will have
reserved quantity due to a backorder created by demo data.
In this test, we try to change location as a scrap location, what we
can't do if this location has some reserved quantities.

Task #1970460
2020-03-26 11:27:45 +00:00
Arnold Moyaux b88e30d889 [FIX] stock: modify warehouse code update picking type barcode
Currently when the warehouse is created the picking type are created
with a fixed barcode that contains the warehouse code. Later, a
warehouse's code modification will not impact the barcode on the
picking type. However when a company is created the warehouse is
also created with a default code. It's easier to modify all the
barcodes when the code is modified rather than update picking type
one by one. We expect users to setup warehouse configuation before
starting to customise its components so it should not be problematic
but it implies that a late configuration could impact small
configuration on locations and picking types.
2020-03-19 10:45:25 +00:00
Arnold Moyaux da3eddbd51 [FIX] stock: warehouse code should impact picking type
Usecase to reproduce:
- Create Warehouse with code A -> Picking type sequence start with A/
- Set the warehouse's code to B -> Picking type sequence remains A/
- Set the warehouse's code to C -> Picking type sequence become B/

It happens because _update_name_and_code is called before the write and
it updates the picking_type's sequence with warehouse current name and
code.
2020-03-19 10:45:25 +00:00
svs-odoo e729af8dd9 [FIX] stock: don't validate WH/OUT/0005
Before this commit the demo delivery WH/OUT/0005 is plan then validated.
But as this delivery is the one used as example in the barcode PDF, it
could be usefull for demonstration to keep it as to process.
So, this commit keeps it only as ready, and also increases the stock
amount of Desk Combination to be able to process this delivery without
any issue.

task-2199747

closes odoo/odoo#48320

X-original-commit: 652ee46e8adc35bae4f89bf9802f12bd1c424c8d
Related: odoo/enterprise#9474
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-03-25 10:26:38 +00:00