From 8766f388da9b642ba4433d8d5d670847b472cff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lef=C3=A8vre?= Date: Wed, 31 Jul 2019 15:12:10 +0200 Subject: [PATCH 1/2] [IMP] base: Allow to better search partners if they are customers/suppliers This commit allows to call `name_search` with context key `res_partner_search_mode` that can take currently two values: "customer" or "supplier". When ordering search results, order partners by the number of SO they have when the value is "customer" and by the number of PO if the value is "supplier". Top suppliers/customers are displayed above in a PO/SO partner dropdown. We have thought about different implementations before selecting this one: - Keep the 2 boolean flags and automatically set them if a SO or PO is created for a customer/supplier (helps a bit but doesn't work well for the first SO/PO). As the onboarding is also a priority, we didn't implement it. - Instead of filtering on the bool flags, sort the name_search() result according to the number of orders they already have (e.g. if you search for "Foo" on a PO, a supplier "SuperFoo" with 32 purchase orders will appear before supplier "HorribleFoo" that has no PO). Problem is to do this in an efficient manner for large databases - possibly we could store a "relevance index" based on the number of recent orders. Storing those values is an issue too, as it doesn't work well for multi company database. Indeed, storing values that depend on the context is certainly not a good idea. - Same as previous alternative but with no stored columns, rather a JOIN in name_search. This is the solution that have been kept. The only concern was about the perfomances. We tested it on our production base, on a sales order, as we have way much more customers than suppliers. After a deep analysis on the querry and the bitmap generated by PostgreSQL, we can conclude that the count(*) works rather efficiently and that the request is not significantly heavier than without the context key. Performance Analysis ==================== The following results have been obtained on our production database. Before this commit ------------------ The original query is the following one: ``` EXPLAIN ANALYSE SELECT res_partner.id FROM "res_partner" WHERE ("res_partner"."customer" = True) AND ("res_partner"."active" = True) AND ((("res_partner"."type" != 'private') OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) AND (res_partner.email ilike '%eezee-i%' OR res_partner.display_name ilike '%eezee-i%' OR res_partner.ref ilike '%eezee-i%' OR res_partner.vat ilike '%eezeei%') -- don't panic, trust postgres bitmap ORDER BY res_partner.display_name ilike '%eezee-i%' desc, res_partner.display_name limit 8; ``` Here is the EXPLAIN ANALYSE returned by PostgreSQL: ``` Limit (cost=1625.50..1625.52 rows=8 width=21) (actual time=13.397..13.404 rows=8 loops=1) -> Sort (cost=1625.50..1626.32 rows=326 width=21) (actual time=13.395..13.396 rows=8 loops=1) Sort Key: (((display_name)::text ~~* '%eezee-i%'::text)) DESC, display_name Sort Method: top-N heapsort Memory: 26kB -> Bitmap Heap Scan on res_partner (cost=1282.79..1618.98 rows=326 width=21) (actual time=13.025..13.350 rows=56 loops=1) Recheck Cond: (((email)::text ~~* '%eezee-i%'::text) OR ((display_name)::text ~~* '%eezee-i%'::text) OR ((ref)::text ~~* '%eezee-i%'::text) OR ((vat)::text ~~* '%eezeei%'::text)) Rows Removed by Index Recheck: 1 Filter: (customer AND active AND (((type)::text <> 'private'::text) OR (type IS NULL) OR (type IS NULL))) Rows Removed by Filter: 1 Heap Blocks: exact=58 -> BitmapOr (cost=1282.79..1282.79 rows=328 width=0) (actual time=12.983..12.983 rows=0 loops=1) -> Bitmap Index Scan on res_partner_name_tgm_idx_gin (cost=0.00..322.22 rows=162 width=0) (actual time=5.022..5.022 rows=54 loops=1) Index Cond: ((email)::text ~~* '%eezee-i%'::text) -> Bitmap Index Scan on res_partner_name_tgm_idx_gin (cost=0.00..322.22 rows=162 width=0) (actual time=4.128..4.128 rows=56 loops=1) Index Cond: ((display_name)::text ~~* '%eezee-i%'::text) -> Bitmap Index Scan on res_partner_name_tgm_idx_gin (cost=0.00..321.00 rows=1 width=0) (actual time=2.240..2.240 rows=0 loops=1) Index Cond: ((ref)::text ~~* '%eezee-i%'::text) -> Bitmap Index Scan on res_partner_name_tgm_idx_gin (cost=0.00..317.03 rows=4 width=0) (actual time=1.585..1.585 rows=0 loops=1) Index Cond: ((vat)::text ~~* '%eezeei%'::text) Planning time: 0.766 ms Execution time: 13.489 ms ``` After this commit ----------------- Without the context key, the query looks like this: ``` SELECT res_partner.id FROM "res_partner" WHERE ("res_partner"."active" = True) AND ((("res_partner"."type" != 'private') OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) AND (res_partner.email ilike '%eezee-i%' OR res_partner.display_name ilike '%eezee-i%' OR res_partner.ref ilike '%eezee-i%' OR res_partner.vat ilike '%eezeei%') -- don't panic, trust postgres bitmap GROUP BY res_partner.id ORDER BY COUNT(*) DESC, res_partner.display_name ilike '%eezee-i%' desc, res_partner.display_name limit 8; And it quite clear when looking at the EXPLAIN ANALYSE that the request is quite the same, except the aggregation that is made with a quicksort method. Limit (cost=1645.00..1645.02 rows=8 width=29) (actual time=13.200..13.206 rows=8 loops=1) -> Sort (cost=1645.00..1645.82 rows=328 width=29) (actual time=13.197..13.198 rows=8 loops=1) Sort Key: (count(*)) DESC, (((display_name)::text ~~* '%eezee-i%'::text)) DESC, display_name Sort Method: top-N heapsort Memory: 26kB -> GroupAggregate (cost=1631.88..1638.44 rows=328 width=29) (actual time=13.090..13.160 rows=56 loops=1) Group Key: id -> Sort (cost=1631.88..1632.70 rows=328 width=20) (actual time=13.080..13.084 rows=56 loops=1) Sort Key: id Sort Method: quicksort Memory: 29kB -> Bitmap Heap Scan on res_partner (cost=1282.79..1618.17 rows=328 width=20) (actual time=12.793..13.055 rows=56 loops=1) Recheck Cond: (((email)::text ~~* '%eezee-i%'::text) OR ((display_name)::text ~~* '%eezee-i%'::text) OR ((ref)::text ~~* '%eezee-i%'::text) OR ((vat)::text ~~* '%eezeei%'::text)) Rows Removed by Index Recheck: 1 Filter: (active AND (((type)::text <> 'private'::text) OR (type IS NULL) OR (type IS NULL))) Rows Removed by Filter: 1 Heap Blocks: exact=58 -> BitmapOr (cost=1282.79..1282.79 rows=328 width=0) (actual time=12.755..12.755 rows=0 loops=1) -> Bitmap Index Scan on res_partner_name_tgm_idx_gin (cost=0.00..322.22 rows=162 width=0) (actual time=4.823..4.823 rows=54 loops=1) Index Cond: ((email)::text ~~* '%eezee-i%'::text) -> Bitmap Index Scan on res_partner_name_tgm_idx_gin (cost=0.00..322.22 rows=162 width=0) (actual time=3.941..3.941 rows=56 loops=1) Index Cond: ((display_name)::text ~~* '%eezee-i%'::text) -> Bitmap Index Scan on res_partner_name_tgm_idx_gin (cost=0.00..321.00 rows=1 width=0) (actual time=2.186..2.186 rows=0 loops=1) Index Cond: ((ref)::text ~~* '%eezee-i%'::text) -> Bitmap Index Scan on res_partner_name_tgm_idx_gin (cost=0.00..317.03 rows=4 width=0) (actual time=1.798..1.798 rows=0 loops=1) Index Cond: ((vat)::text ~~* '%eezeei%'::text) Planning time: 0.761 ms Execution time: 13.317 ms ``` With the context key, the query looks like this: ``` EXPLAIN ANALYSE SELECT res_partner.id FROM "res_partner" LEFT JOIN sale_order ON res_partner.id = sale_order.partner_id WHERE ("res_partner"."active" = True) AND ((("res_partner"."type" != 'private') OR "res_partner"."type" IS NULL) OR "res_partner"."type" IS NULL ) AND (res_partner.email ilike '%eezee-i%' OR res_partner.display_name ilike '%eezee-i%' OR res_partner.ref ilike '%eezee-i%' OR res_partner.vat ilike '%eezeei%') -- don't panic, trust postgres bitmap GROUP BY res_partner.id ORDER BY COUNT(*) DESC, res_partner.display_name ilike '%eezee-i%' desc, res_partner.display_name limit 8; ``` The only difference is that a nested loop is made for the left join, as postgreSQL has correctly identified the dicriminating table. The correct result is obtained within a similar duration. ``` Limit (cost=2700.68..2700.70 rows=8 width=29) (actual time=12.561..12.568 rows=8 loops=1) -> Sort (cost=2700.68..2701.50 rows=328 width=29) (actual time=12.559..12.560 rows=8 loops=1) Sort Key: (count(*)) DESC, (((res_partner.display_name)::text ~~* '%eezee-i%'::text)) DESC, res_partner.display_name Sort Method: top-N heapsort Memory: 26kB -> GroupAggregate (cost=2687.56..2694.12 rows=328 width=29) (actual time=12.449..12.527 rows=56 loops=1) Group Key: res_partner.id -> Sort (cost=2687.56..2688.38 rows=328 width=20) (actual time=12.408..12.425 rows=305 loops=1) Sort Key: res_partner.id Sort Method: quicksort Memory: 42kB -> Nested Loop Left Join (cost=1283.21..2673.86 rows=328 width=20) (actual time=11.629..12.340 rows=305 loops=1) -> Bitmap Heap Scan on res_partner (cost=1282.79..1618.17 rows=328 width=20) (actual time=11.596..11.862 rows=56 loops=1) Recheck Cond: (((email)::text ~~* '%eezee-i%'::text) OR ((display_name)::text ~~* '%eezee-i%'::text) OR ((ref)::text ~~* '%eezee-i%'::text) OR ((vat)::text ~~* '%eezeei%'::text)) Rows Removed by Index Recheck: 1 Filter: (active AND (((type)::text <> 'private'::text) OR (type IS NULL) OR (type IS NULL))) Rows Removed by Filter: 1 Heap Blocks: exact=58 -> BitmapOr (cost=1282.79..1282.79 rows=328 width=0) (actual time=11.560..11.560 rows=0 loops=1) -> Bitmap Index Scan on res_partner_name_tgm_idx_gin (cost=0.00..322.22 rows=162 width=0) (actual time=4.724..4.724 rows=54 loops=1) Index Cond: ((email)::text ~~* '%eezee-i%'::text) -> Bitmap Index Scan on res_partner_name_tgm_idx_gin (cost=0.00..322.22 rows=162 width=0) (actual time=3.825..3.825 rows=56 loops=1) Index Cond: ((display_name)::text ~~* '%eezee-i%'::text) -> Bitmap Index Scan on res_partner_name_tgm_idx_gin (cost=0.00..321.00 rows=1 width=0) (actual time=1.752..1.752 rows=0 loops=1) Index Cond: ((ref)::text ~~* '%eezee-i%'::text) -> Bitmap Index Scan on res_partner_name_tgm_idx_gin (cost=0.00..317.03 rows=4 width=0) (actual time=1.254..1.254 rows=0 loops=1) Index Cond: ((vat)::text ~~* '%eezeei%'::text) -> Index Only Scan using sale_order_partner_id_index on sale_order (cost=0.42..2.74 rows=48 width=4) (actual time=0.006..0.007 rows=5 loops=56) Index Cond: (partner_id = res_partner.id) Heap Fetches: 12 Planning time: 1.056 ms Execution time: 13.791 ms ``` TaskID: 2031147 Co-authored-by: Yannick Tivisse --- addons/purchase/models/res_partner.py | 8 ++++++++ addons/sale/models/res_partner.py | 8 ++++++++ odoo/addons/base/models/res_partner.py | 14 +++++++++----- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/addons/purchase/models/res_partner.py b/addons/purchase/models/res_partner.py index e323fe95658..56d79315966 100644 --- a/addons/purchase/models/res_partner.py +++ b/addons/purchase/models/res_partner.py @@ -53,3 +53,11 @@ class res_partner(models.Model): supplier_invoice_count = fields.Integer(compute='_compute_supplier_invoice_count', string='# Vendor Bills') purchase_warn = fields.Selection(WARNING_MESSAGE, 'Purchase Order', help=WARNING_HELP, default="no-message") purchase_warn_msg = fields.Text('Message for Purchase Order') + + def _get_name_search_join_clause(self): + res = super()._get_name_search_join_clause() + partner_search_mode = self.env.context.get('res_partner_search_mode') + if partner_search_mode == 'supplier': + join_clause = "LEFT JOIN {table} ON res_partner.id = {table}.partner_id".format(table=self.env['purchase.order']._table) + return '%s %s' % (res, join_clause) if res else join_clause + return res diff --git a/addons/sale/models/res_partner.py b/addons/sale/models/res_partner.py index fac5165f55f..fa9e296580f 100644 --- a/addons/sale/models/res_partner.py +++ b/addons/sale/models/res_partner.py @@ -40,3 +40,11 @@ class ResPartner(models.Model): ('state', 'in', ['sent', 'sale', 'done']) ], limit=1) return can_edit_vat and not bool(has_so) + + def _get_name_search_join_clause(self): + res = super()._get_name_search_join_clause() + partner_search_mode = self.env.context.get('res_partner_search_mode') + if partner_search_mode == 'customer': + join_clause = "LEFT JOIN {table} ON res_partner.id = {table}.partner_id".format(table=self.env['sale.order']._table) + return '%s %s' % (res, join_clause) if res else join_clause + return res diff --git a/odoo/addons/base/models/res_partner.py b/odoo/addons/base/models/res_partner.py index 3e84b921882..ce996272ac3 100644 --- a/odoo/addons/base/models/res_partner.py +++ b/odoo/addons/base/models/res_partner.py @@ -172,10 +172,6 @@ class Partner(models.Model): column2='category_id', string='Tags', default=_default_category) credit_limit = fields.Float(string='Credit Limit') active = fields.Boolean(default=True) - customer = fields.Boolean(string='Is a Customer', default=True, - help="Check this box if this contact is a customer. It can be selected in sales orders.") - supplier = fields.Boolean(string='Is a Vendor', - help="Check this box if this contact is a vendor. It can be selected in purchase orders.") employee = fields.Boolean(help="Check this box if this contact is an Employee.") function = fields.Char(string='Job Position') type = fields.Selection( @@ -760,6 +756,9 @@ class Partner(models.Model): return super(Partner, self)._search(args, offset=offset, limit=limit, order=order, count=count, access_rights_uid=access_rights_uid) + def _get_name_search_join_clause(self): + return '' + @api.model def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None): self = self.with_user(name_get_uid or self.env.uid) @@ -782,16 +781,21 @@ class Partner(models.Model): unaccent = get_unaccent_wrapper(self.env.cr) + join_clause = self._get_name_search_join_clause() + query = """SELECT res_partner.id FROM {from_str} + {join} {where} ({email} {operator} {percent} OR {display_name} {operator} {percent} OR {reference} {operator} {percent} OR {vat} {operator} {percent}) -- don't panic, trust postgres bitmap - ORDER BY {display_name} {operator} {percent} desc, + GROUP BY res_partner.id + ORDER BY COUNT(*) DESC, {display_name} {operator} {percent} desc, {display_name} """.format(from_str=from_str, + join=join_clause, where=where_str, operator=operator, email=unaccent('res_partner.email'), From 3e97cff7797c4f7e695d20def6b920561b6a6525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lef=C3=A8vre?= Date: Wed, 31 Jul 2019 15:18:14 +0200 Subject: [PATCH 2/2] [IMP] base: Remove customer and supplier fields from res.partner Purpose ======= Fields `customer` and `supplier` on `res.partner` are mostly used in domains of many2x fields. Those domains can confuse end users because they don't see the partner they are looking for; and it's not obvious why. Some identified problems: 1. It can lead to duplicated partners: the user does not find the partner, so he creates a new one. 2. The user imports supplier contacts in the Contacts app, so they don't get the `supplier` flag. Then the user wants to make a purchase order, and cannot find the new suppliers in the list 3. A user removes the customer flag on a prospect, because they don't think it's a customer yet - except now they can't make a quote for that customer... Specification ============= Remove the two mentioned fields. Since fields `customer` and `supplier` have been removed, all partners are now shown in many2one dropdowns. But in some cases, not all partners are relevant or some are more likely to be relevant than others. e.g. when creating a PO, top suppliers have a higher priority than other partners. So, adapt the places where those fields were used with the new mechanism to display the searched the partners, according to the number purchase/sales orders they made. TaskID: 2031147 Co-authored-by: Yannick Tivisse --- addons/account/models/account_move.py | 3 --- .../account/models/reconciliation_widget.py | 7 +---- .../report/account_invoice_report_view.xml | 4 +-- .../js/reconciliation/reconciliation_model.js | 10 ++----- .../reconciliation/reconciliation_renderer.js | 2 +- .../static/tests/reconciliation_tests.js | 18 ++++++------- addons/account/tests/account_test_no_chart.py | 1 - addons/account/views/account_move_views.xml | 5 +--- addons/account/views/account_payment_view.xml | 2 +- addons/account/views/account_view.xml | 3 +-- addons/account/views/partner_view.xml | 6 ++--- addons/auth_signup/models/res_users.py | 1 - .../data/base_automation_demo.xml | 2 +- .../tests/test_base_automation.py | 8 +++--- addons/base_automation/tests/test_models.py | 2 +- addons/crm/views/crm_lead_views.xml | 8 +++--- addons/crm/views/res_partner_views.xml | 1 - .../wizard/crm_lead_to_opportunity_views.xml | 2 +- addons/delivery/views/partner_view.xml | 2 +- addons/fleet/models/fleet_vehicle_cost.py | 8 +++--- .../fleet/views/fleet_vehicle_cost_views.xml | 6 ++--- .../google_calendar/models/google_calendar.py | 1 - .../google_drive/data/google_drive_demo.xml | 1 - addons/hr_expense/data/hr_expense_demo.xml | 1 - .../hr_expense_sheet_register_payment.xml | 2 +- addons/hr_timesheet/tests/test_timesheet.py | 1 - addons/l10n_in/data/res_partner_demo.xml | 7 ----- addons/maintenance/models/maintenance.py | 2 +- .../maintenance/views/maintenance_views.xml | 2 +- addons/mass_mailing/models/mailing.py | 2 -- addons/membership/views/partner_views.xml | 3 --- addons/mrp/tests/test_stock.py | 2 -- addons/point_of_sale/static/src/js/models.js | 3 +-- addons/point_of_sale/views/pos_order_view.xml | 2 +- .../point_of_sale/views/res_partner_view.xml | 2 +- addons/product/models/product.py | 2 +- addons/product/views/product_views.xml | 2 +- .../tests/test_product_margin.py | 4 +-- addons/purchase/views/purchase_views.xml | 2 +- addons/purchase/views/res_partner_views.xml | 4 +-- .../views/purchase_requisition_views.xml | 2 +- .../views/purchase_views.xml | 2 +- .../tests/test_replenish_wizard.py | 2 +- addons/sale/views/res_partner_views.xml | 1 - addons/sale/views/sale_views.xml | 2 +- addons/sale_coupon/tests/common.py | 1 - .../sale_coupon/tests/test_program_numbers.py | 1 - addons/sale_purchase/tests/common.py | 1 - .../tests/test_project_billing.py | 1 - .../wizard/project_create_sale_order.py | 2 +- addons/stock/data/stock_demo.xml | 2 -- ...o_saxon_valuation_reconciliation_common.py | 2 -- addons/survey/tests/common.py | 1 - .../relational_fields/field_many2one_tests.js | 2 +- .../views/res_partner_views.xml | 2 +- addons/website_sale/controllers/main.py | 1 - addons/website_slides/tests/common.py | 1 - odoo/addons/base/data/res_partner_data.xml | 3 --- odoo/addons/base/data/res_partner_demo.xml | 19 -------------- odoo/addons/base/data/res_users_demo.xml | 3 --- odoo/addons/base/models/res_company.py | 1 - odoo/addons/base/models/res_users.py | 2 +- odoo/addons/base/tests/test_api.py | 10 +++---- odoo/addons/base/tests/test_orm.py | 4 +-- odoo/addons/base/views/res_partner_views.xml | 26 ++++++------------- odoo/addons/test_impex/tests/contacts.json | 2 +- odoo/addons/test_impex/tests/test_load.py | 2 +- 67 files changed, 77 insertions(+), 167 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index eb7fccabe6c..569cf3532a7 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -355,9 +355,6 @@ class AccountMove(models.Model): if self.is_sale_document(include_receipts=True): if self.env['ir.config_parameter'].sudo().get_param('account.use_invoice_terms'): self.narration = self.company_id.invoice_terms or self.env.company.invoice_terms - return {'domain': {'partner_id': [('customer', '=', True)]}} - elif self.is_purchase_document(include_receipts=True): - return {'domain': {'partner_id': [('supplier', '=', True)]}} @api.onchange('invoice_line_ids') def _onchange_invoice_line_ids(self): diff --git a/addons/account/models/reconciliation_widget.py b/addons/account/models/reconciliation_widget.py index 5e49e94e272..50a99f53d05 100644 --- a/addons/account/models/reconciliation_widget.py +++ b/addons/account/models/reconciliation_widget.py @@ -704,12 +704,7 @@ class AccountReconciliation(models.AbstractModel): 'company_id': st_line.company_id.id, } if st_line.partner_id: - if st_line.partner_id.supplier and not st_line.partner_id.customer: - data['open_balance_account_id'] = st_line.partner_id.property_account_payable_id.id - elif not st_line.partner_id.supplier and st_line.partner_id.customer: - data['open_balance_account_id'] = st_line.partner_id.property_account_receivable_id.id - else: - data['open_balance_account_id'] = amount > 0 and st_line.partner_id.property_account_receivable_id.id or st_line.partner_id.property_account_payable_id.id + data['open_balance_account_id'] = amount > 0 and st_line.partner_id.property_account_receivable_id.id or st_line.partner_id.property_account_payable_id.id return data diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml index 479d187b867..3980add37c4 100644 --- a/addons/account/report/account_invoice_report_view.xml +++ b/addons/account/report/account_invoice_report_view.xml @@ -101,7 +101,7 @@ Invoices Analysis account.invoice.report graph,pivot - {'search_default_current':1, 'search_default_supplier':1, 'group_by':[], 'group_by_no_leaf':1, 'search_default_year': 1} + {'search_default_current':1, 'res_partner_search_mode': 'supplier', 'group_by':[], 'group_by_no_leaf':1, 'search_default_year': 1} From this report, you can have an overview of the amount invoiced from your vendors. The search tool can also be used to personalise your Invoices reports and so, match this analysis to your needs. @@ -109,7 +109,7 @@ Invoices Analysis account.invoice.report graph,pivot - {'search_default_current':1, 'search_default_customer':1, 'group_by':[], 'group_by_no_leaf':1, 'search_default_year': 1} + {'search_default_current':1, 'res_partner_search_mode': 'customer', 'group_by':[], 'group_by_no_leaf':1, 'search_default_year': 1} From this report, you can have an overview of the amount invoiced to your customers. The search tool can also be used to personalise your Invoices reports and so, match this analysis to your needs. diff --git a/addons/account/static/src/js/reconciliation/reconciliation_model.js b/addons/account/static/src/js/reconciliation/reconciliation_model.js index 10f7a3dc89e..f7876b6ffd3 100644 --- a/addons/account/static/src/js/reconciliation/reconciliation_model.js +++ b/addons/account/static/src/js/reconciliation/reconciliation_model.js @@ -862,17 +862,11 @@ var StatementModel = BasicModel.extend({ return this._rpc({ model: 'res.partner', method: 'read', - args: [partner_id, ["property_account_receivable_id", "property_account_payable_id", "customer", "supplier"]], + args: [partner_id, ["property_account_receivable_id", "property_account_payable_id"]], }).then(function (result) { if (result.length > 0) { var line = self.getLine(handle); - if (result[0]['supplier'] && !result[0]['customer']) { - self.lines[handle].st_line.open_balance_account_id = result[0]['property_account_payable_id'][0]; - } else if (!result[0]['supplier'] && result[0]['customer']) { - self.lines[handle].st_line.open_balance_account_id = result[0]['property_account_receivable_id'][0]; - } else { - self.lines[handle].st_line.open_balance_account_id = line.balance.amount < 0 ? result[0]['property_account_payable_id'][0] : result[0]['property_account_receivable_id'][0]; - } + self.lines[handle].st_line.open_balance_account_id = line.balance.amount < 0 ? result[0]['property_account_payable_id'][0] : result[0]['property_account_receivable_id'][0]; } }); }, diff --git a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js index 8693b2c9d30..312e426f3a3 100644 --- a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js +++ b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js @@ -525,7 +525,7 @@ var LineRenderer = Widget.extend(FieldManagerMixin, { } return this.model.makeRecord('account.bank.statement.line', [field], { partner_id: { - domain: ["|", ["is_company", "=", true], ["parent_id", "=", false], "|", ["customer", "=", true], ["supplier", "=", true]], + domain: ["|", ["is_company", "=", true], ["parent_id", "=", false]], options: { no_open: true } diff --git a/addons/account/static/tests/reconciliation_tests.js b/addons/account/static/tests/reconciliation_tests.js index e946400afc3..4d3a20f84fb 100644 --- a/addons/account/static/tests/reconciliation_tests.js +++ b/addons/account/static/tests/reconciliation_tests.js @@ -26,23 +26,21 @@ var db = { id: {string: "ID", type: 'integer'}, display_name: {string: "Displayed name", type: 'char'}, image: {string: "image", type: 'integer'}, - customer: {string: "customer", type: 'boolean'}, - supplier: {string: "supplier", type: 'boolean'}, parent_id: {string: "Parent", type: 'boolean'}, is_company: {string: "Is company", type: 'boolean'}, property_account_receivable_id: {string: 'Account receivable', type: 'many2one', relation: 'account.account'}, property_account_payable_id: {string: 'Account payable', type: 'many2one', relation: 'account.account'}, }, records: [ - {id: 1, display_name: "partner 1", image: 'AAA', customer: true}, - {id: 2, display_name: "partner 2", image: 'BBB', customer: true}, - {id: 3, display_name: "partner 3", image: 'CCC', customer: true}, - {id: 4, display_name: "partner 4", image: 'DDD', customer: true}, - {id: 8, display_name: "Agrolait", image: 'EEE', customer: true}, - {id: 12, display_name: "Camptocamp", image: 'FFF', supplier: true, property_account_receivable_id: 287, property_account_payable_id: 287}, + {id: 1, display_name: "partner 1", image: 'AAA'}, + {id: 2, display_name: "partner 2", image: 'BBB'}, + {id: 3, display_name: "partner 3", image: 'CCC'}, + {id: 4, display_name: "partner 4", image: 'DDD'}, + {id: 8, display_name: "Agrolait", image: 'EEE'}, + {id: 12, display_name: "Camptocamp", image: 'FFF', property_account_receivable_id: 287, property_account_payable_id: 287}, // add more to have 'Search More' option - {id: 98, display_name: "partner 98", image: 'YYY', customer: true}, - {id: 99, display_name: "partner 99", image: 'ZZZ', customer: true}, + {id: 98, display_name: "partner 98", image: 'YYY'}, + {id: 99, display_name: "partner 99", image: 'ZZZ'}, ], mark_as_reconciled: function () { return Promise.resolve(); diff --git a/addons/account/tests/account_test_no_chart.py b/addons/account/tests/account_test_no_chart.py index ba145b02d48..28bf7e8807a 100644 --- a/addons/account/tests/account_test_no_chart.py +++ b/addons/account/tests/account_test_no_chart.py @@ -41,7 +41,6 @@ class TestAccountNoChartCommon(SavepointCase): cls.partner_customer_usd = Partner.create({ 'name': 'Customer from the North', 'email': 'customer.usd@north.com', - 'customer': True, 'property_account_payable_id': cls.account_payable.id, 'property_account_receivable_id': cls.account_receivable.id, }) diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml index 0ea26ac6708..778718e3421 100644 --- a/addons/account/views/account_move_views.xml +++ b/addons/account/views/account_move_views.xml @@ -549,10 +549,7 @@ - + diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml index 77e10a8529f..8abe388a28c 100644 --- a/addons/account/views/account_view.xml +++ b/addons/account/views/account_view.xml @@ -579,8 +579,7 @@ action = model.setting_init_bank_account_action() + attrs="{'readonly' : [('journal_entry_ids', '!=', [])] }"/> diff --git a/addons/account/views/partner_view.xml b/addons/account/views/partner_view.xml index 0307bb43576..ffe487836f7 100644 --- a/addons/account/views/partner_view.xml +++ b/addons/account/views/partner_view.xml @@ -122,7 +122,7 @@
- + diff --git a/addons/hr_timesheet/tests/test_timesheet.py b/addons/hr_timesheet/tests/test_timesheet.py index 1a7dbee1509..c2bfab9e8bd 100644 --- a/addons/hr_timesheet/tests/test_timesheet.py +++ b/addons/hr_timesheet/tests/test_timesheet.py @@ -14,7 +14,6 @@ class TestCommonTimesheet(TransactionCase): self.partner = self.env['res.partner'].create({ 'name': 'Customer Task', 'email': 'customer@task.com', - 'customer': True, }) self.analytic_account = self.env['account.analytic.account'].create({ diff --git a/addons/l10n_in/data/res_partner_demo.xml b/addons/l10n_in/data/res_partner_demo.xml index 962919e460c..9876146414e 100644 --- a/addons/l10n_in/data/res_partner_demo.xml +++ b/addons/l10n_in/data/res_partner_demo.xml @@ -23,7 +23,6 @@ Registered Customer - 1 1 201, Second Floor, IT Tower 4 InfoCity Gate - 1, Infocity @@ -62,8 +61,6 @@ Registered Supplier - 0 - 1 1 201, Second Floor, IT Tower 4 InfoCity Gate - 1, Infocity @@ -78,8 +75,6 @@ Unregistered Supplier - 0 - 1 B105, yogeshwar Tower Veraval 362266 @@ -92,8 +87,6 @@ Reseller(E-Commerce) - 0 - 0 4/001 Ground Floor, 16th Main Rd, Bengaluru 560001 diff --git a/addons/maintenance/models/maintenance.py b/addons/maintenance/models/maintenance.py index 73a30347399..f321cc21ab7 100644 --- a/addons/maintenance/models/maintenance.py +++ b/addons/maintenance/models/maintenance.py @@ -124,7 +124,7 @@ class MaintenanceEquipment(models.Model): owner_user_id = fields.Many2one('res.users', string='Owner', tracking=True) category_id = fields.Many2one('maintenance.equipment.category', string='Equipment Category', tracking=True, group_expand='_read_group_category_ids') - partner_id = fields.Many2one('res.partner', string='Vendor', domain="[('supplier', '=', 1)]") + partner_id = fields.Many2one('res.partner', string='Vendor') partner_ref = fields.Char('Vendor Reference') location = fields.Char('Location') model = fields.Char('Model') diff --git a/addons/maintenance/views/maintenance_views.xml b/addons/maintenance/views/maintenance_views.xml index 499bf05693d..204a50adc56 100644 --- a/addons/maintenance/views/maintenance_views.xml +++ b/addons/maintenance/views/maintenance_views.xml @@ -368,7 +368,7 @@ - + diff --git a/addons/mass_mailing/models/mailing.py b/addons/mass_mailing/models/mailing.py index 7817237818e..ec8731dd2de 100644 --- a/addons/mass_mailing/models/mailing.py +++ b/addons/mass_mailing/models/mailing.py @@ -354,8 +354,6 @@ class MassMailing(models.Model): mailing_domain.append(('list_ids', 'in', self.contact_list_ids.ids)) else: mailing_domain.append((0, '=', 1)) - elif self.mailing_model_name == 'res.partner': - mailing_domain.append(('customer', '=', True)) elif 'opt_out' in self.env[self.mailing_model_name]._fields and not self.mailing_domain: mailing_domain.append(('opt_out', '=', False)) else: diff --git a/addons/membership/views/partner_views.xml b/addons/membership/views/partner_views.xml index cd4feefb6d9..d4c5aea3396 100644 --- a/addons/membership/views/partner_views.xml +++ b/addons/membership/views/partner_views.xml @@ -29,9 +29,6 @@ - - - diff --git a/addons/mrp/tests/test_stock.py b/addons/mrp/tests/test_stock.py index 6f5f8c130cf..14b2e28e7b2 100644 --- a/addons/mrp/tests/test_stock.py +++ b/addons/mrp/tests/test_stock.py @@ -305,8 +305,6 @@ class TestKitPicking(common.TestMrpCommon): # We create an 'immediate transfer' receipt for x3 kit_parent self.test_partner = self.env['res.partner'].create({ 'name': 'Notthat Guyagain', - 'supplier': True, - 'customer': True, }) self.test_supplier = self.env['stock.location'].create({ 'name': 'supplier', diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js index b9d539c8643..e24a5d7841b 100644 --- a/addons/point_of_sale/static/src/js/models.js +++ b/addons/point_of_sale/static/src/js/models.js @@ -210,7 +210,6 @@ exports.PosModel = Backbone.Model.extend({ fields: ['name','street','city','state_id','country_id','vat', 'phone','zip','mobile','email','barcode','write_date', 'property_account_position_id','property_product_pricelist'], - domain: [['customer','=',true]], loaded: function(self,partners){ self.partners = partners; self.db.add_partners(partners); @@ -587,7 +586,7 @@ exports.PosModel = Backbone.Model.extend({ }, prepare_new_partners_domain: function(){ - return [['customer','=',true], ['write_date','>', this.db.get_partner_write_date()]]; + return [['write_date','>', this.db.get_partner_write_date()]]; }, // reload the list of partner, returns as a promise that resolves if there were diff --git a/addons/point_of_sale/views/pos_order_view.xml b/addons/point_of_sale/views/pos_order_view.xml index 21a4d9e3fbe..7ce67d79d3f 100644 --- a/addons/point_of_sale/views/pos_order_view.xml +++ b/addons/point_of_sale/views/pos_order_view.xml @@ -28,7 +28,7 @@ - + diff --git a/addons/point_of_sale/views/res_partner_view.xml b/addons/point_of_sale/views/res_partner_view.xml index 5528bf1fe64..0da6074cf83 100644 --- a/addons/point_of_sale/views/res_partner_view.xml +++ b/addons/point_of_sale/views/res_partner_view.xml @@ -10,7 +10,7 @@
diff --git a/addons/product/models/product.py b/addons/product/models/product.py index 5c8474a09e3..cdb4a74a498 100644 --- a/addons/product/models/product.py +++ b/addons/product/models/product.py @@ -767,7 +767,7 @@ class SupplierInfo(models.Model): name = fields.Many2one( 'res.partner', 'Vendor', - domain=[('supplier', '=', True)], ondelete='cascade', required=True, + ondelete='cascade', required=True, help="Vendor of this product") product_name = fields.Char( 'Vendor Product Name', diff --git a/addons/product/views/product_views.xml b/addons/product/views/product_views.xml index fe533e325bf..5a134ceb6c2 100644 --- a/addons/product/views/product_views.xml +++ b/addons/product/views/product_views.xml @@ -630,7 +630,7 @@ - + diff --git a/addons/product_margin/tests/test_product_margin.py b/addons/product_margin/tests/test_product_margin.py index 9626b47bb6d..0e950a77b17 100644 --- a/addons/product_margin/tests/test_product_margin.py +++ b/addons/product_margin/tests/test_product_margin.py @@ -29,8 +29,8 @@ class TestProductMargin(common.TransactionCase): get_resource_path('account', 'test', 'account_minimal_test.xml'), {}, 'init', False, 'test', self.registry._assertion_report) - supplier = self.env['res.partner'].create({'name': 'Supplier', 'supplier': True}) - customer = self.env['res.partner'].create({'name': 'Customer', 'customer': True}) + supplier = self.env['res.partner'].create({'name': 'Supplier'}) + customer = self.env['res.partner'].create({'name': 'Customer'}) ipad = self.env.ref("product.product_product_4") # Create supplier invoice and customer invoice to test product margin. diff --git a/addons/purchase/views/purchase_views.xml b/addons/purchase/views/purchase_views.xml index 4db8dab2043..99f237d889b 100644 --- a/addons/purchase/views/purchase_views.xml +++ b/addons/purchase/views/purchase_views.xml @@ -166,7 +166,7 @@
- diff --git a/addons/purchase/views/res_partner_views.xml b/addons/purchase/views/res_partner_views.xml index 64da2745715..58acf001c03 100644 --- a/addons/purchase/views/res_partner_views.xml +++ b/addons/purchase/views/res_partner_views.xml @@ -74,7 +74,7 @@
@@ -98,7 +98,7 @@
diff --git a/addons/purchase_requisition/views/purchase_requisition_views.xml b/addons/purchase_requisition/views/purchase_requisition_views.xml index 0308949a4bb..8ef7677c1ce 100644 --- a/addons/purchase_requisition/views/purchase_requisition_views.xml +++ b/addons/purchase_requisition/views/purchase_requisition_views.xml @@ -148,7 +148,7 @@ - +
diff --git a/addons/purchase_requisition/views/purchase_views.xml b/addons/purchase_requisition/views/purchase_views.xml index 2ef157538e6..1a0c99b6f8c 100644 --- a/addons/purchase_requisition/views/purchase_views.xml +++ b/addons/purchase_requisition/views/purchase_views.xml @@ -8,7 +8,7 @@ - + diff --git a/addons/purchase_stock/tests/test_replenish_wizard.py b/addons/purchase_stock/tests/test_replenish_wizard.py index 08d4d78310f..08bb1f998e3 100644 --- a/addons/purchase_stock/tests/test_replenish_wizard.py +++ b/addons/purchase_stock/tests/test_replenish_wizard.py @@ -6,7 +6,7 @@ from odoo.addons.stock.tests.common import TestStockCommon class TestReplenishWizard(TestStockCommon): def setUp(self): super(TestReplenishWizard, self).setUp() - self.vendor = self.env['res.partner'].create(dict(name='The Replenisher', supplier=True)) + self.vendor = self.env['res.partner'].create(dict(name='The Replenisher')) self.product1_price = 500 # Create a supplier info witch the previous vendor diff --git a/addons/sale/views/res_partner_views.xml b/addons/sale/views/res_partner_views.xml index d8508ec340d..f7dd6257c69 100644 --- a/addons/sale/views/res_partner_views.xml +++ b/addons/sale/views/res_partner_views.xml @@ -42,7 +42,6 @@
diff --git a/addons/sale/views/sale_views.xml b/addons/sale/views/sale_views.xml index e0bc1ef3632..3d2857b78e4 100644 --- a/addons/sale/views/sale_views.xml +++ b/addons/sale/views/sale_views.xml @@ -287,7 +287,7 @@
- + diff --git a/addons/sale_coupon/tests/common.py b/addons/sale_coupon/tests/common.py index e6b8bd1b359..a5db1748b39 100644 --- a/addons/sale_coupon/tests/common.py +++ b/addons/sale_coupon/tests/common.py @@ -20,7 +20,6 @@ class TestSaleCouponCommon(TestSaleProductAttributeValueSetup): # create partner for sale order. self.steve = self.env['res.partner'].create({ 'name': 'Steve Bucknor', - 'customer': True, 'email': 'steve.bucknor@example.com', }) diff --git a/addons/sale_coupon/tests/test_program_numbers.py b/addons/sale_coupon/tests/test_program_numbers.py index fa134498946..610c373adb1 100644 --- a/addons/sale_coupon/tests/test_program_numbers.py +++ b/addons/sale_coupon/tests/test_program_numbers.py @@ -19,7 +19,6 @@ class TestSaleCouponProgramNumbers(TestSaleCouponCommon): self.littleServer = self.env.ref('product.consu_delivery_02') self.steve = self.env['res.partner'].create({ 'name': 'Steve Bucknor', - 'customer': True, 'email': 'steve.bucknor@example.com', }) self.empty_order = self.env['sale.order'].create({ diff --git a/addons/sale_purchase/tests/common.py b/addons/sale_purchase/tests/common.py index 6012de38181..5d96690b627 100644 --- a/addons/sale_purchase/tests/common.py +++ b/addons/sale_purchase/tests/common.py @@ -35,7 +35,6 @@ class TestCommonSalePurchaseNoChart(TestCommonSaleNoChart): cls.partner_vendor_service = cls.env['res.partner'].create({ 'name': 'Super Service Supplier', 'email': 'supplier.serv@supercompany.com', - 'supplier': True, }) cls.service_purchase_1 = cls.env['product.product'].create({ diff --git a/addons/sale_timesheet/tests/test_project_billing.py b/addons/sale_timesheet/tests/test_project_billing.py index da6b5ee6eb6..7f0d533af8c 100644 --- a/addons/sale_timesheet/tests/test_project_billing.py +++ b/addons/sale_timesheet/tests/test_project_billing.py @@ -22,7 +22,6 @@ class TestProjectBilling(TestCommonSaleTimesheetNoChart): cls.partner_2 = cls.env['res.partner'].create({ 'name': 'Customer from the South', 'email': 'customer.usd@south.com', - 'customer': True, 'property_account_payable_id': cls.account_payable.id, 'property_account_receivable_id': cls.account_receivable.id, }) diff --git a/addons/sale_timesheet/wizard/project_create_sale_order.py b/addons/sale_timesheet/wizard/project_create_sale_order.py index 26e11d11a0f..4c9c4e0faa7 100644 --- a/addons/sale_timesheet/wizard/project_create_sale_order.py +++ b/addons/sale_timesheet/wizard/project_create_sale_order.py @@ -27,7 +27,7 @@ class ProjectCreateSalesOrder(models.TransientModel): return result project_id = fields.Many2one('project.project', "Project", domain=[('sale_line_id', '=', False)], help="Project for which we are creating a sales order", required=True) - partner_id = fields.Many2one('res.partner', string="Customer", domain=[('customer', '=', True)], required=True, help="Customer of the sales order") + partner_id = fields.Many2one('res.partner', string="Customer", required=True, help="Customer of the sales order") product_id = fields.Many2one('product.product', domain=[('type', '=', 'service'), ('invoice_policy', '=', 'delivery'), ('service_type', '=', 'timesheet')], string="Service", help="Product of the sales order item. Must be a service invoiced based on timesheets on tasks.") price_unit = fields.Float("Unit Price", help="Unit price of the sales order item.") currency_id = fields.Many2one('res.currency', string="Currency", related='product_id.currency_id', readonly=False) diff --git a/addons/stock/data/stock_demo.xml b/addons/stock/data/stock_demo.xml index 43154eef9f8..ceaf8bad0aa 100644 --- a/addons/stock/data/stock_demo.xml +++ b/addons/stock/data/stock_demo.xml @@ -135,8 +135,6 @@ My Company, Chicago - - 1 90 Streets Avenue diff --git a/addons/stock_account/tests/test_anglo_saxon_valuation_reconciliation_common.py b/addons/stock_account/tests/test_anglo_saxon_valuation_reconciliation_common.py index a7b6d7ad544..f56f2d9d282 100644 --- a/addons/stock_account/tests/test_anglo_saxon_valuation_reconciliation_common.py +++ b/addons/stock_account/tests/test_anglo_saxon_valuation_reconciliation_common.py @@ -125,8 +125,6 @@ class ValuationReconciliationTestCase(AccountingTestCase): self.test_partner = self.env['res.partner'].create({ 'name': 'Ruben Rybnik', - 'supplier': True, - 'customer': True, }) self.product_price_unit = 66.0 diff --git a/addons/survey/tests/common.py b/addons/survey/tests/common.py index def5c81e2bb..bf73f5ecb47 100644 --- a/addons/survey/tests/common.py +++ b/addons/survey/tests/common.py @@ -60,7 +60,6 @@ class SurveyCase(common.SavepointCase): self.customer = self.env['res.partner'].create({ 'name': 'Caroline Customer', 'email': 'customer@example.com', - 'customer': True, }) self.survey = self.env['survey.survey'].with_user(self.survey_manager).create({ diff --git a/addons/web/static/tests/fields/relational_fields/field_many2one_tests.js b/addons/web/static/tests/fields/relational_fields/field_many2one_tests.js index b32f8478ccf..8145990839f 100644 --- a/addons/web/static/tests/fields/relational_fields/field_many2one_tests.js +++ b/addons/web/static/tests/fields/relational_fields/field_many2one_tests.js @@ -338,7 +338,7 @@ QUnit.module('fields', {}, function () { '' + '' + diff --git a/addons/website_crm_partner_assign/views/res_partner_views.xml b/addons/website_crm_partner_assign/views/res_partner_views.xml index dba9d112162..bc42280abfb 100644 --- a/addons/website_crm_partner_assign/views/res_partner_views.xml +++ b/addons/website_crm_partner_assign/views/res_partner_views.xml @@ -137,7 +137,7 @@
- +
diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 823011b0d03..93605643fd3 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -635,7 +635,6 @@ class WebsiteSale(http.Controller): if k not in ('field_required', 'partner_id', 'callback', 'submitted'): # classic case _logger.debug("website_sale postprocess: %s value has been dropped (empty or not writable)" % k) - new_values['customer'] = True new_values['team_id'] = request.website.salesteam_id and request.website.salesteam_id.id new_values['user_id'] = request.website.salesperson_id and request.website.salesperson_id.id diff --git a/addons/website_slides/tests/common.py b/addons/website_slides/tests/common.py index 788bf70b9e2..5be2442d96b 100644 --- a/addons/website_slides/tests/common.py +++ b/addons/website_slides/tests/common.py @@ -37,7 +37,6 @@ class SlidesCase(common.SavepointCase): self.customer = self.env['res.partner'].create({ 'name': 'Caroline Customer', 'email': 'customer@example.com', - 'customer': True, }) self.channel = self.env['slide.channel'].with_user(self.user_publisher).create({ diff --git a/odoo/addons/base/data/res_partner_data.xml b/odoo/addons/base/data/res_partner_data.xml index 7e76d1a809e..ee4b4fbf31c 100644 --- a/odoo/addons/base/data/res_partner_data.xml +++ b/odoo/addons/base/data/res_partner_data.xml @@ -4,7 +4,6 @@ My Company - @@ -18,7 +17,6 @@ System - root@example.com @@ -26,7 +24,6 @@ Administrator - admin@example.com diff --git a/odoo/addons/base/data/res_partner_demo.xml b/odoo/addons/base/data/res_partner_demo.xml index 35fffb4df8d..39e3c8dedd6 100644 --- a/odoo/addons/base/data/res_partner_demo.xml +++ b/odoo/addons/base/data/res_partner_demo.xml @@ -42,8 +42,6 @@ Wood Corner - 1 - 1 1164 Cambridge Drive White Tanks @@ -71,7 +69,6 @@ Gemini Furniture - 1 1 1128 Lunetta Street @@ -88,8 +85,6 @@ Ready Mat - - 1 92 Emily Drive Columbia @@ -118,8 +113,6 @@ Azure Interior - 1 - 1 1 3404 Edgewood Road Jonesboro @@ -152,8 +145,6 @@ Service Manager willie.burke80@example.com (846)-523-2111 - 1 - Ron Gibson @@ -161,8 +152,6 @@ Store Manager ron.gibson76@example.com (976)-397-4091 - 1 - Douglas Fletcher @@ -191,8 +180,6 @@ Production Supervisor billy.fox45@example.com (915)-498-5611 - 1 - Jesse Brown @@ -268,10 +255,8 @@ Tom Ruiz Software Developer - 1 tom.ruiz89@example.com (102)-834-1602 - Colleen Diaz @@ -293,8 +278,6 @@ Sales Representative addison.olson28@example.com (223)-399-7637 - 1 - Sandra Neal @@ -321,14 +304,12 @@ Chester Reed Chief Executive Officer (CEO) - chester.reed79@example.com (979)-904-8902 Dwayne Newman Chief Operations Officer (COO) - dwayne.newman28@example.com (614)-177-4937 diff --git a/odoo/addons/base/data/res_users_demo.xml b/odoo/addons/base/data/res_users_demo.xml index d2eb5c064b8..4f4c580dfb8 100644 --- a/odoo/addons/base/data/res_users_demo.xml +++ b/odoo/addons/base/data/res_users_demo.xml @@ -5,7 +5,6 @@ Marc Demo - YourCompany 3575 Buena Vista Avenue Eugene @@ -64,8 +63,6 @@ Joel Willis joel.willis63@example.com - - 858 Lynn Street Bayonne diff --git a/odoo/addons/base/models/res_company.py b/odoo/addons/base/models/res_company.py index 0d76629f661..cc5ddc75087 100644 --- a/odoo/addons/base/models/res_company.py +++ b/odoo/addons/base/models/res_company.py @@ -219,7 +219,6 @@ class Company(models.Model): 'name': vals['name'], 'is_company': True, 'image': vals.get('logo'), - 'customer': False, 'email': vals.get('email'), 'phone': vals.get('phone'), 'website': vals.get('website'), diff --git a/odoo/addons/base/models/res_users.py b/odoo/addons/base/models/res_users.py index adee7826fff..d7ef51862cd 100644 --- a/odoo/addons/base/models/res_users.py +++ b/odoo/addons/base/models/res_users.py @@ -437,7 +437,7 @@ class Users(models.Model): @api.model_create_multi def create(self, vals_list): - users = super(Users, self.with_context(default_customer=False)).create(vals_list) + users = super(Users, self).create(vals_list) for user in users: user.partner_id.active = user.active if user.partner_id.company_id: diff --git a/odoo/addons/base/tests/test_api.py b/odoo/addons/base/tests/test_api.py index fcce10430ef..b0e9a4bfdad 100644 --- a/odoo/addons/base/tests/test_api.py +++ b/odoo/addons/base/tests/test_api.py @@ -465,16 +465,16 @@ class TestAPI(common.TransactionCase): def test_80_filter(self): """ Check filter on recordsets. """ ps = self.env['res.partner'].search([]) - customers = ps.browse([p.id for p in ps if p.customer]) + customers = ps.browse([p.id for p in ps if p.employee]) # filter on a single field - self.assertEqual(ps.filtered(lambda p: p.customer), customers) - self.assertEqual(ps.filtered('customer'), customers) + self.assertEqual(ps.filtered(lambda p: p.employee), customers) + self.assertEqual(ps.filtered('employee'), customers) # filter on a sequence of fields self.assertEqual( - ps.filtered(lambda p: p.parent_id.customer), - ps.filtered('parent_id.customer') + ps.filtered(lambda p: p.parent_id.employee), + ps.filtered('parent_id.employee') ) @mute_logger('odoo.models') diff --git a/odoo/addons/base/tests/test_orm.py b/odoo/addons/base/tests/test_orm.py index 33a36239457..b16d229b495 100644 --- a/odoo/addons/base/tests/test_orm.py +++ b/odoo/addons/base/tests/test_orm.py @@ -315,7 +315,7 @@ class TestInherits(TransactionCase): user_foo = self.env['res.users'].create({ 'name': 'Foo', 'login': 'foo', - 'supplier': True, + 'employee': True, }) foo_before, = user_foo.read() del foo_before['__last_update'] @@ -327,7 +327,7 @@ class TestInherits(TransactionCase): self.assertEqual(user_bar.name, 'Foo (copy)') self.assertEqual(user_bar.login, 'bar') - self.assertEqual(user_foo.supplier, user_bar.supplier) + self.assertEqual(user_foo.employee, user_bar.employee) self.assertNotEqual(user_foo.id, user_bar.id) self.assertNotEqual(user_foo.partner_id.id, user_bar.partner_id.id) diff --git a/odoo/addons/base/views/res_partner_views.xml b/odoo/addons/base/views/res_partner_views.xml index c6b748463fb..ee59fe130c0 100644 --- a/odoo/addons/base/views/res_partner_views.xml +++ b/odoo/addons/base/views/res_partner_views.xml @@ -149,7 +149,7 @@