09.03.26
This commit is contained in:
@@ -22,6 +22,7 @@ class Month(ModelView, ModelSQL):
|
||||
is_cotation = fields.Boolean("Cotation month")
|
||||
beg_date = fields.Date("Date from")
|
||||
end_date = fields.Date("Date end")
|
||||
description = fields.Char("Description")
|
||||
|
||||
class ProductMonth(ModelView, ModelSQL):
|
||||
"Product month"
|
||||
|
||||
@@ -18,6 +18,9 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<label name="currency"/>
|
||||
<field name="currency"/>
|
||||
<newline/>
|
||||
<label name="lc_date"/>
|
||||
<field name="lc_date"/>
|
||||
<newline/>
|
||||
<label name="certif"/>
|
||||
<field name="certif"/>
|
||||
</group>
|
||||
|
||||
@@ -82,6 +82,7 @@ class Party(metaclass=PoolMeta):
|
||||
association = fields.Many2One('purchase.association',"Association")
|
||||
execution = fields.One2Many('party.execution','party',"")
|
||||
sla = fields.One2Many('party.execution.sla','party', "Sla")
|
||||
initial = fields.Char("Initials")
|
||||
|
||||
def IsAvailableForControl(self,sh):
|
||||
return True
|
||||
|
||||
@@ -235,11 +235,14 @@ class PurchaseCertificationWeightBasis(ModelSQL,ModelView):
|
||||
__name__ = 'purchase.weight.basis'
|
||||
name = fields.Char("Name")
|
||||
qt_type = fields.Many2One('lot.qt.type',"Associated type to final invoice")
|
||||
description = fields.Char("Description")
|
||||
|
||||
class PurchaseAssociation(ModelSQL,ModelView):
|
||||
"Association"
|
||||
__name__ = 'purchase.association'
|
||||
name = fields.Char("Name")
|
||||
party = fields.Many2One('party.party',"Party")
|
||||
description = fields.Char("Description")
|
||||
|
||||
class PurchaseCrop(ModelSQL,ModelView):
|
||||
"Crop"
|
||||
@@ -283,6 +286,7 @@ class Purchase(metaclass=PoolMeta):
|
||||
operator = fields.Many2One('party.party',"Operator")
|
||||
our_reference = fields.Char("Our Reference")
|
||||
company_visible = fields.Function(fields.Boolean("Visible"),'get_company_info')
|
||||
lc_date = fields.Date("LC date")
|
||||
|
||||
def get_company_info(self,name):
|
||||
return (self.company.party.name == 'MELYA')
|
||||
@@ -530,41 +534,6 @@ class Line(metaclass=PoolMeta):
|
||||
value=attribute.format(value)
|
||||
))
|
||||
return " | ".join(filter(None, values))
|
||||
# attributes = fields.Dict('product.attribute', 'Attributes',
|
||||
# domain=[
|
||||
# ('sets', '=', Eval('product._parent_template', {}).get('attribute_set',
|
||||
# Eval('attribute_set', -1))),
|
||||
# ],
|
||||
# states={
|
||||
# 'readonly': (~Eval('attribute_set')
|
||||
# & ~Eval('product._parent_template', {}).get('attribute_set')),
|
||||
# },
|
||||
# depends={'product.template'},
|
||||
# help="Add attributes to the variant.")
|
||||
|
||||
# attributes_name = fields.Function(fields.Char(
|
||||
# "Attributes Name",
|
||||
# states={
|
||||
# 'invisible': ~Eval('attribute_set'),
|
||||
# }),
|
||||
# 'on_change_with_attributes_name')
|
||||
|
||||
# @fields.depends('product', 'attributes')
|
||||
# def on_change_with_attributes_name(self, name=None):
|
||||
# if not self.product.attribute_set or not self.attributes:
|
||||
# return
|
||||
|
||||
# def key(attribute):
|
||||
# return getattr(attribute, 'sequence', attribute.name)
|
||||
|
||||
# values = []
|
||||
# for attribute in sorted(self.product.attribute_set.attributes, key=key):
|
||||
# if attribute.name in self.attributes:
|
||||
# value = self.attributes[attribute.name]
|
||||
# values.append(gettext('product_attribute.msg_label_value',
|
||||
# label=attribute.string,
|
||||
# value=attribute.format(value)))
|
||||
# return " | ".join(filter(None, values))
|
||||
|
||||
@classmethod
|
||||
def default_price_type(cls):
|
||||
|
||||
@@ -258,6 +258,7 @@ class Sale(metaclass=PoolMeta):
|
||||
operator = fields.Many2One('party.party',"Operator")
|
||||
our_reference = fields.Char("Our Reference")
|
||||
company_visible = fields.Function(fields.Boolean("Visible"),'get_company_info')
|
||||
lc_date = fields.Date("LC date")
|
||||
|
||||
def get_company_info(self,name):
|
||||
return (self.company.party.name == 'MELYA')
|
||||
@@ -279,7 +280,10 @@ class Sale(metaclass=PoolMeta):
|
||||
@property
|
||||
def report_price(self):
|
||||
if self.lines:
|
||||
if self.lines[0].price_type == 'fixed':
|
||||
return amount_to_currency_words(self.lines[0].unit_price)
|
||||
elif self.lines[0].price_type == 'basis':
|
||||
return amount_to_currency_words(self.lines[0].unit_price) + ' ' + self.lines[0].get_pricing_text()
|
||||
else:
|
||||
return ''
|
||||
|
||||
@@ -511,6 +515,52 @@ class SaleLine(metaclass=PoolMeta):
|
||||
premium = fields.Numeric("Premium/Discount",digits='unit')
|
||||
fee_ = fields.Many2One('fee.fee',"Fee")
|
||||
|
||||
attributes = fields.Dict(
|
||||
'product.attribute', 'Attributes',
|
||||
domain=[
|
||||
('sets', '=', Eval('attribute_set')),
|
||||
],
|
||||
states={
|
||||
'readonly': ~Eval('attribute_set'),
|
||||
},
|
||||
depends=['product', 'attribute_set'],
|
||||
help="Add attributes to the variant."
|
||||
)
|
||||
|
||||
attribute_set = fields.Function(
|
||||
fields.Many2One('product.attribute.set', "Attribute Set"),
|
||||
'on_change_with_attribute_set'
|
||||
)
|
||||
|
||||
attributes_name = fields.Function(
|
||||
fields.Char("Attributes Name"),
|
||||
'on_change_with_attributes_name'
|
||||
)
|
||||
|
||||
@fields.depends('product')
|
||||
def on_change_with_attribute_set(self, name=None):
|
||||
if self.product and self.product.template and self.product.template.attribute_set:
|
||||
return self.product.template.attribute_set.id
|
||||
|
||||
@fields.depends('product', 'attributes')
|
||||
def on_change_with_attributes_name(self, name=None):
|
||||
if not self.product or not self.product.attribute_set or not self.attributes:
|
||||
return
|
||||
|
||||
def key(attribute):
|
||||
return getattr(attribute, 'sequence', attribute.name)
|
||||
|
||||
values = []
|
||||
for attribute in sorted(self.product.attribute_set.attributes, key=key):
|
||||
if attribute.name in self.attributes:
|
||||
value = self.attributes[attribute.name]
|
||||
values.append(gettext(
|
||||
'product_attribute.msg_label_value',
|
||||
label=attribute.string,
|
||||
value=attribute.format(value)
|
||||
))
|
||||
return " | ".join(filter(None, values))
|
||||
|
||||
@classmethod
|
||||
def default_price_type(cls):
|
||||
return 'priced'
|
||||
@@ -532,6 +582,14 @@ class SaleLine(metaclass=PoolMeta):
|
||||
LotQt = Pool().get('lot.qt')
|
||||
return LotQt.search([('lot_s','=',self.lots[0].id),('lot_p','>',0)])
|
||||
|
||||
def get_pricing_text(self):
|
||||
pricing_text = ''
|
||||
if self.price_components:
|
||||
for pc in self.price_components:
|
||||
if pc.price_index:
|
||||
pricing_text += ' ' + pc.price_index.description
|
||||
return pricing_text
|
||||
|
||||
def get_date(self,trigger_event):
|
||||
trigger_date = None
|
||||
if self.estimated_date:
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
<newline/>
|
||||
<label name="association"/>
|
||||
<field name="association"/>
|
||||
<newline/>
|
||||
<label name="initial"/>
|
||||
<field name="initial"/>
|
||||
</page>
|
||||
<page string="Execution" col="4" id="ex">
|
||||
<field name="sla"/>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,6 +20,9 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<label name="currency"/>
|
||||
<field name="currency"/>
|
||||
<newline/>
|
||||
<label name="lc_date"/>
|
||||
<field name="lc_date"/>
|
||||
<newline/>
|
||||
<label name="certif"/>
|
||||
<field name="certif"/>
|
||||
</group>
|
||||
|
||||
@@ -13,6 +13,9 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<label name="product"/>
|
||||
<field name="product"
|
||||
view_ids="sale.product_view_list_sale_line"/>
|
||||
<newline/>
|
||||
<label name="attributes_name"/>
|
||||
<field name="attributes_name"/>
|
||||
<label name="concentration"/>
|
||||
<field name="concentration"/>
|
||||
<newline/>
|
||||
|
||||
Reference in New Issue
Block a user