Fix payments and xml

This commit is contained in:
Oscar Alvarez 2020-05-29 16:30:30 -05:00
parent 7262d37364
commit aa1592c938
9 changed files with 213 additions and 40 deletions

View File

@ -2,10 +2,18 @@
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "error:rental.equipment:"
msgid "Product already exists!"
msgstr ""
msgctxt "error:rental.service:"
msgid "Error in Date Start Service!"
msgstr "Error en la fecha inicial!"
msgctxt "error:rental.service:"
msgid "Product not available but another service"
msgstr ""
msgctxt "error:rental.service:"
msgid ""
"State of Service invalid, for generate sale this service "
@ -116,6 +124,10 @@ msgctxt "field:rental.booking,end_date:"
msgid "End Date"
msgstr "Fecha Terminación"
msgctxt "field:rental.booking,equipment:"
msgid "Equipment"
msgstr "Equipo"
msgctxt "field:rental.booking,first_name:"
msgid "First Name"
msgstr "Primer Nombre"
@ -344,6 +356,86 @@ msgctxt "field:rental.create_sales_from_moves.start,start_date:"
msgid "Start Date"
msgstr "Fecha de Inicio"
msgctxt "field:rental.equipment,create_date:"
msgid "Create Date"
msgstr "Fecha de Creación"
msgctxt "field:rental.equipment,create_uid:"
msgid "Create User"
msgstr "Usuario de creación"
msgctxt "field:rental.equipment,current_service:"
msgid "Contract Service"
msgstr ""
msgctxt "field:rental.equipment,date_return:"
msgid "Date Return"
msgstr "Fecha de devolución"
msgctxt "field:rental.equipment,gps:"
msgid "GPS"
msgstr ""
msgctxt "field:rental.equipment,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:rental.equipment,issues:"
msgid "issues"
msgstr ""
msgctxt "field:rental.equipment,model:"
msgid "Model"
msgstr "Modelo"
msgctxt "field:rental.equipment,product:"
msgid "Product"
msgstr "Productos"
msgctxt "field:rental.equipment,rec_name:"
msgid "Record Name"
msgstr "Nombre del registro"
msgctxt "field:rental.equipment,status:"
msgid "Status"
msgstr "Estado"
msgctxt "field:rental.equipment,write_date:"
msgid "Write Date"
msgstr "Modificado por Usuario"
msgctxt "field:rental.equipment,write_uid:"
msgid "Write User"
msgstr "Usuario modificación"
msgctxt "field:rental.equipment.model,create_date:"
msgid "Create Date"
msgstr "Fecha de Creación"
msgctxt "field:rental.equipment.model,create_uid:"
msgid "Create User"
msgstr "Usuario de creación"
msgctxt "field:rental.equipment.model,id:"
msgid "ID"
msgstr "ID"
msgctxt "field:rental.equipment.model,name:"
msgid "Name"
msgstr "Nombre del registro"
msgctxt "field:rental.equipment.model,rec_name:"
msgid "Record Name"
msgstr "Nombre del registro"
msgctxt "field:rental.equipment.model,write_date:"
msgid "Write Date"
msgstr "Fecha de modificación"
msgctxt "field:rental.equipment.model,write_uid:"
msgid "Write User"
msgstr "Usuario modificación"
msgctxt "field:rental.service,address:"
msgid "Address"
msgstr "Dirección de la Tienda"
@ -420,6 +512,10 @@ msgctxt "field:rental.service,end_date:"
msgid "End Date"
msgstr "Fecha Terminación"
msgctxt "field:rental.service,equipment:"
msgid "Equipment"
msgstr "Equipo"
msgctxt "field:rental.service,expiration_days_cache:"
msgid "Expiration Days Cache"
msgstr ""
@ -464,6 +560,10 @@ msgctxt "field:rental.service,party:"
msgid "Customer"
msgstr "Cliente"
msgctxt "field:rental.service,payment_state:"
msgid "Payment State"
msgstr ""
msgctxt "field:rental.service,payments:"
msgid "Voucher"
msgstr "Comprobantes"
@ -761,11 +861,15 @@ msgid "In Days"
msgstr "En Días"
msgctxt "model:ir.action,name:act_check_list_item_form"
msgid "Product Check List"
msgid "Item CheckList"
msgstr "Lista de Chequeo"
msgctxt "model:ir.action,name:act_equipment_model"
msgid "Model"
msgstr "Modelo"
msgctxt "model:ir.action,name:act_open_service_form"
msgid "Services"
msgid "Sales"
msgstr "Ventas"
msgctxt "model:ir.action,name:act_rental_booking_form"
@ -776,6 +880,10 @@ msgctxt "model:ir.action,name:act_rental_configuration_form"
msgid "Rental Configuration"
msgstr "Configuración"
msgctxt "model:ir.action,name:act_rental_equipment"
msgid "Equipment"
msgstr "Equipo"
msgctxt "model:ir.action,name:act_rental_service_create_sale"
msgid "Create Sales"
msgstr "Crear Ventas"
@ -808,6 +916,10 @@ msgctxt "model:ir.action,name:wizard_rental_service_cache_expiration_days"
msgid "Set Cache Expiration Days"
msgstr ""
msgctxt "model:ir.action,name:wizard_service_advance_voucher"
msgid "Voucher Advance"
msgstr "Generar Comprobante de Anticipo"
msgctxt "model:ir.action.act_window.domain,name:"
msgid "Available"
msgstr "Disponible"
@ -845,11 +957,26 @@ msgctxt "model:ir.action.act_window.domain,name:act_service_form_domain_draft"
msgid "Draft"
msgstr "Borrador"
msgctxt ""
"model:ir.action.act_window.domain,name:act_service_form_domain_exp_today"
msgid "Expire Today"
msgstr ""
msgctxt ""
"model:ir.action.act_window.domain,name:act_service_form_domain_next_exp"
msgid "Finalizan esta semana"
msgstr "Finalizan esta semana"
msgctxt ""
"model:ir.action.act_window.domain,name:act_service_form_domain_pickup_today"
msgid "Pickup Today"
msgstr ""
msgctxt ""
"model:ir.action.act_window.domain,name:act_service_form_domain_renovated"
msgid "Renovated"
msgstr ""
msgctxt "model:ir.sequence,name:sequence_rental"
msgid "Rental"
msgstr "Alquiler"
@ -870,6 +997,10 @@ msgctxt "model:ir.ui.menu,name:menu_configuration"
msgid "Configuration"
msgstr "Configuración"
msgctxt "model:ir.ui.menu,name:menu_equipment_model"
msgid "Model"
msgstr "Modelo"
msgctxt "model:ir.ui.menu,name:menu_product_check_list_item"
msgid "Check List Item"
msgstr "Lista de Chequeo"
@ -886,6 +1017,10 @@ msgctxt "model:ir.ui.menu,name:menu_rental_configuration"
msgid "General Configuration"
msgstr "Configuración General"
msgctxt "model:ir.ui.menu,name:menu_rental_equipment"
msgid "Equipment"
msgstr "Equipo"
msgctxt "model:ir.ui.menu,name:menu_reporting"
msgid "Reporting"
msgstr "Reportes"
@ -922,6 +1057,14 @@ msgctxt "model:rental.create_sales_from_moves.start,name:"
msgid "Create Sales From Moves Start"
msgstr "Crear Ventas desde Movimientos"
msgctxt "model:rental.equipment,name:"
msgid "Rental Equipment"
msgstr ""
msgctxt "model:rental.equipment.model,name:"
msgid "Equipment Model"
msgstr ""
msgctxt "model:rental.service,name:"
msgid "Rental Service"
msgstr "Servicio de Alquiler"
@ -2503,7 +2646,7 @@ msgstr "Procesado"
msgctxt "selection:rental.booking,type_document:"
msgid ""
msgstr "Punto de Orden"
msgstr ""
msgctxt "selection:rental.booking,type_document:"
msgid "Driver License"
@ -2533,6 +2676,18 @@ msgctxt "selection:rental.configuration,uom_hiring_time:"
msgid "Week"
msgstr "Semana"
msgctxt "selection:rental.equipment,status:"
msgid "Available"
msgstr "Disponible"
msgctxt "selection:rental.equipment,status:"
msgid "Maintenance"
msgstr "Mantenimiento"
msgctxt "selection:rental.equipment,status:"
msgid "Not Available"
msgstr "No Disponible"
msgctxt "selection:rental.service,hiring_time_uom:"
msgid "Day"
msgstr "Día"
@ -2549,6 +2704,18 @@ msgctxt "selection:rental.service,hiring_time_uom:"
msgid "Week"
msgstr "Semana"
msgctxt "selection:rental.service,payment_state:"
msgid ""
msgstr ""
msgctxt "selection:rental.service,payment_state:"
msgid "Paid"
msgstr "Pagado"
msgctxt "selection:rental.service,payment_state:"
msgid "Pending"
msgstr "Pendiente"
msgctxt "selection:rental.service,state:"
msgid "Cancelled"
msgstr "Cancelado"
@ -2569,6 +2736,10 @@ msgctxt "selection:rental.service,state:"
msgid "Pick Up"
msgstr "Recogida"
msgctxt "selection:rental.service,state:"
msgid "renovated"
msgstr ""
msgctxt "selection:rental.service.product_check_list,kind:"
msgid "Category"
msgstr "Categoría"
@ -2579,7 +2750,7 @@ msgstr "Item"
msgctxt "view:rental.booking:"
msgid "Booking"
msgstr "Reservas"
msgstr "Reserva"
msgctxt "view:rental.booking:"
msgid "Cancel"

