added Processed check
This commit is contained in:
parent
354d0cea82
commit
7c927223a7
34
edocument.py
34
edocument.py
|
@ -46,6 +46,21 @@ class EdocumentMessage(ModelView, ModelSQL):
|
|||
code = fields.Char('Code')
|
||||
message = fields.Text('Message')
|
||||
sequence = fields.Many2One('ir.sequence', 'Sequence')
|
||||
origin = fields.Reference('Origin', selection='get_origin',
|
||||
required=True)
|
||||
|
||||
@classmethod
|
||||
def get_origin(cls):
|
||||
IrModel = Pool().get('ir.model')
|
||||
models = cls._get_origin()
|
||||
models = IrModel.search([
|
||||
('model', 'in', models),
|
||||
])
|
||||
return [(None, '')] + [(m.model, m.name) for m in models]
|
||||
|
||||
@classmethod
|
||||
def _get_origin(cls):
|
||||
return []
|
||||
|
||||
@classmethod
|
||||
def create(cls, vlist):
|
||||
|
@ -62,7 +77,24 @@ class EdocumentMessage(ModelView, ModelSQL):
|
|||
|
||||
|
||||
class EdocumentMixin():
|
||||
message = fields.Many2One('edocument.message', 'Message')
|
||||
messages = fields.One2Many('edocument.message', 'origin', 'Message')
|
||||
edocument_processed = fields.Function(
|
||||
fields.Boolean('Processed'), 'get_edocument_processed',
|
||||
searcher='search_edocument_processed')
|
||||
|
||||
def get_edocument_processed(self, name=None):
|
||||
return len(self.messages) > 0
|
||||
|
||||
@classmethod
|
||||
def search_edocument_processed(cls, name, clause):
|
||||
exist = {
|
||||
True: [('messages', '=', None)],
|
||||
False: [('messages', '!=', None)]}
|
||||
|
||||
return exist[bool(clause[1] == '=') ^ bool(clause[2])]
|
||||
|
||||
|
||||
class EdocumentImportMixin(EdocumentMixin):
|
||||
|
||||
@classmethod
|
||||
def _get_template_name(cls):
|
||||
|
|
64
locale/es.po
64
locale/es.po
|
@ -98,6 +98,10 @@ msgctxt "field:edocument.message,message:"
|
|||
msgid "Message"
|
||||
msgstr "Mensaje"
|
||||
|
||||
msgctxt "field:edocument.message,origin:"
|
||||
msgid "Origin"
|
||||
msgstr "Origen"
|
||||
|
||||
msgctxt "field:edocument.message,rec_name:"
|
||||
msgid "Record Name"
|
||||
msgstr "Nombre"
|
||||
|
@ -170,6 +174,10 @@ msgctxt "field:party.party,edi_release_number:"
|
|||
msgid "Release Number"
|
||||
msgstr "Número Versión"
|
||||
|
||||
msgctxt "field:party.party,edi_template_path:"
|
||||
msgid "Template Path"
|
||||
msgstr "Ruta Plantilla"
|
||||
|
||||
msgctxt "field:product.cross_reference,EDI_code:"
|
||||
msgid "EAN Code"
|
||||
msgstr "Código EAN"
|
||||
|
@ -182,10 +190,46 @@ msgctxt "field:product.template,EDI_code:"
|
|||
msgid "EDI Code"
|
||||
msgstr "Código EDI"
|
||||
|
||||
msgctxt "field:stock.configuration,EDI_output_path:"
|
||||
msgid "EDI Output Path"
|
||||
msgstr "Ruta Salida EDI"
|
||||
|
||||
msgctxt "field:stock.configuration,edocument_sequence:"
|
||||
msgid "Electronic Document Sequence"
|
||||
msgstr "Secuencia Documentación Electrónica"
|
||||
|
||||
msgctxt "field:stock.configuration.edi_output_path,EDI_output_path:"
|
||||
msgid "EDI Output Path"
|
||||
msgstr "Ruta Salida EDI"
|
||||
|
||||
msgctxt "field:stock.configuration.edi_output_path,company:"
|
||||
msgid "Company"
|
||||
msgstr "Empresa"
|
||||
|
||||
msgctxt "field:stock.configuration.edi_output_path,create_date:"
|
||||
msgid "Create Date"
|
||||
msgstr "Fecha de creación"
|
||||
|
||||
msgctxt "field:stock.configuration.edi_output_path,create_uid:"
|
||||
msgid "Create User"
|
||||
msgstr "Usuario de creación"
|
||||
|
||||
msgctxt "field:stock.configuration.edi_output_path,id:"
|
||||
msgid "ID"
|
||||
msgstr "Identificador"
|
||||
|
||||
msgctxt "field:stock.configuration.edi_output_path,rec_name:"
|
||||
msgid "Record Name"
|
||||
msgstr "Nombre registro"
|
||||
|
||||
msgctxt "field:stock.configuration.edi_output_path,write_date:"
|
||||
msgid "Write Date"
|
||||
msgstr "Fecha modificación"
|
||||
|
||||
msgctxt "field:stock.configuration.edi_output_path,write_uid:"
|
||||
msgid "Write User"
|
||||
msgstr "Usuario que escribe."
|
||||
|
||||
msgctxt "field:stock.configuration.sequence,edocument_sequence:"
|
||||
msgid "Electronic Document Sequence"
|
||||
msgstr "Secuencia Documentación Electrónica"
|
||||
|
@ -238,6 +282,10 @@ msgctxt "model:ir.ui.menu,name:menu_edocument_template"
|
|||
msgid "Edocument Templates"
|
||||
msgstr "Plantillas de Documentación Electrónica"
|
||||
|
||||
msgctxt "model:stock.configuration.edi_output_path,name:"
|
||||
msgid "Stock Configuration EDI Output Path"
|
||||
msgstr "Configuración Stock Ruta Salida EDI"
|
||||
|
||||
msgctxt "selection:edocument.template,message_type:"
|
||||
msgid "DESADV"
|
||||
msgstr "DESADV"
|
||||
|
@ -247,20 +295,20 @@ msgid "INVOIC"
|
|||
msgstr "INVOIC"
|
||||
|
||||
msgctxt "selection:party.identifier,type:"
|
||||
msgid "EDI Payer"
|
||||
msgstr "EDI Pagador"
|
||||
|
||||
msgctxt "selection:party.identifier,type:"
|
||||
msgid "EDI Receiver"
|
||||
msgstr "EDI Receptor"
|
||||
msgid "EDI Buyer"
|
||||
msgstr "EDI Comprador"
|
||||
|
||||
msgctxt "selection:party.identifier,type:"
|
||||
msgid "EDI Invoice"
|
||||
msgstr "EDI Factura"
|
||||
|
||||
msgctxt "selection:party.identifier,type:"
|
||||
msgid "EDI Buyer"
|
||||
msgstr "EDI Comprador"
|
||||
msgid "EDI Payer"
|
||||
msgstr "EDI Pagador"
|
||||
|
||||
msgctxt "selection:party.identifier,type:"
|
||||
msgid "EDI Receiver"
|
||||
msgstr "EDI Receptor"
|
||||
|
||||
msgctxt "selection:party.identifier,type:"
|
||||
msgid "EDI Sender"
|
||||
|
|
Loading…
Reference in New Issue