IMP connector_walmart Add the ability to set the Salesperson on imported Walmart orders.

This commit is contained in:
Jared Kipe
2019-06-03 11:34:51 -07:00
parent d76c1a2fb6
commit c861c1fbf3
4 changed files with 9 additions and 1 deletions

View File

@@ -3,7 +3,7 @@
{
'name': 'Walmart Connector',
'version': '12.0.1.0.0',
'version': '12.0.1.1.0',
'category': 'Connector',
'depends': [
'account',

View File

@@ -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.")

View File

@@ -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"

View File

@@ -30,6 +30,7 @@
<field name="analytic_account_id"/>
<field name="fiscal_position_id"/>
<field name="team_id"/>
<field name="user_id"/>
<field name="sale_prefix"/>
<field name="payment_mode_id"/>
<field name="acknowledge_order"/>