Binary file not shown.

View File

@ -23,7 +23,7 @@ STATES = {
class Service(Workflow, ModelSQL, ModelView):
'Rental Service'
__name__ = 'rental.service'
_rec_name = 'party.name'
_rec_name = 'party'
number = fields.Char('Number', readonly=True, select=True)
company = fields.Many2One('company.company', 'Company', required=True,
states=STATES, domain=[
@ -78,7 +78,7 @@ class Service(Workflow, ModelSQL, ModelView):
('draft', 'Draft'),
('confirmed', 'Confirmed'),
('pickup', 'Pick Up'),
('renovated', 'renovated'),
('renewed', 'Renewed'),
('done', 'Done'),
('cancelled', 'Cancelled'),
], 'State', readonly=True, required=True)
@ -145,9 +145,9 @@ class Service(Workflow, ModelSQL, ModelView):
('draft', 'cancel'),
('draft', 'confirmed'),
('confirmed', 'done'),
('confirmed', 'renovated'),
('renovated', 'done'),
('done', 'renovated'),
('confirmed', 'renewed'),
('renewed', 'done'),
('done', 'renewed'),
))
cls._buttons.update({
'draft': {
@ -157,16 +157,16 @@ class Service(Workflow, ModelSQL, ModelView):
'invisible': Eval('state') != 'draft',
},
'done': {
'invisible': ~Eval('state').in_(['confirmed', 'renovate']),
'invisible': ~Eval('state').in_(['confirmed', 'renewed']),
},
'confirm': {
'invisible': Eval('state') != 'draft',
},
'renovate': {
'renew': {
'invisible': ~Eval('state').in_(['confirmed', 'done']),
},
'pay_advance': {
'invisible': ~Eval('state').in_(['done']),
'invisible': Eval('state').in_(['done']),
},
})
cls._error_messages.update({
@ -176,6 +176,9 @@ class Service(Workflow, ModelSQL, ModelView):
'product_not_avalilable': ('Product not available but another service')
})
def get_rec_name(self, name):
return self.party.rec_name
@classmethod
def search_rec_name(cls, name, clause):
if clause[1].startswith('!') or clause[1].startswith('not '):
@ -255,8 +258,8 @@ class Service(Workflow, ModelSQL, ModelView):
@classmethod
@ModelView.button
@Workflow.transition('renovated')
def renovate(cls, records):
@Workflow.transition('renewed')
def renew(cls, records):
for rec in records:
rec.equipment.write([rec.equipment], {'status': 'not_available'})
@ -525,8 +528,15 @@ class RentalVoucher(ModelSQL):
'Rental - Voucher'
__name__ = 'rental.service-account.voucher'
_table = 'rental_vouchers_rel'
rental = fields.Many2One('rental.service', 'Rental',
ondelete='CASCADE', select=True, required=True)
rental = fields.Many2One('rental.service', 'Rental', ondelete='CASCADE',
required=True)
voucher = fields.Many2One('account.voucher', 'Voucher',
domain=[('voucher_type', '=', 'receipt')],
ondelete='RESTRICT', select=True, required=True)
ondelete='RESTRICT', required=True)
@classmethod
def set_voucher_origin(cls, voucher_id, rental_id):
cls.create([{
'voucher': voucher_id,
'rental': rental_id,
}])

