summaryrefslogtreecommitdiff
path: root/addons/account/__manifest__.py
diff options
context:
space:
mode:
authorLucas Lefèvre <lul@odoo.com>2019-08-08 10:03:05 +0000
committerYannick Tivisse <yti@odoo.com>2019-08-22 09:29:26 +0000
commit46e48055edf1141f7b49989e6e3e9faf246fefd0 (patch)
tree0ad7e4cba1a2f6c2140f9b57192da145e2ef767e /addons/account/__manifest__.py
parent3340d3a12d3703cb64397c226f2c0ee006a2c7eb (diff)
[IMP] account: Store customer/supplier rank on partners
Purpose ======= To correctly choose in which account a line should be posted, we have to know if the partner is a customer or a supplier. Specification ============= Keep track of the number of account moves "in" and "out" a partner has. These counts should be based on the posted account moves. A customer that has been created from the 'Customer' menuitem will have a rank=1. When a customer invoice will be created for him, the generated account moves will be taken into account to compute its rank. The most invoices we have for a partner, the higher his rank is. Note: To avoid any concurrent update failures on the partner, if one transaction has already locked a partner row, the count update will be skipped that time. This means the values may be approximative in the database! The exact values will eventually be correctly computed at the next successfull try. Known limitation of this approach: The computation ignores the set of currently selected companies. Actually, storing context dependent values in the database is a bad practice, and is avoided in that case by taking all the companies into account. Use the stored fields `customer_rank` and `supplier_rank` to order partners when searching by name. This allows to show best customers or best suppliers on top. To choose if best customer or supplier are shown on top, the context key `res_partner_search_mode` is used. The context key can take two values: 'customer' or 'supplier'. This decision partially reverts/revamps 8766f38 to only use account moves instead of PO and SO On actions showing partners, set a default filters to menus to only display customers (customer_rank > 0) if the string is "Customers", and only suppliers if the string is "Vendors" or "Suppliers". TaskID: 2049131 closes odoo/odoo#35942 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Diffstat (limited to 'addons/account/__manifest__.py')
-rw-r--r--addons/account/__manifest__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/__manifest__.py b/addons/account/__manifest__.py
index fb30ac2ebe7..c1951b19666 100644
--- a/addons/account/__manifest__.py
+++ b/addons/account/__manifest__.py
@@ -29,13 +29,13 @@ You could use this simplified accounting in case you work with an (external) acc
'views/account_move_views.xml',
'wizard/setup_wizards_view.xml',
'wizard/pos_box.xml',
+ 'views/partner_view.xml',
'views/account_view.xml',
'views/report_statement.xml',
'views/account_report.xml',
'data/mail_template_data.xml',
'wizard/account_validate_move_view.xml',
'views/account_end_fy.xml',
- 'views/partner_view.xml',
'views/product_view.xml',
'views/account_analytic_view.xml',
'views/account_tip_data.xml',