智能工厂的销售模块添加业务平台订单对象
This commit is contained in:
39
sf_bf_connect/models/sf_process_order.py
Normal file
39
sf_bf_connect/models/sf_process_order.py
Normal file
@@ -0,0 +1,39 @@
|
||||
from odoo import models,fields
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class Order(models.Model):
|
||||
_name = 'sf.order'
|
||||
|
||||
_inherit = ['portal.mixin', 'mail.thread', 'mail.activity.mixin', 'utm.mixin']
|
||||
_description = '业务平台订单'
|
||||
|
||||
order_number = fields.Char('订单号')
|
||||
date_order = fields.Datetime('订购日期')
|
||||
validity_date = fields.Date('到期')
|
||||
partner_id = fields.Many2one(
|
||||
'res.partner', string='客户',
|
||||
domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]", )
|
||||
|
||||
sale_order_template_id = fields.Many2one('sf.order.template', '报价单模板')
|
||||
pricelist_id = fields.Many2one('sf.pricelist', string='付款条款', )
|
||||
deadline_of_delivery= fields.Datetime('交货截止日期')
|
||||
order_line = fields.One2many('sale.order.line', 'order_id', string='Order Lines', states={'cancel': [('readonly', True)], 'done': [('readonly', True)]}, copy=True, auto_join=True)
|
||||
|
||||
|
||||
class OrderTemplate(models.Model):
|
||||
_name = "sf.order.template"
|
||||
_description = "报价单模板"
|
||||
|
||||
name = fields.Char('名称', required=True)
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
class Pricelist(models.Model):
|
||||
_name = "sf.pricelist"
|
||||
_description = "付款条款"
|
||||
|
||||
name = fields.Char('名称')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user