16.03.26
This commit is contained in:
@@ -308,7 +308,7 @@ class Purchase(metaclass=PoolMeta):
|
||||
return certification[0].id
|
||||
|
||||
@classmethod
|
||||
def default_certif(cls):
|
||||
def default_association(cls):
|
||||
Association = Pool().get('purchase.association')
|
||||
association = Association.search(['id','>',0])
|
||||
if association:
|
||||
|
||||
@@ -233,15 +233,6 @@ class Sale(metaclass=PoolMeta):
|
||||
tol_max = fields.Numeric("Tol + in %")
|
||||
tol_min_qt = fields.Numeric("Tol -")
|
||||
tol_max_qt = fields.Numeric("Tol +")
|
||||
# certification = fields.Selection([
|
||||
# (None, ''),
|
||||
# ('bci', 'BCI'),
|
||||
# ],"Certification")
|
||||
# weight_basis = fields.Selection([
|
||||
# (None, ''),
|
||||
# ('ncsw', 'NCSW'),
|
||||
# ('nlw', 'NLW'),
|
||||
# ], 'Weight basis')
|
||||
certif = fields.Many2One('purchase.certification',"Certification",states={'invisible': Eval('company_visible'),})
|
||||
wb = fields.Many2One('purchase.weight.basis',"Weight basis")
|
||||
association = fields.Many2One('purchase.association',"Association",states={'invisible': Eval('company_visible'),})
|
||||
@@ -265,6 +256,35 @@ class Sale(metaclass=PoolMeta):
|
||||
def get_company_info(self,name):
|
||||
return (self.company.party.name == 'MELYA')
|
||||
|
||||
@classmethod
|
||||
def default_wb(cls):
|
||||
WB = Pool().get('purchase.weight.basis')
|
||||
wb = WB.search(['id','>',0])
|
||||
if wb:
|
||||
return wb[0].id
|
||||
|
||||
@classmethod
|
||||
def default_certif(cls):
|
||||
Certification = Pool().get('purchase.certification')
|
||||
certification = Certification.search(['id','>',0])
|
||||
if certification:
|
||||
return certification[0].id
|
||||
|
||||
@classmethod
|
||||
def default_association(cls):
|
||||
Association = Pool().get('purchase.association')
|
||||
association = Association.search(['id','>',0])
|
||||
if association:
|
||||
return association[0].id
|
||||
|
||||
@classmethod
|
||||
def default_tol_min(cls):
|
||||
return 0
|
||||
|
||||
@classmethod
|
||||
def default_tol_max(cls):
|
||||
return 0
|
||||
|
||||
@property
|
||||
def report_terms(self):
|
||||
if self.lines:
|
||||
|
||||
@@ -92,14 +92,14 @@ class Sale(
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
})
|
||||
sale_date = fields.Date('Sale Date',
|
||||
sale_date = fields.Date('Sale Date', required=True,
|
||||
states={
|
||||
'readonly': ~Eval('state').in_(['draft', 'quotation']),
|
||||
'required': ~Eval('state').in_(
|
||||
['draft', 'quotation', 'cancelled']),
|
||||
})
|
||||
payment_term = fields.Many2One(
|
||||
'account.invoice.payment_term', "Payment Term", ondelete='RESTRICT',
|
||||
'account.invoice.payment_term', "Payment Term", required=True, ondelete='RESTRICT',
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
})
|
||||
@@ -443,6 +443,11 @@ class Sale(
|
||||
@staticmethod
|
||||
def default_state():
|
||||
return 'draft'
|
||||
|
||||
@classmethod
|
||||
def default_sale_date(cls):
|
||||
Date = Pool().get('ir.date')
|
||||
return Date.today()
|
||||
|
||||
@classmethod
|
||||
def default_currency(cls, **pattern):
|
||||
|
||||
Reference in New Issue
Block a user