- 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
closesodoo/odoo#51429
X-original-commit: 3f9ac9d3bb507eafe3c074ae817641b9d9dc1c87
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- 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
closesodoo/odoo#51428
X-original-commit: 51d4d95b186777a740cf98803148df593a71f0b9
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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.
closesodoo/odoo#51075
Related: odoo/enterprise#10529
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
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/10341Closes: #50536
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<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
closesodoo/odoo#51305
Taskid: 2256589
Related: odoo/enterprise#10614
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Fixes#29694Close#47204Fix#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.
closesodoo/odoo#51320
X-original-commit: cfb2f00ae2fcbe33184d76383e3b624700101a75
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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.
The tooltips are incorrect and lead to wrong expectations on the
behavior.
opw-2249152
closesodoo/odoo#50746
X-original-commit: bf1d83dd310983c3f3270bf7a7f5c03128fb0993
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#50689
X-original-commit: 4b8d9806c6ee0a85812041f25080617daa7b10f1
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
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
- 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
closesodoo/odoo#49830
X-original-commit: 41c05cbfb015407dbbf7100233999ecd154267dc
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#49941
X-original-commit: 405522de1f97cfb7571d6096f727a4a2d03561d6
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
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'.
closesodoo/odoo#49927
X-original-commit: 0e3c5d3ee1726db2641cd683a84fe59e867d4319
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
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.
closesodoo/odoo#48536
Task: 2161378
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
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
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
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
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
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
_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
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
closesodoo/odoo#49860
X-original-commit: 9b6ea1cdbed02c0f2ccd3e2608e4caf12c8c24ac
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Use `float_compare` to avoid the usual float representation comparison
errors.
opw-2215497
closesodoo/odoo#49702
X-original-commit: 500240874cd21c6950210968c8c7e8d84c1c4bee
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#49555
X-original-commit: f560a9966dfbbacb259f0de74437743d1385d8a6
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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.
closesodoo/odoo#49495
X-original-commit: 2ce1ed31a9c1ec7a7467983a040e4a056f8f4e69
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#49408
X-original-commit: b3369bc230160d6cafec77eed0e756c6f1c576d9
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- 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
closesodoo/odoo#49383
X-original-commit: 55ffc3027d26a36fc390d5efefa2d743cdc3e09f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
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
closesodoo/odoo#49277
X-original-commit: 038221f3180a7a8888503553dbb5eb57875ef3a6
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
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.
closesodoo/odoo#49217
Task-id: 2182609
X-original-commit: 4c12aff2998c436b5bc05f119bc3d7a5f95cdfcd
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
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
closesodoo/odoo#48366
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
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 65530dfd6aclosesodoo/odoo#48988
X-original-commit: dc77519066993ed245ef863cdf42f6c25e10c99c
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Using the `complete_name` allows searching more easily in case several
sub-locations have the same name.
Closes#38733closesodoo/odoo#48846
X-original-commit: 764433669b8b9d675bd9e3ec6668c4b166901534
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
"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.
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.
closesodoo/odoo#46325
Related: odoo/enterprise#9117
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
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
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
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
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
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.
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.
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
closesodoo/odoo#48320
X-original-commit: 652ee46e8adc35bae4f89bf9802f12bd1c424c8d
Related: odoo/enterprise#9474
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>