View File

@ -53,7 +53,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">By Expire</field>
<field name="sequence" eval="10"/>
<field name="domain" eval="[
('end_date', '>=', DateTime()),
('end_date', '>=', DateTime(hour=0, minute=0, second=0, microsecond=0)),
('state', '=', 'confirmed')
]" pyson="1"/>
<field name="act_window" ref="act_service_form"/>
@ -73,7 +73,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">Pickup Today</field>
<field name="sequence" eval="10"/>
<field name="domain" eval="[
('start_date', '=', DateTime()),
('start_date', '>=', DateTime(hour=0, minute=0, second=0, microsecond=0)),
]" pyson="1"/>
<field name="act_window" ref="act_service_form"/>
</record>
@ -92,10 +92,10 @@ this repository contains the full copyright notices and license terms. -->
<field name="act_window" ref="act_service_form"/>
</record>
<record model="ir.action.act_window.domain"
id="act_service_form_domain_renovated">
<field name="name">Renovated</field>
id="act_service_form_domain_renewed">
<field name="name">Renewed</field>
<field name="sequence" eval="50"/>
<field name="domain" eval="[('state', '=', 'renovated')]" pyson="1"/>
<field name="domain" eval="[('state', '=', 'renewed')]" pyson="1"/>
<field name="act_window" ref="act_service_form"/>
</record>
<record model="ir.action.act_window.domain"
@ -181,14 +181,11 @@ this repository contains the full copyright notices and license terms. -->
<menuitem parent="menu_rental" id="menu_service_cache_expiration_days"
action="wizard_rental_service_cache_expiration_days"/>
<record model="ir.action.wizard" id="wizard_service_advance_voucher">
<field name="name">Voucher Advance</field>
<field name="wiz_name">account_voucher.advance_voucher</field>
<field name="model">rental.service</field>
</record>
</data>
</tryton>

