main #7
@@ -168,6 +168,7 @@ def register():
|
|||||||
purchase.DocTypeTemplate,
|
purchase.DocTypeTemplate,
|
||||||
purchase.PurchaseStrategy,
|
purchase.PurchaseStrategy,
|
||||||
purchase.PriceComposition,
|
purchase.PriceComposition,
|
||||||
|
purchase.QualityAnalysis,
|
||||||
backtoback.Backtoback,
|
backtoback.Backtoback,
|
||||||
dimension.AnalyticDimension,
|
dimension.AnalyticDimension,
|
||||||
dimension.AnalyticDimensionValue,
|
dimension.AnalyticDimensionValue,
|
||||||
|
|||||||
@@ -529,6 +529,44 @@ class PriceComposition(ModelSQL,ModelView):
|
|||||||
component = fields.Char("Component")
|
component = fields.Char("Component")
|
||||||
price = fields.Numeric("Price")
|
price = fields.Numeric("Price")
|
||||||
|
|
||||||
|
class QualityAnalysis(ModelSQL,ModelView):
|
||||||
|
__name__ = 'quality.analysis'
|
||||||
|
|
||||||
|
line = fields.Many2One('purchase.line',"Purchase Line")
|
||||||
|
reference = fields.Char("Reference")
|
||||||
|
date = fields.Date("Analysis date")
|
||||||
|
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."
|
||||||
|
)
|
||||||
|
|
||||||
|
product = fields.Function(
|
||||||
|
fields.Many2One('product.product', "Product"),
|
||||||
|
'on_change_with_product'
|
||||||
|
)
|
||||||
|
|
||||||
|
attribute_set = fields.Function(
|
||||||
|
fields.Many2One('product.attribute.set', "Attribute Set"),
|
||||||
|
'on_change_with_attribute_set'
|
||||||
|
)
|
||||||
|
|
||||||
|
@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('line')
|
||||||
|
def on_change_with_product(self, name=None):
|
||||||
|
if self.line:
|
||||||
|
return self.line.product
|
||||||
|
|
||||||
class Line(metaclass=PoolMeta):
|
class Line(metaclass=PoolMeta):
|
||||||
__name__ = 'purchase.line'
|
__name__ = 'purchase.line'
|
||||||
|
|
||||||
@@ -624,6 +662,8 @@ class Line(metaclass=PoolMeta):
|
|||||||
|
|
||||||
finished = fields.Boolean("Mark as finished")
|
finished = fields.Boolean("Mark as finished")
|
||||||
|
|
||||||
|
quality_analysis = fields.One2Many('quality.analysis','line',"Quality analysis")
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def default_finished(cls):
|
def default_finished(cls):
|
||||||
return False
|
return False
|
||||||
|
|||||||
@@ -162,6 +162,12 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<field name="name">price_composition_tree</field>
|
<field name="name">price_composition_tree</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="quality_analysis_view_tree">
|
||||||
|
<field name="model">quality.analysis</field>
|
||||||
|
<field name="type">tree</field>
|
||||||
|
<field name="name">quality_analysis_tree</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
name="Pnl Report"
|
name="Pnl Report"
|
||||||
parent="purchase_trade.menu_global_reporting"
|
parent="purchase_trade.menu_global_reporting"
|
||||||
|
|||||||
5
modules/purchase_trade/view/quality_analysis_tree.xml
Normal file
5
modules/purchase_trade/view/quality_analysis_tree.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<tree editable="1">
|
||||||
|
<field name="reference"/>
|
||||||
|
<field name="date"/>
|
||||||
|
<field name="attributes"/>
|
||||||
|
</tree>
|
||||||
Reference in New Issue
Block a user