@@ -2322,7 +2322,9 @@ class InvoiceLine(sequence_ordered(), ModelSQL, ModelView, TaxableMixin):
|
||||
& ~Id('account', 'group_account_admin').in_(
|
||||
Eval('context', {}).get('groups', []))),
|
||||
})
|
||||
summary = fields.Function(fields.Char('Summary'), 'on_change_with_summary')
|
||||
summary = fields.Function(
|
||||
fields.Char('Summary'), 'on_change_with_summary',
|
||||
searcher='search_summary')
|
||||
note = fields.Text('Note')
|
||||
taxes = fields.Many2Many('account.invoice.line-account.tax',
|
||||
'line', 'tax', 'Taxes',
|
||||
@@ -2518,6 +2520,10 @@ class InvoiceLine(sequence_ordered(), ModelSQL, ModelView, TaxableMixin):
|
||||
def on_change_with_summary(self, name=None):
|
||||
return firstline(self.description or '')
|
||||
|
||||
@classmethod
|
||||
def search_summary(cls, name, clause):
|
||||
return [('description', *clause[1:])]
|
||||
|
||||
@fields.depends(
|
||||
'type', 'quantity', 'unit_price', 'taxes_deductible_rate', 'invoice',
|
||||
'_parent_invoice.currency', 'currency', 'taxes',
|
||||
|
||||
@@ -1260,7 +1260,9 @@ class Line(sequence_ordered(), ModelSQL, ModelView):
|
||||
states={
|
||||
'readonly': Eval('purchase_state') != 'draft',
|
||||
})
|
||||
summary = fields.Function(fields.Char('Summary'), 'on_change_with_summary')
|
||||
summary = fields.Function(
|
||||
fields.Char('Summary'), 'on_change_with_summary',
|
||||
searcher='search_summary')
|
||||
note = fields.Text('Note')
|
||||
taxes = fields.Many2Many('purchase.line-account.tax',
|
||||
'line', 'tax', 'Taxes',
|
||||
@@ -1657,6 +1659,10 @@ class Line(sequence_ordered(), ModelSQL, ModelView):
|
||||
def on_change_with_summary(self, name=None):
|
||||
return firstline(self.description or '')
|
||||
|
||||
@classmethod
|
||||
def search_summary(cls, name, clause):
|
||||
return [('description', *clause[1:])]
|
||||
|
||||
@fields.depends(
|
||||
'type', 'quantity', 'unit_price',
|
||||
'purchase', '_parent_purchase.currency')
|
||||
|
||||
@@ -40,7 +40,9 @@ class PurchaseRequest(ModelSQL, ModelView):
|
||||
},
|
||||
depends={'company'})
|
||||
description = fields.Text('Description', readonly=True)
|
||||
summary = fields.Function(fields.Char('Summary'), 'on_change_with_summary')
|
||||
summary = fields.Function(
|
||||
fields.Char('Summary'), 'on_change_with_summary',
|
||||
searcher='search_summary')
|
||||
party = fields.Many2One(
|
||||
'party.party', "Party", states=STATES,
|
||||
context={
|
||||
@@ -253,6 +255,10 @@ class PurchaseRequest(ModelSQL, ModelView):
|
||||
def on_change_with_summary(self, name=None):
|
||||
return firstline(self.description or '')
|
||||
|
||||
@classmethod
|
||||
def search_summary(cls, name, clause):
|
||||
return [('description', *clause[1:])]
|
||||
|
||||
@classmethod
|
||||
def _get_origin(cls):
|
||||
'Return the set of Model names for origin Reference'
|
||||
|
||||
@@ -452,7 +452,9 @@ class PurchaseRequisitionLine(sequence_ordered(), ModelSQL, ModelView):
|
||||
help="The category of Unit of Measure for the product."),
|
||||
'on_change_with_product_uom_category')
|
||||
description = fields.Text("Description", states=_states)
|
||||
summary = fields.Function(fields.Char('Summary'), 'on_change_with_summary')
|
||||
summary = fields.Function(
|
||||
fields.Char('Summary'), 'on_change_with_summary',
|
||||
searcher='search_summary')
|
||||
quantity = fields.Float(
|
||||
"Quantity", digits='unit', required=True, states=_states)
|
||||
unit = fields.Many2One(
|
||||
@@ -523,6 +525,10 @@ class PurchaseRequisitionLine(sequence_ordered(), ModelSQL, ModelView):
|
||||
def on_change_with_summary(self, name=None):
|
||||
return firstline(self.description or '')
|
||||
|
||||
@classmethod
|
||||
def search_summary(cls, name, clause):
|
||||
return [('description', *clause[1:])]
|
||||
|
||||
@fields.depends(
|
||||
'quantity', 'unit_price',
|
||||
'requisition', '_parent_requisition.currency')
|
||||
|
||||
@@ -1376,7 +1376,9 @@ class SaleLine(TaxableMixin, sequence_ordered(), ModelSQL, ModelView):
|
||||
'readonly': Eval('sale_state') != 'draft',
|
||||
},
|
||||
depends=['sale_state'])
|
||||
summary = fields.Function(fields.Char('Summary'), 'on_change_with_summary')
|
||||
summary = fields.Function(
|
||||
fields.Char('Summary'), 'on_change_with_summary',
|
||||
searcher='search_summary')
|
||||
note = fields.Text('Note')
|
||||
taxes = fields.Many2Many('sale.line-account.tax', 'line', 'tax', 'Taxes',
|
||||
order=[('tax.sequence', 'ASC'), ('tax.id', 'ASC')],
|
||||
@@ -1725,6 +1727,10 @@ class SaleLine(TaxableMixin, sequence_ordered(), ModelSQL, ModelView):
|
||||
def on_change_with_summary(self, name=None):
|
||||
return firstline(self.description or '')
|
||||
|
||||
@classmethod
|
||||
def search_summary(cls, name, clause):
|
||||
return [('description', *clause[1:])]
|
||||
|
||||
@fields.depends(
|
||||
'type', 'quantity', 'unit_price',
|
||||
'sale', '_parent_sale.currency')
|
||||
|
||||
@@ -575,7 +575,9 @@ class SaleOpportunityLine(sequence_ordered(), ModelSQL, ModelView):
|
||||
'readonly': _states['readonly'],
|
||||
})
|
||||
description = fields.Text("Description", states=_states)
|
||||
summary = fields.Function(fields.Char("Summary"), 'on_change_with_summary')
|
||||
summary = fields.Function(
|
||||
fields.Char("Summary"), 'on_change_with_summary',
|
||||
searcher='search_summary')
|
||||
note = fields.Text("Note")
|
||||
|
||||
company = fields.Function(
|
||||
@@ -625,6 +627,10 @@ class SaleOpportunityLine(sequence_ordered(), ModelSQL, ModelView):
|
||||
def on_change_with_summary(self, name=None):
|
||||
return firstline(self.description or '')
|
||||
|
||||
@classmethod
|
||||
def search_summary(cls, name, clause):
|
||||
return [('description', *clause[1:])]
|
||||
|
||||
@fields.depends('opportunity', '_parent_opportunity.company')
|
||||
def on_change_with_company(self, name=None):
|
||||
return self.opportunity.company if self.opportunity else None
|
||||
|
||||
@@ -30,7 +30,9 @@ class Attachment(ResourceMixin, ModelSQL, ModelView):
|
||||
('link', 'Link'),
|
||||
], 'Type', required=True)
|
||||
description = fields.Text('Description')
|
||||
summary = fields.Function(fields.Char('Summary'), 'on_change_with_summary')
|
||||
summary = fields.Function(
|
||||
fields.Char('Summary'), 'on_change_with_summary',
|
||||
searcher='search_summary')
|
||||
link = fields.Char('Link', states={
|
||||
'invisible': Eval('type') != 'link',
|
||||
}, depends=['type'])
|
||||
@@ -67,6 +69,10 @@ class Attachment(ResourceMixin, ModelSQL, ModelView):
|
||||
def on_change_with_summary(self, name=None):
|
||||
return firstline(self.description or '')
|
||||
|
||||
@classmethod
|
||||
def search_summary(cls, name, clause):
|
||||
return [('description', *clause[1:])]
|
||||
|
||||
@classmethod
|
||||
def fields_view_get(cls, view_id=None, view_type='form', level=None):
|
||||
pool = Pool()
|
||||
|
||||
@@ -55,7 +55,9 @@ class Error(Workflow, ModelView, ModelSQL):
|
||||
origin_string = origin.translated('origin')
|
||||
message = fields.Text("Message", readonly=True)
|
||||
description = fields.Text("Description", readonly=True)
|
||||
summary = fields.Function(fields.Char("Summary"), 'on_change_with_summary')
|
||||
summary = fields.Function(
|
||||
fields.Char("Summary"), 'on_change_with_summary',
|
||||
searcher='search_summary')
|
||||
|
||||
processed_by = fields.Many2One(
|
||||
'res.user', "Processed by",
|
||||
@@ -114,6 +116,10 @@ class Error(Workflow, ModelView, ModelSQL):
|
||||
def on_change_with_summary(self, name=None):
|
||||
return firstline(self.message or '')
|
||||
|
||||
@classmethod
|
||||
def search_summary(cls, name, clause):
|
||||
return [('message', *clause[1:])]
|
||||
|
||||
def get_rec_name(self, name):
|
||||
if self.origin:
|
||||
return "%s - %s" % (self.origin_string, self.origin.rec_name)
|
||||
|
||||
Reference in New Issue
Block a user