View File

@ -1,5 +1,5 @@
[tryton]
version=5.0.1
version=5.0.2
depends:
party
company
@ -7,6 +7,7 @@ depends:
sale
email
sms
account_voucher
xml:
rental.xml
configuration.xml

View File

@ -3,9 +3,8 @@
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="product"/>
<field name="model"/>
<field name="status"/>
<field name="current_service"/>
<field name="model"/>
<field name="date_return"/>
<field name="gps"/>
</tree>

View File

@ -43,9 +43,6 @@ this repository contains the full copyright notices and license terms. -->
<button name="send_notification_pickup" string="Send SMS Notification"
icon="tryton-forward" colspan="2"/>
<notebook colspan="4">
<page string="Payments" id="payments">
<field name="payments" colspan="4"/>
</page>
<page string="Info" id="info">
<label name="party"/>
<field name="party"/>

View File

@ -8,22 +8,18 @@ this repository contains the full copyright notices and license terms. -->
<field name="number"/>
<label name="equipment"/>
<field name="equipment"/>
<label name="product"/>
<field name="product"/>
<label name="booking"/>
<field name="booking"/>
<label name="service_date"/>
<field name="service_date"/>
<label name="service_product"/>
<field name="service_product"/>
<label name="hiring_time"/>
<field name="hiring_time"/>
<label name="hiring_time_uom"/>
<field name="hiring_time_uom"/>
<label name="start_date"/>
<field name="start_date"/>
<label name="end_date"/>
<field name="end_date"/>
<label name="product"/>
<field name="product"/>
<label name="unit_price"/>
<field name="unit_price"/>
<label name="days_expiration"/>
@ -69,6 +65,10 @@ this repository contains the full copyright notices and license terms. -->
<field name="early_return"/>
<label name="cover_prices"/>
<field name="cover_prices"/>
<label name="hiring_time"/>
<field name="hiring_time"/>
<label name="hiring_time_uom"/>
<field name="hiring_time_uom"/>
<label name="customer_contract_agree"/>
<field name="customer_contract_agree"/>
<label name="odometer_start"/>
@ -107,7 +107,7 @@ this repository contains the full copyright notices and license terms. -->
icon="tryton-cancel"/>
<button name="confirm" string="Confirm"
icon="tryton-forward"/>
<button name="renovate" string="Renovate"
<button name="renew" string="Renew"
icon="tryton-ok"/>
<button name="done" string="Done"
icon="tryton-ok"/>

View File

@ -8,10 +8,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="equipment"/>
<field name="service_date"/>
<field name="start_date" widget="date" string="Start Date"/>
<field name="start_date" widget="time" string="Start Time"/>
<field name="hiring_time"/>
<field name="end_date" widget="date" string="End Date"/>
<field name="end_date" widget="time" string="End Time"/>
<field name="days_expiration"/>
<field name="pickup_user"/>
<field name="state"/>