Commit Graph
12 Commits
Author SHA1 Message Date
Victor Feyens f5310d21c4 [FIX] sale_margin: forbid manual cost specification
Considering recent recurring bug reports and the fact that bridge modules
now automatically compute the cost considering logistics, timesheets & expense
flows, the ability to manually edit the cost on a sale.order.line is now disabled.

In most cases, manually specified costs are automatically reset because of
stock/timesheets/expenses added dependencies on the purchase_price field.

Also adapt existing tests and use the new Sale tests common.

closes odoo/odoo#97977

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-08-11 19:14:54 +02:00
Victor Feyens becf288435 [IMP] sale_margin: clean module
* Split python file by classes
* Remove empty ir.model.access.csv file
* Correct name for views file
* Use setUpClass instead of setUp to avoid multiple setups during tests

Part-of: odoo/odoo#85001
2022-02-25 11:40:18 +00:00
Thomas Dieuzeide 72087777ac [FIX] sale_margin: compute fields performance at install
Installing sale_margin module on a db with a lot of sale.order was impossible.

This commit significantly improves performances.
Went from many hours (forecasted) to 15 minutes on a db with 300k orders

For sale.order:
  - Duplicating logic between edit mode and non edit mode
  - Edit mode logic stays the same as before
  - Non edit mode uses read_group to speed up the computation

X-original-commit: 9f1ea7427cdb6984f175f5111e4c9a4c5f013af2
2020-06-03 10:36:17 +00:00
Jinal Patel 6ae2ba8d84 [ADD] sale_margin: margin percentage
New field to express the profitability percentage of a Sales Order (/SO line).

task-2033253

closes odoo/odoo#39926

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-12-23 14:15:56 +00:00
Victor Feyens b9fabffe4e [IMP] sale_margin: make the cost a computed field.
And clean the code mess.

closes odoo/odoo#40953

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-11-29 12:09:40 +00:00
Yannick Tivisse f39871fa1a [IMP] sale_margin: Adapt tests to work with/without demo data 2019-11-05 16:18:10 +01:00
Fabien Pinckaers bed29a4aea [IMP] product: Unify/Clean product demo data
PURPOSE
=======

1. Unified product demo data
2. Less demo: one per use case
3. Demo data for all models

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

1. Refactor all the brol in the demo data
2. Adapt the tests to make them green, as some products are
   renamed, removed, created in python instead of as demo data
   ...
2018-07-05 08:57:41 +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
Christophe Simonis 96595772e0 [MERGE] forward port branch 10.0 up to dc8b473a03 2017-06-15 18:35:46 +02:00
Martin Trigaux b144e09a10 [FIX] sale_margin: apply same logic than sale override
If some required fields are not present in the created values, they are computed
based on the onchange.
This was introduced at 5c4765130 to allow to import sale order lines without
specifying uom.

If sale_margin is installed, the same issue will occure as it assumes there is
a value for product_uom

Add test, courtesy of Mourad Elhadj Mimoune, Akretion

Closes #17613
2017-06-15 15:43:36 +02:00
Kinjal Mehta b0185e15cc [FIX] all: fix some common typos
Sale Order --> Sales Order
Sale Report --> Sales Report
Sale Team -> Sales Team
Payment Term --> Payment Terms
2016-12-22 13:29:38 +01:00
Anand Kansagra 2e4fce618e [MIG] sale_margin: Converted test case from yml to python. 2015-12-16 10:29:09 +01:00