[MOV] website_sale: move models in their right file

This commit is contained in:
Thibault Delavallée
2017-09-27 13:21:53 +02:00
committed by Yannick Tivisse
parent 2b30a585cf
commit b53ce01b16
4 changed files with 26 additions and 16 deletions
+2
View File
@@ -5,6 +5,8 @@ from . import crm_team
from . import ir_http
from . import mail_compose_message
from . import product
from . import res_country
from . import res_partner
from . import sale_order
from . import website
from . import res_config_settings
+14
View File
@@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class ResCountry(models.Model):
_inherit = 'res.country'
def get_website_sale_countries(self, mode='billing'):
return self.sudo().search([])
def get_website_sale_states(self, mode='billing'):
return self.sudo().state_ids
+10
View File
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, fields
class ResPartner(models.Model):
_inherit = 'res.partner'
last_website_so_id = fields.Many2one('sale.order', string='Last Online Sales Order')
-16
View File
@@ -245,19 +245,3 @@ class SaleOrder(models.Model):
self.payment_tx_id.state = 'done'
else:
raise ValidationError(_("The quote should be sent and the payment acquirer type should be manual or wire transfer"))
class ResCountry(models.Model):
_inherit = 'res.country'
def get_website_sale_countries(self, mode='billing'):
return self.sudo().search([])
def get_website_sale_states(self, mode='billing'):
return self.sudo().state_ids
class ResPartner(models.Model):
_inherit = 'res.partner'
last_website_so_id = fields.Many2one('sale.order', string='Last Online Sales Order')