diff --git a/modules/purchase_trade/pricing.py b/modules/purchase_trade/pricing.py index 6bc1231..4eb3aad 100755 --- a/modules/purchase_trade/pricing.py +++ b/modules/purchase_trade/pricing.py @@ -84,7 +84,7 @@ class MtmStrategy(ModelSQL, ModelView): ) components = fields.One2Many( - 'mtm.component', 'strategy', "Components" + 'pricing.component', 'strategy', "Components" ) @classmethod @@ -271,9 +271,21 @@ class Component(ModelSQL, ModelView): "Component" __name__ = 'pricing.component' + strategy = fields.Many2One( + 'mtm.strategy', "Strategy", + required=False, ondelete='CASCADE' + ) + + price_source_type = fields.Selection([ + ('curve', 'Curve'), + ('matrix', 'Matrix'), + # ('manual', 'Manual'), + ], "Price Source", required=True) + fix_type = fields.Many2One('price.fixtype',"Fixation type") ratio = fields.Numeric("%") price_index = fields.Many2One('price.price',"Curve") + price_matrix = fields.Many2One('price.matrix', "Price Matrix") currency = fields.Function(fields.Many2One('currency.currency',"Curr."),'get_cur') auto = fields.Boolean("Auto") fallback = fields.Boolean("Fallback") diff --git a/modules/purchase_trade/view/component_tree_sequence.xml b/modules/purchase_trade/view/component_tree_sequence.xml index 864c4cc..e489eb0 100755 --- a/modules/purchase_trade/view/component_tree_sequence.xml +++ b/modules/purchase_trade/view/component_tree_sequence.xml @@ -1,7 +1,9 @@ + +