mirror of
https://bitbucket.org/presik/trytonpsk-crm.git
synced 2023-12-14 05:22:56 +01:00
Minor fixes
This commit is contained in:
parent
93f0b6ed61
commit
77910144c4
6 changed files with 38 additions and 18 deletions
|
@ -48,7 +48,6 @@ class Opportunity(
|
||||||
['cancelled']),
|
['cancelled']),
|
||||||
}
|
}
|
||||||
_depends_stop = ['state']
|
_depends_stop = ['state']
|
||||||
|
|
||||||
number = fields.Char('Number', readonly=True, required=True)
|
number = fields.Char('Number', readonly=True, required=True)
|
||||||
party_contact = fields.Char('Party Contact', states=_states_opp)
|
party_contact = fields.Char('Party Contact', states=_states_opp)
|
||||||
reference = fields.Char('Reference', states=_states_opp)
|
reference = fields.Char('Reference', states=_states_opp)
|
||||||
|
@ -738,6 +737,14 @@ class CrmOpportunityFollowUp(sequence_ordered(), ModelSQL, ModelView):
|
||||||
action = fields.Char('Action')
|
action = fields.Char('Action')
|
||||||
notes = fields.Text('Notes')
|
notes = fields.Text('Notes')
|
||||||
done_by = fields.Many2One('res.user', 'Done By')
|
done_by = fields.Many2One('res.user', 'Done By')
|
||||||
|
state = fields.Selection([
|
||||||
|
('draft', "Draft"),
|
||||||
|
('done', "Done"),
|
||||||
|
], "State", required=False, readonly=True)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def default_state():
|
||||||
|
return 'draft'
|
||||||
|
|
||||||
|
|
||||||
class CrmOpportunityLine(sequence_ordered(), ModelSQL, ModelView):
|
class CrmOpportunityLine(sequence_ordered(), ModelSQL, ModelView):
|
||||||
|
@ -745,8 +752,14 @@ class CrmOpportunityLine(sequence_ordered(), ModelSQL, ModelView):
|
||||||
__name__ = "crm.opportunity.line"
|
__name__ = "crm.opportunity.line"
|
||||||
_history = True
|
_history = True
|
||||||
_states = {
|
_states = {
|
||||||
'readonly': Eval('opportunity_state').in_(
|
'readonly': Eval('opportunity_state').in_([
|
||||||
['quote_revision', 'quote_approbation', 'customer_approbation', 'review', 'accepted', 'lost', 'cancelled']),
|
'quote_revision',
|
||||||
|
'quote_approbation',
|
||||||
|
'customer_approbation',
|
||||||
|
'review',
|
||||||
|
'accepted',
|
||||||
|
'lost',
|
||||||
|
'cancelled']),
|
||||||
}
|
}
|
||||||
_depends = ['opportunity_state']
|
_depends = ['opportunity_state']
|
||||||
|
|
||||||
|
@ -781,11 +794,13 @@ class CrmOpportunityLine(sequence_ordered(), ModelSQL, ModelView):
|
||||||
tax = fields.Function(fields.Float('Tax Line'), 'get_tax_line')
|
tax = fields.Function(fields.Float('Tax Line'), 'get_tax_line')
|
||||||
total_line = fields.Function(fields.Integer('Total Line'), 'get_total_line')
|
total_line = fields.Function(fields.Integer('Total Line'), 'get_total_line')
|
||||||
base_tax = fields.Function(fields.Float('Base Tax'), 'get_base_tax')
|
base_tax = fields.Function(fields.Float('Base Tax'), 'get_base_tax')
|
||||||
description = fields.Function(fields.Text('Description'),
|
description = fields.Text('Description')
|
||||||
'on_change_with_description')
|
|
||||||
unit_price = fields.Numeric('Unit Price', digits=(16, 2))
|
unit_price = fields.Numeric('Unit Price', digits=(16, 2))
|
||||||
|
start_invoice_date = fields.Date('Start Invoice Date')
|
||||||
total_line_with_tax = fields.Function(fields.Integer('Total Line'),
|
total_line_with_tax = fields.Function(fields.Integer('Total Line'),
|
||||||
'get_total_line_with_tax')
|
'get_total_line_with_tax')
|
||||||
|
payment_term = fields.Many2One('account.invoice.payment_term',
|
||||||
|
'Payment Term')
|
||||||
|
|
||||||
del _states, _depends
|
del _states, _depends
|
||||||
|
|
||||||
|
@ -848,19 +863,14 @@ class CrmOpportunityLine(sequence_ordered(), ModelSQL, ModelView):
|
||||||
if self.product:
|
if self.product:
|
||||||
return self.product.list_price
|
return self.product.list_price
|
||||||
|
|
||||||
@fields.depends('product')
|
# Product = Pool().get('product.product')
|
||||||
def on_change_with_description(self, name=None):
|
# sale_line = SaleLine(
|
||||||
if self.product:
|
# type='line',
|
||||||
return self.product.description
|
# product=self.product,
|
||||||
|
# sale=sale,
|
||||||
# Product = Pool().get('product.product')
|
# description=None,
|
||||||
# sale_line = SaleLine(
|
# )
|
||||||
# type='line',
|
# return sale_line
|
||||||
# product=self.product,
|
|
||||||
# sale=sale,
|
|
||||||
# description=None,
|
|
||||||
# )
|
|
||||||
# return sale_line
|
|
||||||
|
|
||||||
|
|
||||||
@fields.depends('product', 'unit')
|
@fields.depends('product', 'unit')
|
||||||
|
|
|
@ -8,6 +8,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<field name="action"/>
|
<field name="action"/>
|
||||||
<label name="done_by"/>
|
<label name="done_by"/>
|
||||||
<field name="done_by"/>
|
<field name="done_by"/>
|
||||||
|
<label name="state"/>
|
||||||
|
<field name="state"/>
|
||||||
<separator name="notes" colspan="4"/>
|
<separator name="notes" colspan="4"/>
|
||||||
<field name="notes" colspan="4"/>
|
<field name="notes" colspan="4"/>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -5,4 +5,5 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<field name="follow_date" expand="1"/>
|
<field name="follow_date" expand="1"/>
|
||||||
<field name="action" expand="1"/>
|
<field name="action" expand="1"/>
|
||||||
<field name="done_by" expand="1"/>
|
<field name="done_by" expand="1"/>
|
||||||
|
<field name="state" expand="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|
|
@ -16,6 +16,10 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<field name="unit_price"/>
|
<field name="unit_price"/>
|
||||||
<label name="billing_frecuency"/>
|
<label name="billing_frecuency"/>
|
||||||
<field name="billing_frecuency"/>
|
<field name="billing_frecuency"/>
|
||||||
|
<label name="payment_term"/>
|
||||||
|
<field name="payment_term"/>
|
||||||
|
<label name="start_invoice_date"/>
|
||||||
|
<field name="start_invoice_date"/>
|
||||||
<!-- <separator string="Description" colspan="4"/> -->
|
<!-- <separator string="Description" colspan="4"/> -->
|
||||||
<field name="description" colspan="4"/>
|
<field name="description" colspan="4"/>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -8,4 +8,6 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<field name="quantity" symbol="unit"/>
|
<field name="quantity" symbol="unit"/>
|
||||||
<field name="unit_price" symbol="unit"/>
|
<field name="unit_price" symbol="unit"/>
|
||||||
<field name="billing_frecuency" expand="1"/>
|
<field name="billing_frecuency" expand="1"/>
|
||||||
|
<field name="start_invoice_date" expand="1"/>
|
||||||
|
<field name="payment_term" expand="1"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|
|
@ -6,6 +6,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<field name="reference" expand="1"/>
|
<field name="reference" expand="1"/>
|
||||||
<field name="start_date"/>
|
<field name="start_date"/>
|
||||||
<field name="end_date"/>
|
<field name="end_date"/>
|
||||||
|
<field name="party_contact" expand="1"/>
|
||||||
<field name="agent" expand="1"/>
|
<field name="agent" expand="1"/>
|
||||||
<field name="description" expand="1"/>
|
<field name="description" expand="1"/>
|
||||||
<field name="party" expand="1"/>
|
<field name="party" expand="1"/>
|
||||||
|
|
Loading…
Reference in a new issue