From c861c1fbf33a7d97a4379e9bc44e1dac25e195f3 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Mon, 3 Jun 2019 11:34:51 -0700 Subject: [PATCH] IMP `connector_walmart` Add the ability to set the Salesperson on imported Walmart orders. --- connector_walmart/__manifest__.py | 2 +- connector_walmart/models/sale_order/importer.py | 5 +++++ connector_walmart/models/walmart_backend/common.py | 2 ++ connector_walmart/views/walmart_backend_views.xml | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/connector_walmart/__manifest__.py b/connector_walmart/__manifest__.py index 33bca3fb..534a6e33 100644 --- a/connector_walmart/__manifest__.py +++ b/connector_walmart/__manifest__.py @@ -3,7 +3,7 @@ { 'name': 'Walmart Connector', - 'version': '12.0.1.0.0', + 'version': '12.0.1.1.0', 'category': 'Connector', 'depends': [ 'account', diff --git a/connector_walmart/models/sale_order/importer.py b/connector_walmart/models/sale_order/importer.py index adf4c099..f10518d3 100644 --- a/connector_walmart/models/sale_order/importer.py +++ b/connector_walmart/models/sale_order/importer.py @@ -123,6 +123,11 @@ class SaleOrderImportMapper(Component): if self.backend_record.team_id: return {'team_id': self.backend_record.team_id.id} + @mapping + def user_id(self, record): + if self.backend_record.user_id: + return {'user_id': self.backend_record.user_id.id} + @mapping def payment_mode_id(self, record): assert self.backend_record.payment_mode_id, ("Payment mode must be specified.") diff --git a/connector_walmart/models/walmart_backend/common.py b/connector_walmart/models/walmart_backend/common.py index 4f4d60cc..673857f1 100644 --- a/connector_walmart/models/walmart_backend/common.py +++ b/connector_walmart/models/walmart_backend/common.py @@ -59,6 +59,8 @@ class WalmartBackend(models.Model): 'field on the sale order created by the connector.' ) team_id = fields.Many2one(comodel_name='crm.team', string='Sales Team') + user_id = fields.Many2one(comodel_name='res.users', string='Salesperson', + help="Default Salesperson for newly imported orders.") sale_prefix = fields.Char( string='Sale Prefix', help="A prefix put before the name of imported sales orders.\n" diff --git a/connector_walmart/views/walmart_backend_views.xml b/connector_walmart/views/walmart_backend_views.xml index af4c84e6..00814d97 100644 --- a/connector_walmart/views/walmart_backend_views.xml +++ b/connector_walmart/views/walmart_backend_views.xml @@ -30,6 +30,7 @@ +