Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d55fb77fd3 | |||
| cd90b59318 | |||
| 7913e72739 | |||
| 0234ba0712 | |||
| f217d51c5d | |||
| 217f4c2576 | |||
| c822c78d94 | |||
| ec39b34abe | |||
| 9700ee0823 | |||
| d2f9b4bb4d | |||
| 76be9b41c5 | |||
| 60235fe545 | |||
| 5be77f6c7f | |||
| 9c52a9113c | |||
| 8f993552ec | |||
| 7f7c7c7579 | |||
| 0af482299b | |||
| 3855d7126b | |||
| c2a38e3820 | |||
| ab9a0b2074 | |||
| 675779b6e8 | |||
| 0fa7e9f295 | |||
| 4396a9dfbb | |||
| 492ee948f4 | |||
| 2cdc47d76f | |||
| 3e32ee03e4 | |||
| 8edae4f20b | |||
| 6cb24f5d0f | |||
| 5f40cc2e48 | |||
| befa8d1c24 | |||
| f3e785238c | |||
| 944dd05bc7 | |||
| 7d73b6141f | |||
| 70562ccac4 | |||
| dd9a3dc460 | |||
| e1c009a540 | |||
| cba5b68cf3 | |||
| d152cd9d53 | |||
| e79d6d8c8d | |||
| 2c535e8723 | |||
| 46a7b8416e | |||
| 783984ad0d | |||
| 4fee49cb2e | |||
| e320017436 | |||
| cc8f90a9d7 |
@@ -41,6 +41,7 @@ def register():
|
||||
sale.Sale,
|
||||
sale.SaleDate,
|
||||
sale.SaleLine,
|
||||
balance_sale_party.BalanceSalePartyStart,
|
||||
maintenance.MaintenanceService,
|
||||
maintenance.MaintenanceServiceLine,
|
||||
maintenance.MaintenanceLine,
|
||||
|
||||
75
agended.py
75
agended.py
@@ -1,9 +1,12 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.model import ModelSQL, ModelView, fields
|
||||
from trytond.wizard import Button, StateAction, StateView, Wizard
|
||||
from trytond.wizard import (
|
||||
Button, StateAction, StateTransition, StateView, Wizard)
|
||||
from trytond.pool import Pool
|
||||
from trytond.exceptions import UserError
|
||||
|
||||
import datetime
|
||||
from datetime import timedelta
|
||||
|
||||
|
||||
@@ -11,33 +14,24 @@ class AgendedInitial(ModelView):
|
||||
'Agended maintenance service'
|
||||
__name__ = 'optical_equipment_maintenance.agended'
|
||||
|
||||
maintenance_service = fields.Many2One(
|
||||
'optical_equipment_maintenance.service',
|
||||
'Maintenaince Service',
|
||||
required=True,
|
||||
domain=[('state', '=', 'draft')],
|
||||
)
|
||||
|
||||
estimated_agended = fields.DateTime('Date Maintenance', required=True)
|
||||
|
||||
technical = fields.Many2One('company.employee', 'Technical', required=True)
|
||||
maintenance_service = fields.Many2One('optical_equipment_maintenance.service',"Maintenaince Service",
|
||||
required=True, domain=[('state', '=', 'draft')])
|
||||
estimated_agended = fields.DateTime("Date Maintenance", required=True)
|
||||
technical = fields.Many2One('company.employee', "Technical", required=True)
|
||||
|
||||
|
||||
class AssingAgended(Wizard):
|
||||
'Assing Agended'
|
||||
__name__ = 'optical_equipment_maintenance.assing_agended'
|
||||
|
||||
start = StateView(
|
||||
'optical_equipment_maintenance.agended',
|
||||
'optical_equipment.assing_agended_view_form',
|
||||
[
|
||||
start = StateView('optical_equipment_maintenance.agended',
|
||||
'optical_equipment.assing_agended_view_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Assing', 'assing_agended', 'tryton-ok', default=True),
|
||||
],
|
||||
)
|
||||
])
|
||||
|
||||
assing_agended = StateAction('optical_equipment.act_maintenance_service_form')
|
||||
|
||||
assing_agended = StateAction(
|
||||
'optical_equipment.act_maintenance_service_form')
|
||||
|
||||
def default_start(self, fields):
|
||||
if len(self.records) > 0:
|
||||
@@ -52,15 +46,14 @@ class AssingAgended(Wizard):
|
||||
Config = pool.get('optical_equipment.configuration')
|
||||
config = Config(3)
|
||||
|
||||
diary = Diary(
|
||||
code=config.agended_sequence.get(),
|
||||
MaintenanceService = pool.get('optical_equipment_maintenance.service')
|
||||
diary = Diary(code=config.agended_sequence.get(),
|
||||
maintenance_service=self.start.maintenance_service,
|
||||
date_expected=self.start.estimated_agended,
|
||||
date_estimated=self.start.estimated_agended + timedelta(days=15),
|
||||
date_end=self.start.estimated_agended + timedelta(days=15),
|
||||
technical=self.start.technical.id,
|
||||
state='agended',
|
||||
)
|
||||
state='agended')
|
||||
diary.save()
|
||||
|
||||
maintenanceService = self.start.maintenance_service
|
||||
@@ -78,31 +71,23 @@ class ReAgended(ModelView):
|
||||
'Agended maintenance service'
|
||||
__name__ = 'optical_equipment_maintenance.reagended'
|
||||
|
||||
maintenance_service = fields.Many2One(
|
||||
'optical_equipment_maintenance.service',
|
||||
'Maintenaince Service',
|
||||
required=True,
|
||||
domain=[('state', '=', 'failed')],
|
||||
)
|
||||
estimated_agended = fields.DateTime('Date Maintenance', required=True)
|
||||
technical = fields.Many2One('company.employee', 'Technical', required=True)
|
||||
maintenance_service = fields.Many2One('optical_equipment_maintenance.service',"Maintenaince Service",
|
||||
required=True, domain=[('state', '=', 'failed')])
|
||||
estimated_agended = fields.DateTime("Date Maintenance", required=True)
|
||||
technical = fields.Many2One('company.employee', "Technical", required=True)
|
||||
|
||||
|
||||
class ReAssingAgended(Wizard):
|
||||
'Assing Agended'
|
||||
__name__ = 'optical_equipment_maintenance.reassing_agended'
|
||||
|
||||
start = StateView(
|
||||
'optical_equipment_maintenance.reagended',
|
||||
'optical_equipment.reassing_agended_view_form',
|
||||
[
|
||||
start = StateView('optical_equipment_maintenance.reagended',
|
||||
'optical_equipment.reassing_agended_view_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Assing', 'assing_agended', 'tryton-ok', default=True),
|
||||
],
|
||||
)
|
||||
])
|
||||
|
||||
assing_agended = StateAction(
|
||||
'optical_equipment.act_maintenance_service_form')
|
||||
assing_agended = StateAction('optical_equipment.act_maintenance_service_form')
|
||||
|
||||
def default_start(self, fields):
|
||||
if len(self.records) > 0:
|
||||
@@ -115,14 +100,12 @@ class ReAssingAgended(Wizard):
|
||||
pool = Pool()
|
||||
Diary = pool.get('optical_equipment_maintenance.diary')
|
||||
|
||||
diary = Diary(
|
||||
maintenance_service=self.start.maintenance_service,
|
||||
diary = Diary(maintenance_service=self.start.maintenance_service,
|
||||
date_expected=self.start.estimated_agended,
|
||||
date_estimated=self.start.estimated_agended + timedelta(days=15),
|
||||
date_end=self.start.estimated_agended + timedelta(days=15),
|
||||
technical=self.start.technical.id,
|
||||
state='agended',
|
||||
)
|
||||
state='agended')
|
||||
diary.save()
|
||||
|
||||
maintenanceService = self.start.maintenance_service
|
||||
@@ -138,7 +121,5 @@ class ServiceMaintenanceAgended(ModelSQL):
|
||||
'Service Maintenance - Agended'
|
||||
__name__ = 'optical_equipment_maintenance.service-maintenance.diary'
|
||||
|
||||
maintenance_service = fields.Many2One(
|
||||
'optical_equipment_maintenance.service', 'Maintenance Service'
|
||||
)
|
||||
agended = fields.Many2One('optical_equipment_maintenance.diary', 'Agended')
|
||||
maintenance_service = fields.Many2One('optical_equipment_maintenance.service', "Maintenance Service")
|
||||
agended = fields.Many2One('optical_equipment_maintenance.diary', "Agended")
|
||||
|
||||
@@ -3,39 +3,29 @@
|
||||
from trytond.model import ModelView, fields
|
||||
from trytond.wizard import Wizard, StateView, Button, StateReport
|
||||
from trytond.report import Report
|
||||
from trytond.pool import Pool
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pyson import Eval
|
||||
from trytond.exceptions import UserError
|
||||
|
||||
__all__ = ['BalanceSalePartyStart',
|
||||
'PrintBalanceSaleParty', 'BalanceSaleParty']
|
||||
|
||||
__all__ = ['BalancePartyStart', 'PrintBalanceParty', 'BalanceParty']
|
||||
|
||||
class BalanceSalePartyStart(ModelView):
|
||||
'Balance Party Start'
|
||||
__name__ = 'optical_equipment.print_balance_sale_party.start'
|
||||
|
||||
fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year',
|
||||
required=True)
|
||||
party = fields.Many2One('party.party', 'Party', required=True)
|
||||
start_period = fields.Many2One(
|
||||
'account.period',
|
||||
'Start Period',
|
||||
start_period = fields.Many2One('account.period', 'Start Period',
|
||||
domain=[
|
||||
('start_date', '<=', (Eval('end_period'), 'start_date')),
|
||||
], depends=['fiscalyear', 'end_period'])
|
||||
end_period = fields.Many2One('account.period', 'End Period',
|
||||
domain=[
|
||||
('start_date', '>=', (Eval('start_period'), 'start_date'))
|
||||
],
|
||||
depends=['fiscalyear', 'end_period'],
|
||||
)
|
||||
end_period = fields.Many2One(
|
||||
'account.period',
|
||||
'End Period',
|
||||
domain=[('start_date', '>=', (Eval('start_period'), 'start_date'))],
|
||||
depends=['start_period'],
|
||||
)
|
||||
depends=['start_period'])
|
||||
company = fields.Many2One('company.company', 'Company', required=True)
|
||||
party_type = fields.Selection(
|
||||
[('out', 'Customer')], 'Party Type', required=True)
|
||||
party_type = fields.Selection([('out', 'Customer')], "Party Type", required=True)
|
||||
|
||||
@staticmethod
|
||||
def default_company():
|
||||
@@ -50,14 +40,11 @@ class PrintBalanceSaleParty(Wizard):
|
||||
'Print Balance Sale Party'
|
||||
__name__ = 'optical_equipment.print_balance_sale_party'
|
||||
|
||||
start = StateView(
|
||||
'optical_equipment.print_balance_sale_party.start',
|
||||
'optical_equipment.print_balance_sale_party_start_view_form',
|
||||
[
|
||||
start = StateView('optical_equipment.print_balance_sale_party.start',
|
||||
'optical_equipment.print_balance_sale_party_start_view_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Print', 'print_', 'tryton-print', default=True),
|
||||
],
|
||||
)
|
||||
])
|
||||
|
||||
print_ = StateReport('optical_equipment.balance_sale_party')
|
||||
|
||||
@@ -81,11 +68,8 @@ class PrintBalanceSaleParty(Wizard):
|
||||
'company': self.start.company.id,
|
||||
'party': party,
|
||||
'party_type': party_type,
|
||||
'start_period': (
|
||||
self.start.start_period.id if self.start.start_period else None
|
||||
),
|
||||
'end_period':
|
||||
self.start.end_period.id if self.start.end_period else None,
|
||||
'start_period': self.start.start_period.id if self.start.start_period else None,
|
||||
'end_period' : self.start.end_period.id if self.start.end_period else None
|
||||
}
|
||||
return action, data
|
||||
|
||||
@@ -98,8 +82,7 @@ class BalanceSaleParty(Report):
|
||||
|
||||
@classmethod
|
||||
def get_context(cls, records, header, data):
|
||||
report_context = super(BalanceSaleParty, cls).get_context(
|
||||
records, header, data)
|
||||
report_context = super(BalanceSaleParty, cls).get_context(records, header, data)
|
||||
pool = Pool()
|
||||
Company = pool.get('company.company')
|
||||
Period = pool.get('account.period')
|
||||
@@ -109,7 +92,7 @@ class BalanceSaleParty(Report):
|
||||
end_period = None
|
||||
party = None
|
||||
company = Company(data['company'])
|
||||
dom_sale = [('state', 'in', ['processing', 'done'])]
|
||||
dom_sale = [('state', 'in', ["processing", "done"])]
|
||||
|
||||
if data.get('party'):
|
||||
party = data['party']
|
||||
@@ -122,12 +105,12 @@ class BalanceSaleParty(Report):
|
||||
end_period = Period(data['end_period'])
|
||||
dom_sale.append(('sale_date', '<=', end_period.start_date))
|
||||
|
||||
sales = Sale.search(
|
||||
dom_sale,
|
||||
order=[('sale_date', 'DESC'), ('id', 'DESC')],
|
||||
)
|
||||
sales = Sale.search(dom_sale,
|
||||
order=[('sale_date', 'DESC'),
|
||||
('id', 'DESC')],)
|
||||
|
||||
res = {}
|
||||
dict_location = {}
|
||||
|
||||
id_ = party
|
||||
party_ = Party.search(['id', '=', party])[0]
|
||||
@@ -141,17 +124,18 @@ class BalanceSaleParty(Report):
|
||||
except IndexError:
|
||||
pass
|
||||
|
||||
res[id_] = {'name': name, 'id_number': id_number, 'party': party_}
|
||||
|
||||
if (not sales):
|
||||
err = 'Este Tercero no Cuenta Con Ventas en Proceso ó Confirmadas.'
|
||||
raise UserError(str(err))
|
||||
res[id_] = {'name': name,
|
||||
'id_number': id_number,
|
||||
'party': party_
|
||||
}
|
||||
|
||||
if sales:
|
||||
res[id_]['sales'] = sales
|
||||
else:
|
||||
raise UserError(str("Este Tercero no Cuenta Con Ventas en Proceso ó Confirmadas."))
|
||||
|
||||
report_context['records'] = res.values()
|
||||
report_context['start_period'] =\
|
||||
start_period.name if start_period else '*'
|
||||
report_context['start_period'] = start_period.name if start_period else '*'
|
||||
report_context['end_period'] = end_period.name if end_period else '*'
|
||||
report_context['company'] = company
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.model import ModelSQL, ModelView, fields, sequence_ordered
|
||||
from trytond.pyson import Eval, If
|
||||
from trytond.model import (
|
||||
Workflow, ModelSQL, ModelView, fields, sequence_ordered)
|
||||
from trytond.pyson import Bool, Eval, If, Id, Equal
|
||||
from trytond.pool import Pool
|
||||
from trytond.modules.company import CompanyReport
|
||||
from trytond.transaction import Transaction
|
||||
@@ -16,28 +17,24 @@ class Calibration(ModelSQL, ModelView):
|
||||
|
||||
_states = {'readonly': True}
|
||||
|
||||
maintenance = fields.Many2One(
|
||||
'optical_equipment.maintenance',
|
||||
'Maintenance',
|
||||
ondelete='CASCADE',
|
||||
required=True,
|
||||
)
|
||||
graph_dates = fields.Char('Graph Dates', readonly=True)
|
||||
diopter = fields.Float('Diopter', states=_states)
|
||||
mean = fields.Float('Mean', states=_states)
|
||||
dev_std = fields.Float('Standart Desviation', states=_states)
|
||||
uncertain_type_A = fields.Float('Uncertain Type A', states=_states)
|
||||
uncertain_pattern = fields.Float('Uncertain Pattern', states=_states)
|
||||
k_c_calibration = fields.Float('K Crt Calibration', states=_states)
|
||||
uncertain_U_b1 = fields.Float('U_b1', states=_states)
|
||||
d_resolution = fields.Float('d_resolution', states=_states)
|
||||
uncertain_U_b2_dig = fields.Float('U_b2', states=_states)
|
||||
uncertain_U_b2_ana = fields.Float('U_b2', states=_states)
|
||||
uncertain_combinated = fields.Float('U_combinated', states=_states)
|
||||
uncertain_eff = fields.Float('U eff', states=_states)
|
||||
t_student = fields.Float('T Student', states=_states)
|
||||
maintenance = fields.Many2One('optical_equipment.maintenance', "Maintenance", ondelete="CASCADE",
|
||||
required=True)
|
||||
graph_dates = fields.Char("Graph Dates", readonly=True)
|
||||
diopter = fields.Float("Diopter", states=_states)
|
||||
mean = fields.Float("Mean", states=_states)
|
||||
dev_std = fields.Float("Standart Desviation", states=_states)
|
||||
uncertain_type_A = fields.Float("Uncertain Type A", states=_states)
|
||||
uncertain_pattern = fields.Float("Uncertain Pattern", states=_states)
|
||||
k_c_calibration = fields.Float("K Crt Calibration", states=_states)
|
||||
uncertain_U_b1 = fields.Float("U_b1", states=_states)
|
||||
d_resolution = fields.Float("d_resolution", states=_states)
|
||||
uncertain_U_b2_dig = fields.Float("U_b2", states=_states)
|
||||
uncertain_U_b2_ana = fields.Float("U_b2", states=_states)
|
||||
uncertain_combinated = fields.Float("U_combinated", states=_states)
|
||||
uncertain_eff = fields.Float("U eff", states=_states)
|
||||
t_student = fields.Float("T Student", states=_states)
|
||||
|
||||
uncertain_expanded = fields.Float('Uexpand', _digits, states=_states)
|
||||
uncertain_expanded = fields.Float("Uexpand", _digits, states=_states)
|
||||
|
||||
state = fields.Char('State')
|
||||
|
||||
@@ -46,53 +43,39 @@ class CalibrationSample(sequence_ordered(), ModelView, ModelSQL):
|
||||
'Samples of Calibration'
|
||||
__name__ = 'optical_equipment.maintenance.calibration_sample'
|
||||
|
||||
maintenance = fields.Many2One(
|
||||
'optical_equipment.maintenance', 'Maintenance')
|
||||
product = fields.Function(fields.Integer(
|
||||
'Product ID'), 'on_change_with_product')
|
||||
number_sample = fields.Float('Sample #', _digits)
|
||||
value_patterns = fields.Many2One(
|
||||
'optical_equipment.product_pattern',
|
||||
'Value Pattern',
|
||||
ondelete='RESTRICT',
|
||||
required=True,
|
||||
maintenance = fields.Many2One('optical_equipment.maintenance', 'Maintenance')
|
||||
product = fields.Function(fields.Integer("Product ID"), 'on_change_with_product')
|
||||
number_sample = fields.Float("Sample #", _digits)
|
||||
value_patterns = fields.Many2One('optical_equipment.product_pattern', "Value Pattern", ondelete='RESTRICT', required=True,
|
||||
domain=[('product', '=', Eval('product'))],
|
||||
depends=['product'],
|
||||
)
|
||||
value_equipment = fields.Float(
|
||||
'Value in Equipment',
|
||||
_digits,
|
||||
required=True,
|
||||
states={'readonly': Eval('value_patterns') is None},
|
||||
)
|
||||
mistake = fields.Float('Mistake', _digits)
|
||||
mistake_rate = fields.Float(
|
||||
'% Mistake', _digits, states={'readonly': True}, depends=['mistake']
|
||||
)
|
||||
depends=['product'])
|
||||
value_equipment = fields.Float("Value in Equipment", _digits, required=True,
|
||||
states={'readonly': Eval('value_patterns') is None})
|
||||
mistake = fields.Float("Mistake", _digits)
|
||||
mistake_rate = fields.Float("% Mistake", _digits,
|
||||
states={'readonly': True},
|
||||
depends=['mistake'])
|
||||
|
||||
@fields.depends('maintenance', '_parent_maintenance.equipment')
|
||||
def on_change_with_product(self, name=None):
|
||||
if self.maintenance:
|
||||
return self.maintenance.equipment.product.template.id
|
||||
|
||||
@fields.depends(
|
||||
'value_patterns', 'value_equipment', 'mistake', 'mistake_rate')
|
||||
@fields.depends('value_patterns', 'value_equipment',
|
||||
'mistake', 'mistake_rate')
|
||||
def on_change_value_equipment(self):
|
||||
if self.value_patterns:
|
||||
pattern = self.value_patterns.pattern
|
||||
if float(pattern) < 0:
|
||||
self.mistake = pattern - self.value_equipment
|
||||
if float(self.value_patterns.pattern) < 0:
|
||||
self.mistake = self.value_patterns.pattern - self.value_equipment
|
||||
else:
|
||||
if pattern > self.value_equipment:
|
||||
self.mistake = pattern - self.value_equipment
|
||||
if self.value_patterns.pattern > self.value_equipment:
|
||||
self.mistake = self.value_patterns.pattern - self.value_equipment
|
||||
else:
|
||||
self.mistake = -pattern + self.value_equipment
|
||||
self.mistake = -self.value_patterns.pattern + self.value_equipment
|
||||
|
||||
if pattern == self.value_equipment:
|
||||
if self.value_patterns.pattern == self.value_equipment:
|
||||
self.mistake_rate = 0
|
||||
else:
|
||||
self.mistake_rate = abs(
|
||||
self.mistake / pattern) * 100
|
||||
self.mistake_rate = abs(self.mistake / self.value_patterns.pattern) * 100
|
||||
|
||||
|
||||
class CalibrationReport(CompanyReport):
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
<!--This file file is part of Tryton. The COPYRIGHT file at the top level
|
||||
of this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="employee_view_form">
|
||||
<field name="model">company.employee</field>
|
||||
<field name="inherit" ref="company.employee_view_form"/>
|
||||
<field name="name">employee_form</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
||||
123
configuration.py
123
configuration.py
@@ -1,83 +1,52 @@
|
||||
from trytond.model import ModelSingleton, ModelSQL, ModelView, fields
|
||||
from trytond.model import (
|
||||
ModelSingleton, ModelSQL, ModelView, fields)
|
||||
from trytond.pyson import Id, Eval
|
||||
|
||||
|
||||
class Configuration(ModelSingleton, ModelSQL, ModelView):
|
||||
"Equipment Configuration"
|
||||
__name__ = "optical_equipment.configuration"
|
||||
'Equipment Configuration'
|
||||
__name__ = 'optical_equipment.configuration'
|
||||
|
||||
equipment_sequence = fields.Many2One(
|
||||
"ir.sequence",
|
||||
"Equipment Sequence",
|
||||
domain=[
|
||||
("sequence_type", "=", Id(
|
||||
"optical_equipment", "sequence_type_equipment"))
|
||||
],
|
||||
required=True
|
||||
)
|
||||
maintenance_sequence = fields.Many2One(
|
||||
"ir.sequence",
|
||||
"Maintenance Sequence",
|
||||
domain=[
|
||||
(
|
||||
"sequence_type",
|
||||
"=",
|
||||
Id("optical_equipment", "sequence_type_maintenances"),
|
||||
)
|
||||
],
|
||||
required=True
|
||||
)
|
||||
sale_quote_number = fields.Many2One(
|
||||
"ir.sequence",
|
||||
"Sale Quote Number",
|
||||
domain=[("sequence_type", "=", Id("sale", "sequence_type_sale"))],
|
||||
required=True
|
||||
)
|
||||
agended_sequence = fields.Many2One(
|
||||
"ir.sequence",
|
||||
"Agended Sequence",
|
||||
domain=[
|
||||
("sequence_type", "=", Id(
|
||||
"optical_equipment", "sequence_type_agended"))
|
||||
],
|
||||
required=True
|
||||
)
|
||||
contract_sequence = fields.Many2One(
|
||||
"ir.sequence",
|
||||
"Contract Sequence",
|
||||
domain=[
|
||||
("sequence_type", "=", Id(
|
||||
"optical_equipment", "sequence_type_contract"))
|
||||
],
|
||||
required=True
|
||||
)
|
||||
temperature_min = fields.Float("Temp Min", required=True)
|
||||
temperature_max = fields.Float("Temp Max", required=True)
|
||||
temperature_uom = fields.Many2One(
|
||||
"product.uom",
|
||||
"Temperature UOM", required=True,
|
||||
domain=[("category", "=", Id(
|
||||
"optical_equipment", "uom_cat_temperature"))],
|
||||
depends={"temperature_min"},
|
||||
)
|
||||
moisture_min = fields.Float("Moisture Min", required=True)
|
||||
moisture_max = fields.Float("Moisture Max", required=True)
|
||||
moisture_uom = fields.Many2One(
|
||||
"product.uom",
|
||||
"Moisture UOM",
|
||||
required=True,
|
||||
domain=[
|
||||
("category", "=", Id(
|
||||
"optical_equipment", "uom_cat_relative_humedity"))
|
||||
],
|
||||
depends={"moisture_min"},
|
||||
)
|
||||
technician_responsible = fields.Many2One(
|
||||
"company.employee", "Technician Responsible",
|
||||
required=True
|
||||
)
|
||||
invima = fields.Char(
|
||||
"Invima", states={"required": Eval("technician_responsible", True)}
|
||||
)
|
||||
technician_signature = fields.Binary("Technician Signature",
|
||||
required=True)
|
||||
'company.employee', "Technician Responsible")
|
||||
invima = fields.Char('Invima', states={
|
||||
'required': Eval('technician_responsible', True)
|
||||
})
|
||||
technician_signature = fields.Binary('Technician Signature')
|
||||
equipment_sequence = fields.Many2One(
|
||||
'ir.sequence', "Equipment Sequence", domain=[
|
||||
('sequence_type', '=',
|
||||
Id('optical_equipment', 'sequence_type_equipment'))])
|
||||
maintenance_sequence = fields.Many2One(
|
||||
'ir.sequence', "Maintenance Sequence",
|
||||
domain=[('sequence_type', '=',
|
||||
Id('optical_equipment', 'sequence_type_maintenances'))])
|
||||
agended_sequence = fields.Many2One(
|
||||
'ir.sequence', "Agended Sequence",
|
||||
domain=[('sequence_type', '=',
|
||||
Id('optical_equipment', 'sequence_type_agended'))])
|
||||
contract_sequence = fields.Many2One(
|
||||
'ir.sequence', "Contract Sequence", domain=[
|
||||
('sequence_type', '=',
|
||||
Id('optical_equipment', 'sequence_type_contract'))])
|
||||
temperature_min = fields.Float("Temp Min")
|
||||
temperature_max = fields.Float("Temp Max")
|
||||
temperature_uom = fields.Many2One(
|
||||
'product.uom', 'Temperature UOM',
|
||||
domain=[
|
||||
('category', '=', Id(
|
||||
'optical_equipment', "uom_cat_temperature"))],
|
||||
depends={'itemperature_min'})
|
||||
moisture_min = fields.Float("Moisture Min")
|
||||
moisture_max = fields.Float("Moisture Max")
|
||||
moisture_uom = fields.Many2One(
|
||||
'product.uom', "Moisture UOM",
|
||||
domain=[
|
||||
('category', '=', Id(
|
||||
'optical_equipment', 'uom_cat_relative_humedity'))],
|
||||
depends={'moisture_min'})
|
||||
sale_quote_number = fields.Many2One('ir.sequence', "Sale Quote Number",
|
||||
domain=[
|
||||
('sequence_type', '=', Id(
|
||||
'sale', 'sequence_type_sale'))
|
||||
])
|
||||
|
||||
294
contract.py
294
contract.py
@@ -1,17 +1,19 @@
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.model import ModelSQL, ModelView, Workflow, fields
|
||||
from trytond.model import (
|
||||
ModelSQL, ModelView, Workflow, fields)
|
||||
from trytond.modules.company import CompanyReport
|
||||
from trytond.pyson import Eval, If, Bool
|
||||
from trytond.modules.company.model import set_employee
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.wizard import Button, StateAction, StateView, Wizard
|
||||
from trytond.wizard import (
|
||||
Button, StateAction, StateTransition, StateView, Wizard)
|
||||
|
||||
from trytond.modules.currency.fields import Monetary
|
||||
from trytond.modules.product import price_digits
|
||||
|
||||
import datetime
|
||||
from datetime import timedelta, date
|
||||
from trytond.i18n import gettext
|
||||
|
||||
|
||||
class Cron(metaclass=PoolMeta):
|
||||
@@ -20,10 +22,9 @@ class Cron(metaclass=PoolMeta):
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super().__setup__()
|
||||
cls.method.selection.append((
|
||||
'optical_equipment.contract|contract_expiration',
|
||||
'Contract Expiration'
|
||||
))
|
||||
cls.method.selection.append(
|
||||
('optical_equipment.contract|contract_expiration', 'Contract Expiration'),
|
||||
)
|
||||
|
||||
|
||||
class Contract(Workflow, ModelSQL, ModelView):
|
||||
@@ -33,112 +34,63 @@ class Contract(Workflow, ModelSQL, ModelView):
|
||||
_order_name = 'number'
|
||||
|
||||
company = fields.Many2One(
|
||||
'company.company',
|
||||
'Company',
|
||||
required=True,
|
||||
'company.company', "Company", required=True,
|
||||
states={
|
||||
'readonly': (Eval('state') != 'draft') | Eval('party', True),
|
||||
},
|
||||
help='Make the subscription belong to the company.',
|
||||
)
|
||||
}, help="Make the subscription belong to the company.")
|
||||
number = fields.Char(
|
||||
'Number', readonly=True,
|
||||
help='The main identification of the subscription.'
|
||||
)
|
||||
"Number", readonly=True,
|
||||
help="The main identification of the subscription.")
|
||||
reference = fields.Char(
|
||||
'Reference',
|
||||
help='The identification of an external origin.'
|
||||
)
|
||||
description = fields.Char(
|
||||
'Description',
|
||||
"Reference",
|
||||
help="The identification of an external origin.")
|
||||
description = fields.Char("Description",
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
},
|
||||
)
|
||||
})
|
||||
party = fields.Many2One(
|
||||
'party.party',
|
||||
'Party',
|
||||
required=True,
|
||||
'party.party', "Party", required=True,
|
||||
states={
|
||||
'readonly': (Eval('state') != 'draft') | Eval('party', True),
|
||||
},
|
||||
help='The party who subscribes.',
|
||||
)
|
||||
equipment = fields.Many2One('optical_equipment.equipment', 'Equipment')
|
||||
contact = fields.Many2One(
|
||||
'party.contact_mechanism', 'Contact', required=True)
|
||||
invoice_address = fields.Many2One(
|
||||
'party.address',
|
||||
'Invoice Address',
|
||||
required=True,
|
||||
domain=[('party', '=', Eval('party'))],
|
||||
}, help="The party who subscribes.")
|
||||
equipment = fields.Many2One('optical_equipment.equipment', "Equipment")
|
||||
contact = fields.Many2One('party.contact_mechanism', "Contact", required=True)
|
||||
invoice_address = fields.Many2One('party.address', 'Invoice Address',
|
||||
required=True, domain=[('party', '=', Eval('party'))],
|
||||
states={
|
||||
'readonly': (Eval('state') != 'draft') | Eval('party', True),
|
||||
},
|
||||
)
|
||||
start_date = fields.Date(
|
||||
'Start Date',
|
||||
required=True,
|
||||
)
|
||||
end_date = fields.Date(
|
||||
'End Date',
|
||||
domain=[
|
||||
'OR',
|
||||
(
|
||||
'end_date',
|
||||
'>=',
|
||||
If(
|
||||
})
|
||||
start_date = fields.Date("Start Date", required=True,)
|
||||
end_date = fields.Date("End Date",
|
||||
domain=['OR',
|
||||
('end_date', '>=', If(
|
||||
Bool(Eval('start_date')),
|
||||
Eval('start_date', datetime.date.min),
|
||||
datetime.date.min,
|
||||
),
|
||||
),
|
||||
datetime.date.min)),
|
||||
('end_date', '=', None),
|
||||
],
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft',
|
||||
},
|
||||
)
|
||||
})
|
||||
|
||||
maintenance_services = fields.Many2Many(
|
||||
'optical_equipment_maintenance.service-equipment.contract',
|
||||
'contract',
|
||||
'maintenance_services',
|
||||
'Prorogues',
|
||||
states={'readonly': Eval('state') != 'draft'},
|
||||
)
|
||||
maintenance_services = fields.Many2Many('optical_equipment_maintenance.service-equipment.contract',
|
||||
'contract', 'maintenance_services', "Prorogues",
|
||||
states={'readonly': Eval('state') != 'draft'})
|
||||
|
||||
current_equipments = fields.Many2Many(
|
||||
'optical_equipment.contract-optical_equipment.equipment',
|
||||
'contract',
|
||||
'equipment',
|
||||
'Current Equipments',
|
||||
states={'readonly': Eval('state') != 'draft'},
|
||||
)
|
||||
history_equipments = fields.One2Many(
|
||||
'optical_equipment.equipment',
|
||||
'contract',
|
||||
'Equipments',
|
||||
states={'readonly': Eval('state') != 'draft'},
|
||||
)
|
||||
currency = fields.Many2One('currency.currency', 'Currency', required=True)
|
||||
price_contract = Monetary(
|
||||
'Price Contract',
|
||||
digits=price_digits,
|
||||
required=True,
|
||||
states={'readonly': Eval('state') != 'draft'},
|
||||
)
|
||||
state = fields.Selection(
|
||||
[('draft', 'Draft'),
|
||||
('running', 'Running'),
|
||||
('closed', 'Closed'),
|
||||
('cancelled', 'Cancelled')],
|
||||
'State',
|
||||
readonly=True,
|
||||
required=False,
|
||||
sort=False,
|
||||
help='The current state of the subscription.',
|
||||
)
|
||||
current_equipments = fields.Many2Many('optical_equipment.contract-optical_equipment.equipment',
|
||||
'contract', 'equipment', "Current Equipments",
|
||||
states={'readonly': Eval('state') != 'draft'})
|
||||
history_equipments = fields.One2Many('optical_equipment.equipment', 'contract', "Equipments",
|
||||
states={'readonly': Eval('state') != 'draft'})
|
||||
price_contract = Monetary("Price Contract", digits=price_digits, currency='currency', required=True,
|
||||
states={'readonly': Eval('state') != 'draft'})
|
||||
state = fields.Selection([
|
||||
('draft', "Draft"),
|
||||
('running', "Running"),
|
||||
('closed', "Closed"),
|
||||
('cancelled', "Cancelled"),
|
||||
], "State", readonly=True, required=False, sort=False,
|
||||
help="The current state of the subscription.")
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
@@ -147,33 +99,19 @@ class Contract(Workflow, ModelSQL, ModelView):
|
||||
('number', 'DESC NULLS FIRST'),
|
||||
('id', 'DESC'),
|
||||
]
|
||||
cls._transitions = {
|
||||
cls._transitions = ({
|
||||
('draft', 'running'),
|
||||
('running', 'draft'),
|
||||
('running', 'closed'),
|
||||
('running', 'cancelled'),
|
||||
('cancelled', 'draft'),
|
||||
}
|
||||
cls._buttons.update(
|
||||
{
|
||||
'draft': {
|
||||
'invisible':
|
||||
Eval('state').in_(['draft', 'closed'])
|
||||
},
|
||||
'running': {
|
||||
'invisible':
|
||||
Eval('state').in_(['cancelled', 'running'])
|
||||
},
|
||||
'closed': {
|
||||
'invisible':
|
||||
Eval('state').in_(['draft', 'cancelled'])
|
||||
},
|
||||
'cancelled': {
|
||||
'invisible':
|
||||
Eval('state').in_(['draft', 'cancelled'])
|
||||
},
|
||||
}
|
||||
)
|
||||
('cancelled', 'draft')
|
||||
})
|
||||
cls._buttons.update({
|
||||
'draft': {'invisible': Eval('state').in_(['draft', 'closed'])},
|
||||
'running': {'invisible': Eval('state').in_(['cancelled', 'running'])},
|
||||
'closed': {'invisible': Eval('state').in_(['draft', 'cancelled'])},
|
||||
'cancelled': {'invisible': Eval('state').in_(['draft', 'cancelled'])}
|
||||
})
|
||||
|
||||
@staticmethod
|
||||
def default_company():
|
||||
@@ -197,14 +135,15 @@ class Contract(Workflow, ModelSQL, ModelView):
|
||||
except UserError:
|
||||
raise UserError(str('Validation Error'))
|
||||
else:
|
||||
raise UserError(
|
||||
gettext('optical_equipment.msg_not_sequence_equipment'))
|
||||
raise UserError(gettext('optical_equipment.msg_not_sequence_equipment'))
|
||||
|
||||
@classmethod
|
||||
def contract_expiration(cls):
|
||||
contracts_to_expire = cls.search(
|
||||
[('state', '=', 'running'), ('end_date', '<=', date.today())]
|
||||
)
|
||||
pool = Pool()
|
||||
Contracts = pool.get('optical_equipment.contract')
|
||||
|
||||
contracts_to_expire = cls.search([('state', '=', 'running'),
|
||||
('end_date', '<=', date.today())])
|
||||
|
||||
if contracts_to_expire != []:
|
||||
for contract in contracts_to_expire:
|
||||
@@ -216,7 +155,7 @@ class Contract(Workflow, ModelSQL, ModelView):
|
||||
def draft(cls, contracts):
|
||||
contract = contracts[0]
|
||||
for equipment in contract.current_equipments:
|
||||
equipment.state = 'uncontrated'
|
||||
equipment.state = "uncontrated"
|
||||
equipment.contract_history += (contract.id,)
|
||||
equipment.save()
|
||||
contract.save()
|
||||
@@ -227,7 +166,7 @@ class Contract(Workflow, ModelSQL, ModelView):
|
||||
def closed(cls, contracts):
|
||||
contract = contracts[0]
|
||||
for equipment in contract.current_equipments:
|
||||
equipment.state = 'uncontrated'
|
||||
equipment.state = "uncontrated"
|
||||
equipment.save()
|
||||
|
||||
@classmethod
|
||||
@@ -236,7 +175,7 @@ class Contract(Workflow, ModelSQL, ModelView):
|
||||
def running(cls, contracts):
|
||||
contract = contracts[0]
|
||||
for equipment in contract.current_equipments:
|
||||
equipment.state = 'contrated'
|
||||
equipment.state = "contrated"
|
||||
equipment.contract_history += (contract.id,)
|
||||
equipment.save()
|
||||
|
||||
@@ -250,7 +189,7 @@ class Contract(Workflow, ModelSQL, ModelView):
|
||||
def cancelled(cls, contracts):
|
||||
contract = contracts[0]
|
||||
for equipment in contract.current_equipments:
|
||||
equipment.state = 'uncontrated'
|
||||
equipment.state = "uncontrated"
|
||||
equipment.save()
|
||||
|
||||
|
||||
@@ -259,24 +198,16 @@ class ContractMaintenanceServices(ModelSQL):
|
||||
__name__ = 'optical_equipment_maintenance.service-equipment.contract'
|
||||
|
||||
maintenance_services = fields.Many2One(
|
||||
'optical_equipment_maintenance.service',
|
||||
'Maintenance Service',
|
||||
)
|
||||
contract = fields.Many2One('optical_equipment.contract', 'Contract')
|
||||
'optical_equipment_maintenance.service', "Maintenance Service", )
|
||||
contract = fields.Many2One('optical_equipment.contract', "Contract")
|
||||
|
||||
|
||||
class ContractEquipment(ModelSQL):
|
||||
'Optical Equipment - Contract'
|
||||
__name__ = 'optical_equipment.contract-optical_equipment.equipment'
|
||||
|
||||
equipment = fields.Many2One(
|
||||
'optical_equipment.equipment',
|
||||
'Equipment',
|
||||
)
|
||||
contract = fields.Many2One(
|
||||
'optical_equipment.contract',
|
||||
'Contract',
|
||||
)
|
||||
equipment = fields.Many2One('optical_equipment.equipment', 'Equipment', )
|
||||
contract = fields.Many2One('optical_equipment.contract', 'Contract', )
|
||||
|
||||
|
||||
class ContractReport(CompanyReport):
|
||||
@@ -303,52 +234,33 @@ class CreateContractInitial(ModelView, ModelSQL):
|
||||
|
||||
currency = fields.Many2One('currency.currency', 'Currency', required=True)
|
||||
company = fields.Many2One(
|
||||
'company.company',
|
||||
'Company',
|
||||
readonly=True,
|
||||
required=True,
|
||||
help='Make the subscription belong to the company.',
|
||||
)
|
||||
'company.company', "Company", readonly=True, required=True,
|
||||
states={
|
||||
'readonly': (Eval('state') != 'draft') | Eval('party', True),
|
||||
}, help="Make the subscription belong to the company.")
|
||||
party = fields.Many2One(
|
||||
'party.party', 'Party', required=True, help='The party who subscribes.'
|
||||
)
|
||||
invoice_address = fields.Many2One(
|
||||
'party.address',
|
||||
'Invoice Address',
|
||||
required=True,
|
||||
domain=[('party', '=', Eval('party'))],
|
||||
)
|
||||
payment_term = fields.Many2One(
|
||||
'account.invoice.payment_term', 'Payment Term')
|
||||
'party.party', "Party", required=True,
|
||||
help="The party who subscribes.")
|
||||
invoice_address = fields.Many2One('party.address', 'Invoice Address',
|
||||
required=True, domain=[('party', '=', Eval('party'))])
|
||||
payment_term = fields.Many2One('account.invoice.payment_term',
|
||||
'Payment Term')
|
||||
contact = fields.Many2One(
|
||||
'party.contact_mechanism',
|
||||
'Contact',
|
||||
required=True,
|
||||
'party.contact_mechanism', "Contact", required=True,
|
||||
domain=[('party', '=', Eval('party'))],
|
||||
context={
|
||||
'company': Eval('company', -1),
|
||||
},
|
||||
)
|
||||
start_date = fields.Date('Start Date', required=True)
|
||||
end_date = fields.Date(
|
||||
'End Date',
|
||||
domain=[
|
||||
'OR',
|
||||
(
|
||||
'end_date',
|
||||
'>=',
|
||||
If(
|
||||
})
|
||||
start_date = fields.Date("Start Date", required=True)
|
||||
end_date = fields.Date("End Date",
|
||||
domain=['OR',
|
||||
('end_date', '>=', If(
|
||||
Bool(Eval('start_date')),
|
||||
Eval('start_date', datetime.date.min),
|
||||
datetime.date.min,
|
||||
),
|
||||
),
|
||||
datetime.date.min)),
|
||||
('end_date', '=', None),
|
||||
],
|
||||
)
|
||||
unit_price = Monetary(
|
||||
'Unit Price', digits=price_digits, currency='currency', required=True
|
||||
)
|
||||
])
|
||||
unit_price = Monetary("Unit Price", digits=price_digits, currency='currency', required=True)
|
||||
|
||||
@staticmethod
|
||||
def default_company():
|
||||
@@ -373,7 +285,7 @@ class CreateContractInitial(ModelView, ModelSQL):
|
||||
Date = pool.get('ir.date')
|
||||
if self.party:
|
||||
self.invoice_address = self.party.address_get(type='invoice')
|
||||
if self.party.customer_type == 'ips':
|
||||
if self.party.customer_type == "ips":
|
||||
self.end_date = Date.today() + timedelta(days=182)
|
||||
else:
|
||||
self.end_date = Date.today() + timedelta(days=365)
|
||||
@@ -382,26 +294,20 @@ class CreateContractInitial(ModelView, ModelSQL):
|
||||
class CreateContract(Wizard):
|
||||
__name__ = 'optical_equipment.maintenance.contract'
|
||||
|
||||
start = StateView(
|
||||
'optical_equipment_create.contract',
|
||||
'optical_equipment.create_contract_view_form',
|
||||
[
|
||||
start = StateView('optical_equipment_create.contract',
|
||||
'optical_equipment.create_contract_view_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Create', 'create_contract', 'tryton-ok', default=True),
|
||||
],
|
||||
)
|
||||
])
|
||||
create_contract = StateAction('optical_equipment.act_contract_form')
|
||||
|
||||
def default_start(self, fields):
|
||||
if self.record:
|
||||
default = {
|
||||
'party': self.record.propietary.id,
|
||||
default = {'party': self.record.propietary.id,
|
||||
'invoice_address': self.record.propietary_address.id,
|
||||
'unit_price': (
|
||||
self.record.sale_origin.amount
|
||||
if self.record.sale_origin.__name__ == 'sale.line'
|
||||
else self.record.sale_origin.total_amount
|
||||
),
|
||||
'unit_price': (self.record.sale_origin.amount
|
||||
if self.record.sale_origin.__name__ == "sale.line"
|
||||
else self.record.sale_origin.total_amount),
|
||||
}
|
||||
return default
|
||||
|
||||
@@ -413,7 +319,7 @@ class CreateContract(Wizard):
|
||||
start_date=self.start.start_date,
|
||||
end_date=self.start.end_date,
|
||||
invoice_address=self.start.invoice_address,
|
||||
unit_price=self.start.unit_price,
|
||||
unit_price=self.start.unit_price
|
||||
)
|
||||
|
||||
def do_create_contract(self, action):
|
||||
@@ -440,8 +346,7 @@ class CreateContract(Wizard):
|
||||
contract.state = 'draft'
|
||||
contract.price_contract = dates['unit_price']
|
||||
else:
|
||||
contract = Contract(
|
||||
party=dates['party'],
|
||||
contract = Contract(party=dates['party'],
|
||||
invoice_address=dates['invoice_address'],
|
||||
contact=dates['contact'],
|
||||
start_date=dates['start_date'],
|
||||
@@ -449,6 +354,7 @@ class CreateContract(Wizard):
|
||||
maintenance_services=prorogues,
|
||||
current_equipments=equipments,
|
||||
state='draft',
|
||||
price_contract=dates['unit_price'],
|
||||
price_contract=dates['unit_price']
|
||||
)
|
||||
|
||||
contract.save()
|
||||
|
||||
12
contract.xml
12
contract.xml
@@ -144,24 +144,16 @@
|
||||
<field name="model">optical_equipment.contract,-1</field>
|
||||
<field name="action" ref="report_prorrogation"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.icon" id="optical_equipment_contract_icon">
|
||||
<field name="name">equipment_contract</field>
|
||||
<field name="path">icons/file-contract-solid.svg</field>
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
parent="menu_equipment"
|
||||
name="Contracts Management"
|
||||
sequence="50"
|
||||
id="menu_contracts"
|
||||
icon="equipment_contract"/>
|
||||
id="menu_contracts"/>
|
||||
<menuitem
|
||||
parent="menu_contracts"
|
||||
action="act_contract_form"
|
||||
sequence="30"
|
||||
id="menu_contract_form"
|
||||
icon="equipment_contract"/>
|
||||
id="menu_contract_form"/>
|
||||
<record model="ir.cron" id="cron_fe_delivery">
|
||||
<field name="method">optical_equipment.contract|contract_expiration</field>
|
||||
<field name="interval_number" eval="1"/>
|
||||
|
||||
10
diary.xml
10
diary.xml
@@ -94,19 +94,13 @@
|
||||
<field name="name">Agended</field>
|
||||
<field name="sequence_type" ref="sequence_type_agended"/>
|
||||
</record>
|
||||
<record model="ir.ui.icon" id="optical_equipment_schedule_icon">
|
||||
<field name="name">equipment_schedule</field>
|
||||
<field name="path">icons/calendar-days-solid.svg</field>
|
||||
</record>
|
||||
<menuitem parent="menu_equipment"
|
||||
name="Diary"
|
||||
sequence="10"
|
||||
id="menu_diary"
|
||||
icon="equipment_schedule"/>
|
||||
id="menu_diary"/>
|
||||
<menuitem parent="menu_diary"
|
||||
action="act_agended_list_form"
|
||||
sequence="20"
|
||||
id="menu_agended_list_form"
|
||||
icon="equipment_schedule"/>
|
||||
id="menu_agended_list_form"/>
|
||||
</data>
|
||||
</tryton>
|
||||
|
||||
397
equipment.py
397
equipment.py
@@ -1,19 +1,23 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
import datetime
|
||||
from collections import defaultdict
|
||||
from trytond.pool import Pool
|
||||
from trytond.model import \
|
||||
DeactivableMixin, Workflow, ModelSQL, ModelView, fields
|
||||
from trytond.pyson import Eval
|
||||
from trytond.model import (
|
||||
DeactivableMixin, Workflow, ModelSQL, ModelView, Unique, fields)
|
||||
from trytond.pyson import Eval, If
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.i18n import gettext
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.model.exceptions import AccessError
|
||||
from trytond.wizard import Button, StateAction, StateView, Wizard
|
||||
from trytond.wizard import (
|
||||
Button, StateAction, StateTransition, StateView, Wizard)
|
||||
from trytond.modules.company import CompanyReport
|
||||
|
||||
|
||||
_MAINTENANCE_FREQUENCY = [
|
||||
('none', ''), ('6', 'Seis Meses'), ('12', 'Doce Meses')]
|
||||
_MAINTENANCE_FREQUENCY = [("none", ''),
|
||||
("6", 'Seis Meses'),
|
||||
("12", 'Doce Meses')]
|
||||
|
||||
|
||||
class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
@@ -26,162 +30,104 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
'readonly': Eval('state') != 'draft',
|
||||
}
|
||||
|
||||
_states_product = {'readonly': Eval('product', True)}
|
||||
|
||||
_depends = ['state']
|
||||
|
||||
_states_serial = {
|
||||
'readonly': Eval('state') != 'draft',
|
||||
}
|
||||
|
||||
code = fields.Char('Code', states={'readonly': True})
|
||||
code = fields.Char(
|
||||
"Code", states={'readonly': True})
|
||||
|
||||
state = fields.Selection(
|
||||
[
|
||||
('draft', 'Draft'),
|
||||
('registred', 'Registred'),
|
||||
('uncontrated', 'UnContrated'),
|
||||
('contrated', 'Contrated'),
|
||||
],
|
||||
'State',
|
||||
required=True,
|
||||
readonly=True,
|
||||
sort=False,
|
||||
)
|
||||
state = fields.Selection([('draft', "Draft"),
|
||||
('registred', "Registred"),
|
||||
('uncontrated', "UnContrated"),
|
||||
('contrated', "Contrated")
|
||||
], "State",
|
||||
required=True, readonly=True, sort=False)
|
||||
|
||||
company = fields.Many2One('company.company', 'Company', readonly=True)
|
||||
contract = fields.Many2One(
|
||||
'optical_equipment.contract', 'Contract', ondelete='CASCADE'
|
||||
)
|
||||
location = fields.Many2One(
|
||||
'stock.location',
|
||||
'Location',
|
||||
states=_states,
|
||||
)
|
||||
propietary = fields.Many2One(
|
||||
'party.party',
|
||||
'Propietary',
|
||||
required=True,
|
||||
states=_states,
|
||||
)
|
||||
propietary_address = fields.Many2One(
|
||||
'party.address',
|
||||
'Propietary Address',
|
||||
required=True,
|
||||
company = fields.Many2One('company.company', "Company", readonly=True)
|
||||
contract = fields.Many2One('optical_equipment.contract', "Contract", ondelete='CASCADE')
|
||||
location = fields.Many2One('stock.location', "Location",
|
||||
states=_states,)
|
||||
propietary = fields.Many2One('party.party', "Propietary", required=True,
|
||||
states=_states,)
|
||||
propietary_address = fields.Many2One('party.address', "Propietary Address", required=True,
|
||||
domain=[('party', '=', Eval('propietary'))],
|
||||
states=_states,
|
||||
states=_states
|
||||
)
|
||||
propietarys = fields.Many2Many(
|
||||
'optical_equipment.equipment-party.party',
|
||||
'equipment', 'party', 'Propietarys'
|
||||
)
|
||||
product = fields.Many2One(
|
||||
'product.product',
|
||||
'Product',
|
||||
'equipment',
|
||||
'party',
|
||||
"Propietarys")
|
||||
product = fields.Many2One('product.product', "Product",
|
||||
domain=[('equipment', '=', True)],
|
||||
states=_states,
|
||||
depends=['equipment']
|
||||
)
|
||||
refurbish = fields.Boolean(
|
||||
'Refurbish',
|
||||
states=_states,
|
||||
refurbish = fields.Boolean("Refurbish",
|
||||
states=_states,)
|
||||
equipment_type = fields.Char('type', states={'readonly': If('product', True)})
|
||||
risk = fields.Char('Type risk', states={'readonly': If('product', True)})
|
||||
use = fields.Char('Use', states={'readonly': If('product', True)})
|
||||
biomedical_class = fields.Char('Biomedical Class', states={'readonly': If('product', True)})
|
||||
main_tecnology = fields.Char('Main tecnology', states={'readonly': If('product', True)})
|
||||
calibration = fields.Boolean("Apply calibration", states={'readonly': If('product', True)})
|
||||
mark_category = fields.Many2One('product.category', 'Mark', required=True,
|
||||
domain=[('parent', '=', None),
|
||||
('accounting', '=', False)],
|
||||
states=_states
|
||||
)
|
||||
equipment_type = fields.Char('type', states=_states_product)
|
||||
risk = fields.Char('Type risk', states=_states_product)
|
||||
use = fields.Char('Use', states=_states_product)
|
||||
biomedical_class = fields.Char('Biomedical Class', states=_states_product)
|
||||
main_tecnology = fields.Char('Main tecnology', states=_states_product)
|
||||
calibration = fields.Boolean('Apply calibration', states=_states_product)
|
||||
mark_category = fields.Many2One(
|
||||
'product.category',
|
||||
'Mark',
|
||||
required=True,
|
||||
domain=[('parent', '=', None), ('accounting', '=', False)],
|
||||
states=_states,
|
||||
)
|
||||
model_category = fields.Many2One(
|
||||
'product.category',
|
||||
'Model',
|
||||
required=True,
|
||||
model_category = fields.Many2One('product.category', "Model", required=True,
|
||||
domain=[('parent', '=', Eval('mark_category')),
|
||||
('accounting', '=', False)],
|
||||
states=_states,
|
||||
)
|
||||
reference_category = fields.Many2One(
|
||||
'product.category',
|
||||
'Reference',
|
||||
states=_states,)
|
||||
reference_category = fields.Many2One('product.category', "Reference",
|
||||
domain=[('parent', '=', Eval('model_category'))],
|
||||
states=_states,
|
||||
depends=['model_category'],
|
||||
)
|
||||
origin_country = fields.Many2One(
|
||||
'country.country',
|
||||
'Origin Country',
|
||||
states=_states,
|
||||
depends=['model_category']
|
||||
)
|
||||
origin_country = fields.Many2One('country.country', "Origin Country",
|
||||
states=_states,)
|
||||
|
||||
software_version = fields.Char(
|
||||
'Software version',
|
||||
size=None,
|
||||
states=_states,
|
||||
)
|
||||
useful_life = fields.Integer(
|
||||
'Useful life',
|
||||
states=_states,
|
||||
)
|
||||
warranty = fields.Integer(
|
||||
'Warranty',
|
||||
states=_states,
|
||||
)
|
||||
serial = fields.Char('Serial', size=None,
|
||||
states=_states_serial, depends=_depends)
|
||||
health_register = fields.Char(
|
||||
'Health Register',
|
||||
size=None,
|
||||
states=_states,
|
||||
)
|
||||
software_version = fields.Char("Software version", size=None,
|
||||
states=_states,)
|
||||
useful_life = fields.Integer("Useful life",
|
||||
states=_states,)
|
||||
warranty = fields.Integer("Warranty",
|
||||
states=_states,)
|
||||
serial = fields.Char("Serial", size=None,
|
||||
states=_states_serial,
|
||||
depends=_depends)
|
||||
health_register = fields.Char("Health Register", size=None,
|
||||
states=_states,)
|
||||
# contract_history =
|
||||
# fields.Many2Many('optical_equipment.contract-optical_equipment.equipment',
|
||||
# 'equipment','contract', 'Contracts', states={'readonly': True})
|
||||
# 'equipment','contract', "Contracts", states={'readonly': True})
|
||||
contract_history = fields.Function(
|
||||
fields.One2Many('optical_equipment.contract',
|
||||
'equipment', 'Contracts'),
|
||||
'get_contracts_of_equipment',
|
||||
)
|
||||
maintenance_history = fields.Function(
|
||||
fields.Many2Many(
|
||||
'optical_equipment.maintenance-optical_equipment.equipment',
|
||||
fields.One2Many(
|
||||
'optical_equipment.contract',
|
||||
'equipment',
|
||||
'maintenance',
|
||||
'Maintenances',
|
||||
),
|
||||
'get_maintenances_of_equipment',
|
||||
)
|
||||
software_version = fields.Char(
|
||||
'Software version',
|
||||
size=None,
|
||||
states=_states,
|
||||
)
|
||||
"Contracts"),
|
||||
'get_contracts_of_equipment')
|
||||
maintenance_history = fields.Function(
|
||||
fields.Many2Many('optical_equipment.maintenance-optical_equipment.equipment',
|
||||
'equipment', 'maintenance', "Maintenances"), 'get_maintenances_of_equipment')
|
||||
software_version = fields.Char("Software version", size=None,
|
||||
states=_states,)
|
||||
|
||||
maintenance_frequency = fields.Selection(
|
||||
_MAINTENANCE_FREQUENCY, 'Maintenance Frequency',
|
||||
depends=['propietary']
|
||||
)
|
||||
purchase_origin = fields.Reference(
|
||||
'Purchase Origin',
|
||||
selection='get_origin', states={'readonly': True}
|
||||
)
|
||||
sale_destination = fields.Reference(
|
||||
'Sale Destination',
|
||||
selection='get_destination', states={'readonly': True}
|
||||
)
|
||||
shipment_destination = fields.Reference(
|
||||
'Stock Move', selection='get_shipment', states={'readonly': True}
|
||||
)
|
||||
rec_name = fields.Function(fields.Char('rec_name'), 'get_rec_name')
|
||||
maintenance_frequency = fields.Selection(_MAINTENANCE_FREQUENCY, "Maintenance Frequency",
|
||||
depends=['propietary'])
|
||||
purchase_origin = fields.Reference("Purchase Origin", selection='get_origin',
|
||||
states={'readonly': True})
|
||||
sale_destination = fields.Reference("Sale Destination", selection='get_destination',
|
||||
states={'readonly': True})
|
||||
shipment_destination = fields.Reference("Stock Move", selection='get_shipment',
|
||||
states={'readonly': True})
|
||||
rec_name = fields.Function(fields.Char("rec_name"), 'get_rec_name')
|
||||
|
||||
technician_responsible = fields.Function(
|
||||
fields.Char('Technician Responsible'), 'get_technical'
|
||||
)
|
||||
technician_responsible = fields.Function(fields.Char('Technician Responsible'), 'get_technical')
|
||||
invima = fields.Function(fields.Char('Invima'), 'get_invima')
|
||||
|
||||
del _states_serial, _states, _depends
|
||||
@@ -202,14 +148,13 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
if config.technician_responsible.invima:
|
||||
return config.technician_responsible.invima
|
||||
|
||||
@fields.depends('product', 'serial', 'code')
|
||||
@ fields.depends('product', 'serial', 'code')
|
||||
def get_rec_name(self, name):
|
||||
name = str(self.product.name) + '@' + \
|
||||
str(self.serial) + '/' + str(self.code)
|
||||
name = str(self.product.name) + '@' + str(self.serial) + '/' + str(self.code)
|
||||
|
||||
return name
|
||||
|
||||
@staticmethod
|
||||
@ staticmethod
|
||||
def _get_shipment():
|
||||
'Return list of Model names for shipment Reference'
|
||||
return [
|
||||
@@ -220,7 +165,7 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
'stock.shipment.internal',
|
||||
]
|
||||
|
||||
@classmethod
|
||||
@ classmethod
|
||||
def get_shipment(cls):
|
||||
IrModel = Pool().get('ir.model')
|
||||
get_name = IrModel.get_name
|
||||
@@ -228,7 +173,7 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
|
||||
return [(None, '')] + [(m, get_name(m)) for m in models]
|
||||
|
||||
@classmethod
|
||||
@ classmethod
|
||||
def _get_origin(cls):
|
||||
'Return list of Model names for origin Reference'
|
||||
pool = Pool()
|
||||
@@ -236,7 +181,7 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
|
||||
return [Purchase.__name__]
|
||||
|
||||
@classmethod
|
||||
@ classmethod
|
||||
def get_origin(cls):
|
||||
Model = Pool().get('ir.model')
|
||||
get_name = Model.get_name
|
||||
@@ -244,7 +189,7 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
|
||||
return [(None, '')] + [(m, get_name(m)) for m in models]
|
||||
|
||||
@classmethod
|
||||
@ classmethod
|
||||
def _get_destination(cls):
|
||||
'Return list of Model names for origin Reference'
|
||||
pool = Pool()
|
||||
@@ -252,7 +197,7 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
|
||||
return [Sale.__name__]
|
||||
|
||||
@classmethod
|
||||
@ classmethod
|
||||
def get_destination(cls):
|
||||
Model = Pool().get('ir.model')
|
||||
get_name = Model.get_name
|
||||
@@ -260,27 +205,23 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
|
||||
return [(None, '')] + [(m, get_name(m)) for m in models]
|
||||
|
||||
@classmethod
|
||||
@ classmethod
|
||||
def __setup__(cls):
|
||||
super(OpticalEquipment, cls).__setup__()
|
||||
cls._transitions = {
|
||||
cls._transitions = ({
|
||||
('draft', 'registred'),
|
||||
('registred', 'draft'),
|
||||
('registred', 'uncontrated'),
|
||||
('uncontrated', 'contrated'),
|
||||
}
|
||||
cls._buttons.update(
|
||||
{
|
||||
'draft': {'invisible': Eval('state') != 'registred'},
|
||||
})
|
||||
cls._buttons.update({
|
||||
'draft': {
|
||||
'invisible': Eval('state') != 'registred'},
|
||||
'registred': {
|
||||
'invisible': Eval('state').in_(
|
||||
['registred', 'uncontrated', 'contrated']
|
||||
)
|
||||
},
|
||||
}
|
||||
'invisible': Eval('state').in_(['registred', 'uncontrated', 'contrated'])}}
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@ classmethod
|
||||
def set_code(cls, equipments):
|
||||
pool = Pool()
|
||||
Config = pool.get('optical_equipment.configuration')
|
||||
@@ -295,8 +236,7 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
except UserError:
|
||||
raise UserError(str('Validation Error'))
|
||||
else:
|
||||
raise UserError(
|
||||
gettext('optical_equipment.msg_not_sequence_equipment'))
|
||||
raise UserError(gettext('optical_equipment.msg_not_sequence_equipment'))
|
||||
|
||||
def get_contracts_of_equipment(self, records):
|
||||
pool = Pool()
|
||||
@@ -304,9 +244,7 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
contractsEquipment = set()
|
||||
|
||||
contractsEquipment = ContractsEquipment.search(
|
||||
[('party', '=', self.propietary),
|
||||
('history_equipments', 'in', [self.id])]
|
||||
)
|
||||
[('party', '=', self.propietary), ('history_equipments', 'in', [self.id])])
|
||||
contracts = []
|
||||
|
||||
for key in contractsEquipment:
|
||||
@@ -319,9 +257,7 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
MaintenancesEquipment = pool.get('optical_equipment.maintenance')
|
||||
maintenancesEquipment = set()
|
||||
|
||||
maintenancesEquipment = MaintenancesEquipment.search(
|
||||
['equipment', '=', self.id]
|
||||
)
|
||||
maintenancesEquipment = MaintenancesEquipment.search(['equipment', '=', self.id])
|
||||
maintenances = []
|
||||
|
||||
for key in maintenancesEquipment:
|
||||
@@ -336,26 +272,26 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
if config.technician_signature:
|
||||
return config.technician_signature
|
||||
|
||||
@classmethod
|
||||
@ classmethod
|
||||
def default_state(cls):
|
||||
return 'draft'
|
||||
|
||||
@staticmethod
|
||||
@ staticmethod
|
||||
def default_company():
|
||||
return Transaction().context.get('company')
|
||||
|
||||
@fields.depends('propietary', 'maintenance_frequency')
|
||||
@ fields.depends('propietary', 'maintenance_frequency')
|
||||
def on_change_propietary(self):
|
||||
if self.propietary:
|
||||
if self.propietary.customer_type == 'ips':
|
||||
self.maintenance_frequency = '6'
|
||||
self.maintenance_frequency = "6"
|
||||
else:
|
||||
self.maintenance_frequency = '12'
|
||||
self.maintenance_frequency = "12"
|
||||
else:
|
||||
self.maintenance_frequency = 'none'
|
||||
self.maintenance_frequency = "none"
|
||||
|
||||
@fields.depends('product', 'equipment_type',
|
||||
'use', 'biomedical_class', 'calibration',
|
||||
@ fields.depends('product', 'equipment_type', 'use',
|
||||
'biomedical_class', 'calibration',
|
||||
'mark_category', 'model_category')
|
||||
def on_change_product(self):
|
||||
if self.product:
|
||||
@@ -366,13 +302,9 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
self.mark_category = self.product.mark_category
|
||||
self.model_category = self.product.model_category
|
||||
self.reference_category = self.product.reference_category
|
||||
self.useful_life = (
|
||||
self.product.useful_life if self.product.useful_life else int(
|
||||
0)
|
||||
)
|
||||
self.useful_life = self.product.useful_life if self.product.useful_life else int(0)
|
||||
self.calibration = True if self.product.calibration else False
|
||||
self.warranty =\
|
||||
self.product.warranty if self.product.warranty else int(0)
|
||||
self.warranty = self.product.warranty if self.product.warranty else int(0)
|
||||
self.risk = self.product.risk
|
||||
self.origin_country = self.product.origin_country
|
||||
self.use = self.product.use
|
||||
@@ -397,28 +329,30 @@ class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
|
||||
self.health_register = None
|
||||
self.software_version = None
|
||||
|
||||
@classmethod
|
||||
@ classmethod
|
||||
def delete(cls, equipments):
|
||||
for equipment in equipments:
|
||||
if equipment.purchase_origin:
|
||||
raise AccessError(gettext('estos equipos no se pueden borrar'))
|
||||
raise AccessError(
|
||||
gettext('estos equipos no se pueden borrar'))
|
||||
elif equipment.state != 'draft' and equipment.serial is not None:
|
||||
raise AccessError(gettext('estos equipos no se pueden borrar'))
|
||||
raise AccessError(
|
||||
gettext('estos equipos no se pueden borrar'))
|
||||
super(OpticalEquipment, cls).delete(equipments)
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
@Workflow.transition('draft')
|
||||
@ classmethod
|
||||
@ ModelView.button
|
||||
@ Workflow.transition('draft')
|
||||
def draft(cls, equipments):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
@Workflow.transition('registred')
|
||||
@ classmethod
|
||||
@ ModelView.button
|
||||
@ Workflow.transition('registred')
|
||||
def registred(cls, equipments):
|
||||
for i in equipments:
|
||||
if i.serial is None:
|
||||
raise UserError(str('El Equipo no cuenta con un Serial'))
|
||||
raise UserError(str("El Equipo no cuenta con un Serial"))
|
||||
else:
|
||||
cls.set_code(equipments)
|
||||
|
||||
@@ -427,72 +361,43 @@ class EquipmentMaintenance(ModelSQL, ModelView):
|
||||
'Optical Equipment - Equipment - Maintenance'
|
||||
__name__ = 'optical_equipment.maintenance-optical_equipment.equipment'
|
||||
|
||||
equipment = fields.Many2One(
|
||||
'optical_equipment.equipment',
|
||||
'Equipment',
|
||||
)
|
||||
maintenance = fields.Many2One(
|
||||
'optical_equipment.maintenance',
|
||||
'Maintenances',
|
||||
)
|
||||
equipment = fields.Many2One('optical_equipment.equipment', 'Equipment', )
|
||||
maintenance = fields.Many2One('optical_equipment.maintenance', 'Maintenances', )
|
||||
|
||||
|
||||
class EquipmentContract(ModelSQL, ModelView):
|
||||
'Optical Equipment - Contracs Equipment'
|
||||
__name__ = 'optical_equipment.contract-optical_equipment.equipment'
|
||||
|
||||
equipment = fields.Many2One(
|
||||
'optical_equipment.equipment',
|
||||
'Equipment',
|
||||
)
|
||||
contract = fields.Many2One(
|
||||
'optical_equipment.contract',
|
||||
'Contract',
|
||||
)
|
||||
equipment = fields.Many2One('optical_equipment.equipment', 'Equipment', )
|
||||
contract = fields.Many2One('optical_equipment.contract', 'Contract', )
|
||||
|
||||
|
||||
class EquipmentParty(ModelSQL, ModelView):
|
||||
'Optical Equipment - Party'
|
||||
__name__ = 'optical_equipment.equipment-party.party'
|
||||
|
||||
equipment = fields.Many2One(
|
||||
'optical_equipment.equipment',
|
||||
'Equipment',
|
||||
)
|
||||
party = fields.Many2One(
|
||||
'party.party',
|
||||
'Party',
|
||||
)
|
||||
equipment = fields.Many2One('optical_equipment.equipment', "Equipment", )
|
||||
party = fields.Many2One('party.party', "Party", )
|
||||
|
||||
|
||||
class ChangePropietary(ModelView):
|
||||
'Change of Propietary Equipment'
|
||||
__name__ = 'optical_equipment.change_propietary.form'
|
||||
|
||||
old_propietary = fields.Many2One(
|
||||
'party.party', 'Old Propietary', states={'required': True}
|
||||
)
|
||||
equipments = fields.Many2Many(
|
||||
'optical_equipment.equipment',
|
||||
None,
|
||||
None,
|
||||
'Equipments',
|
||||
old_propietary = fields.Many2One('party.party', 'Old Propietary',
|
||||
states={'required': True})
|
||||
equipments = fields.Many2Many('optical_equipment.equipment', None, None, "Equipments",
|
||||
domain=[('propietary', '=', Eval('old_propietary'))],
|
||||
depends=['old_propietary'],
|
||||
)
|
||||
new_propietary = fields.Many2One(
|
||||
'party.party', 'New Propietary', states={'required': True}
|
||||
)
|
||||
new_address = fields.Many2One(
|
||||
'party.address',
|
||||
'New Address',
|
||||
required=True,
|
||||
depends=['old_propietary'])
|
||||
new_propietary = fields.Many2One('party.party', "New Propietary",
|
||||
states={'required': True})
|
||||
new_address = fields.Many2One('party.address', "New Address", required=True,
|
||||
domain=[('party', '=', Eval('new_propietary'))],
|
||||
states={'required': True},
|
||||
)
|
||||
change_date = fields.Date('Change Date', readonly=True)
|
||||
states={'required': True})
|
||||
change_date = fields.Date("Change Date", readonly=True)
|
||||
|
||||
@classmethod
|
||||
@ classmethod
|
||||
def default_change_date(cls):
|
||||
pool = Pool()
|
||||
Date = pool.get('ir.date')
|
||||
@@ -503,18 +408,15 @@ class NewPropietary(Wizard):
|
||||
'Change Propietary'
|
||||
__name__ = 'optical_equipment.change_propietary'
|
||||
|
||||
start = StateView(
|
||||
'optical_equipment.change_propietary.form',
|
||||
'optical_equipment.change_propietary_view_form',
|
||||
[
|
||||
start = StateView('optical_equipment.change_propietary.form',
|
||||
'optical_equipment.change_propietary_view_form', [
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Create', 'change_propietary', 'tryton-ok', default=True),
|
||||
],
|
||||
)
|
||||
change_propietary = StateAction(
|
||||
'optical_equipment.act_optical_equipment_form')
|
||||
])
|
||||
change_propietary = StateAction('optical_equipment.act_optical_equipment_form')
|
||||
|
||||
def do_change_propietary(self, action):
|
||||
old_propietary = self.start.old_propietary
|
||||
equipments = self.start.equipments
|
||||
new_propietary = self.start.new_propietary
|
||||
new_address = self.start.new_address
|
||||
@@ -523,9 +425,7 @@ class NewPropietary(Wizard):
|
||||
equipment.propietarys += (equipment.propietary,)
|
||||
equipment.propietary = new_propietary
|
||||
equipment.propietary_address = new_address
|
||||
equipment.maintenance_frequency = (
|
||||
'6' if new_propietary.customer_type == 'ips' else '12'
|
||||
)
|
||||
equipment.maintenance_frequency = "6" if new_propietary.customer_type == 'ips' else "12"
|
||||
equipment.save()
|
||||
|
||||
|
||||
@@ -534,22 +434,21 @@ class ChangeEquipment(ModelSQL):
|
||||
__name__ = 'optical_equipment.equipment-change_propietary.form'
|
||||
|
||||
maintenance_service = fields.Many2One(
|
||||
'optical_equipment_maintenance.service', 'Maintenance Service'
|
||||
)
|
||||
'optical_equipment_maintenance.service',
|
||||
"Maintenance Service")
|
||||
equipment = fields.Many2One('optical_equipment.equipment', 'Equipment')
|
||||
change = fields.Many2One(
|
||||
'optical_equipment.change_propietary.form', 'Change')
|
||||
change = fields.Many2One('optical_equipment.change_propietary.form', 'Change')
|
||||
|
||||
|
||||
class EquipmentReport(CompanyReport):
|
||||
__name__ = 'optical_equipment.equipment'
|
||||
|
||||
@classmethod
|
||||
@ classmethod
|
||||
def execute(cls, ids, data):
|
||||
with Transaction().set_context(address_with_party=True):
|
||||
return super(EquipmentReport, cls).execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
@ classmethod
|
||||
def get_context(cls, records, header, data):
|
||||
pool = Pool()
|
||||
Date = pool.get('ir.date')
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
<field name="user" ref="res.user_admin"/>
|
||||
<field name="group" ref="group_equipment_admin"/>
|
||||
</record>
|
||||
<menuitem
|
||||
name="Equipment"
|
||||
sequence="40"
|
||||
id="menu_equipment"/>
|
||||
<record model="ir.action.act_window" id="act_optical_equipment_form">
|
||||
<field name="name">Equipments</field>
|
||||
<field name="res_model">optical_equipment.equipment</field>
|
||||
@@ -89,6 +93,11 @@
|
||||
<field name="confirm">Are you sure you want to registred these equipments?</field>
|
||||
<field name="model" search="[('model', '=', 'optical_equipment.equipment')]"/>
|
||||
</record>
|
||||
<menuitem parent="menu_equipment"
|
||||
action="act_optical_equipment_form"
|
||||
sequence="60"
|
||||
id="menu_optical_equipment_form"/>
|
||||
|
||||
<record model="ir.action.act_window" id="act_optical_equipment_form1">
|
||||
<field name="name">Serials</field>
|
||||
<field name="res_model">optical_equipment.equipment</field>
|
||||
@@ -113,6 +122,12 @@
|
||||
<field name="count" eval="True"/>
|
||||
<field name="act_window" ref="act_optical_equipment_form1"/>
|
||||
</record>
|
||||
<menuitem
|
||||
parent="menu_equipment"
|
||||
action="act_optical_equipment_form1"
|
||||
sequence="70"
|
||||
id="menu_optical_equipment_serial_form"/>
|
||||
|
||||
<record model="ir.action.report" id="report_equipment">
|
||||
<field name="name">Equipment</field>
|
||||
<field name="model">optical_equipment.equipment</field>
|
||||
@@ -152,31 +167,5 @@
|
||||
<field name="model">optical_equipment.equipment,-1</field>
|
||||
<field name="action" ref="equipment_change_propietary"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.icon" id="optical_equipment_serials_icon">
|
||||
<field name="name">equipment_serial</field>
|
||||
<field name="path">icons/barcode-solid.svg</field>
|
||||
</record>
|
||||
<record model="ir.ui.icon" id="optical_equipment_optical_icon">
|
||||
<field name="name">optical</field>
|
||||
<field name="path">icons/microscope-solid.svg</field>
|
||||
</record>
|
||||
<menuitem
|
||||
name="Equipment"
|
||||
sequence="40"
|
||||
id="menu_equipment"
|
||||
icon="optical"/>
|
||||
<menuitem
|
||||
parent="menu_equipment"
|
||||
action="act_optical_equipment_form"
|
||||
sequence="60"
|
||||
id="menu_optical_equipment_form"
|
||||
icon="optical"/>
|
||||
<menuitem
|
||||
parent="menu_equipment"
|
||||
action="act_optical_equipment_form1"
|
||||
sequence="70"
|
||||
id="menu_optical_equipment_serial_form"
|
||||
icon="equipment_serial"/>
|
||||
</data>
|
||||
</tryton>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M24 32C10.7 32 0 42.7 0 56V456c0 13.3 10.7 24 24 24H40c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24H24zm88 0c-8.8 0-16 7.2-16 16V464c0 8.8 7.2 16 16 16s16-7.2 16-16V48c0-8.8-7.2-16-16-16zm72 0c-13.3 0-24 10.7-24 24V456c0 13.3 10.7 24 24 24h16c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24H184zm96 0c-13.3 0-24 10.7-24 24V456c0 13.3 10.7 24 24 24h16c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24H280zM448 56V456c0 13.3 10.7 24 24 24h16c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24H472c-13.3 0-24 10.7-24 24zm-64-8V464c0 8.8 7.2 16 16 16s16-7.2 16-16V48c0-8.8-7.2-16-16-16s-16 7.2-16 16z"/></svg>
|
||||
|
Before Width: | Height: | Size: 814 B |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M128 0c17.7 0 32 14.3 32 32V64H288V32c0-17.7 14.3-32 32-32s32 14.3 32 32V64h48c26.5 0 48 21.5 48 48v48H0V112C0 85.5 21.5 64 48 64H96V32c0-17.7 14.3-32 32-32zM0 192H448V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V192zm64 80v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16zm128 0v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H208c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V272c0-8.8-7.2-16-16-16H336zM64 400v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H80c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H208zm112 16v32c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V400c0-8.8-7.2-16-16-16H336c-8.8 0-16 7.2-16 16z"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M64 0C28.7 0 0 28.7 0 64V448c0 35.3 28.7 64 64 64H320c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zM256 0V128H384L256 0zM80 64h64c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16-7.2-16-16s7.2-16 16-16zm0 64h64c8.8 0 16 7.2 16 16s-7.2 16-16 16H80c-8.8 0-16-7.2-16-16s7.2-16 16-16zm54.2 253.8c-6.1 20.3-24.8 34.2-46 34.2H80c-8.8 0-16-7.2-16-16s7.2-16 16-16h8.2c7.1 0 13.3-4.6 15.3-11.4l14.9-49.5c3.4-11.3 13.8-19.1 25.6-19.1s22.2 7.7 25.6 19.1l11.6 38.6c7.4-6.2 16.8-9.7 26.8-9.7c15.9 0 30.4 9 37.5 23.2l4.4 8.8H304c8.8 0 16 7.2 16 16s-7.2 16-16 16H240c-6.1 0-11.6-3.4-14.3-8.8l-8.8-17.7c-1.7-3.4-5.1-5.5-8.8-5.5s-7.2 2.1-8.8 5.5l-8.8 17.7c-2.9 5.9-9.2 9.4-15.7 8.8s-12.1-5.1-13.9-11.3L144 349l-9.8 32.8z"/></svg>
|
||||
|
Before Width: | Height: | Size: 942 B |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M228.3 469.1L47.6 300.4c-4.2-3.9-8.2-8.1-11.9-12.4h87c22.6 0 43-13.6 51.7-34.5l10.5-25.2 49.3 109.5c3.8 8.5 12.1 14 21.4 14.1s17.8-5 22-13.3L320 253.7l1.7 3.4c9.5 19 28.9 31 50.1 31H476.3c-3.7 4.3-7.7 8.5-11.9 12.4L283.7 469.1c-7.5 7-17.4 10.9-27.7 10.9s-20.2-3.9-27.7-10.9zM503.7 240h-132c-3 0-5.8-1.7-7.2-4.4l-23.2-46.3c-4.1-8.1-12.4-13.3-21.5-13.3s-17.4 5.1-21.5 13.3l-41.4 82.8L205.9 158.2c-3.9-8.7-12.7-14.3-22.2-14.1s-18.1 5.9-21.8 14.8l-31.8 76.3c-1.2 3-4.2 4.9-7.4 4.9H16c-2.6 0-5 .4-7.3 1.1C3 225.2 0 208.2 0 190.9v-5.8c0-69.9 50.5-129.5 119.4-141C165 36.5 211.4 51.4 244 84l12 12 12-12c32.6-32.6 79-47.5 124.6-39.9C461.5 55.6 512 115.2 512 185.1v5.8c0 16.9-2.8 33.5-8.3 49.1z"/></svg>
|
||||
|
Before Width: | Height: | Size: 916 B |
@@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M160 32c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32c17.7 0 32 14.3 32 32V288c0 17.7-14.3 32-32 32c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32c-17.7 0-32-14.3-32-32V64c0-17.7 14.3-32 32-32zM32 448H320c70.7 0 128-57.3 128-128s-57.3-128-128-128V128c106 0 192 86 192 192c0 49.2-18.5 94-48.9 128H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320 32c-17.7 0-32-14.3-32-32s14.3-32 32-32zm80-64H304c8.8 0 16 7.2 16 16s-7.2 16-16 16H112c-8.8 0-16-7.2-16-16s7.2-16 16-16z"/></svg>
|
||||
|
Before Width: | Height: | Size: 690 B |
881
maintenance.py
881
maintenance.py
File diff suppressed because it is too large
Load Diff
@@ -111,7 +111,7 @@
|
||||
</record>
|
||||
<record model="ir.ui.view" id= "maintenance_equipment_view_form">
|
||||
<field name="model">optical_equipment.maintenance-optical_equipment.equipment</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit" ref="maintenance_view_form"/>
|
||||
<field name="name">maintenance_equipment_form</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="maintenance_activity_view_form">
|
||||
@@ -184,12 +184,6 @@
|
||||
<field name="string">Finished</field>
|
||||
<field name="model" search="[('model', '=', 'optical_equipment_maintenance.service')]"/>
|
||||
</record>
|
||||
<record model="ir.model.button" id="maintenance_in_progress_button">
|
||||
<field name="name">in_progress</field>
|
||||
<field name="string">In progress</field>
|
||||
<field name="model" search="[('model', '=', 'optical_equipment.maintenance')]"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.model.button" id="maintenance_finished_button">
|
||||
<field name="name">finished</field>
|
||||
<field name="string">Finished</field>
|
||||
@@ -275,20 +269,13 @@
|
||||
<field name="model">optical_equipment_maintenance.service,-1</field>
|
||||
<field name="action" ref="equipment_change_propietary_maintenance"/>
|
||||
</record>
|
||||
<record model="ir.ui.icon" id="optical_equipment_health_icon">
|
||||
<field name="name">equipment_health</field>
|
||||
<field name="path">icons/heart-pulse-solid.svg</field>
|
||||
</record>
|
||||
|
||||
<menuitem parent="menu_equipment"
|
||||
action="act_maintenance_service_form"
|
||||
sequence="20"
|
||||
id="menu_maintenance_service_form"
|
||||
icon="equipment_health"/>
|
||||
id="menu_maintenance_service_form"/>
|
||||
<menuitem parent="menu_maintenance_service_form"
|
||||
action="act_maintenance_form"
|
||||
sequence="30"
|
||||
id="menu_maintenance_form"
|
||||
icon="equipment_health"/>
|
||||
id="menu_maintenance_form"/>
|
||||
</data>
|
||||
</tryton>
|
||||
|
||||
16
messages.xml
16
messages.xml
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data grouped="1">
|
||||
<record model="ir.message" id="line_without_serial">
|
||||
<field name="text">La linea de envio se encuentra sin serial. Debe asignar un equipo a cada linea correspondiente.</field>
|
||||
</record>
|
||||
<record model="ir.message" id="msg_not_sequence_equipment">
|
||||
<field name="text">Asigne una secuencia para enumerar equipos.</field>
|
||||
</record>
|
||||
<record model="ir.message" id="msg_finished_mantenance_service">
|
||||
<field name="text">Debe finalizar las líneas de Mantenimiento Primero.</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
226
move.py
226
move.py
@@ -6,8 +6,6 @@ from trytond.pyson import Eval, If
|
||||
from trytond.exceptions import UserError
|
||||
from itertools import groupby
|
||||
from trytond.transaction import Transaction, without_check_access
|
||||
from trytond.model.exceptions import ValidationError
|
||||
from trytond.i18n import gettext
|
||||
|
||||
from functools import wraps
|
||||
|
||||
@@ -21,63 +19,39 @@ def process_sale(moves_field):
|
||||
transaction = Transaction()
|
||||
context = transaction.context
|
||||
with without_check_access():
|
||||
sales = set(
|
||||
m.sale
|
||||
for s in cls.browse(shipments)
|
||||
for m in getattr(s, moves_field)
|
||||
if m.sale
|
||||
)
|
||||
sales = set(m.sale for s in cls.browse(shipments)
|
||||
for m in getattr(s, moves_field) if m.sale)
|
||||
func(cls, shipments)
|
||||
if sales:
|
||||
with transaction.set_context(
|
||||
queue_batch=context.get('queue_batch', True)
|
||||
):
|
||||
queue_batch=context.get('queue_batch', True)):
|
||||
Sale.__queue__.process(sales)
|
||||
|
||||
return wrapper
|
||||
|
||||
return _process_sale
|
||||
|
||||
|
||||
class Move(metaclass=PoolMeta):
|
||||
'Stock Move'
|
||||
__name__ = 'stock.move'
|
||||
"Stock Move"
|
||||
__name__ = "stock.move"
|
||||
|
||||
_states = {
|
||||
'invisible': ~Eval('product_equipment'),
|
||||
'readonly': (Eval('state').in_(['cancelled', 'done'])),
|
||||
}
|
||||
|
||||
product_equipment = fields.Function(
|
||||
fields.Boolean('It Equipment'), 'get_product_equipment'
|
||||
return_equipment = fields.Boolean("Devolución", states={'invisible': If(~Eval('product_equipment'), True),
|
||||
'readonly': (Eval('state').in_(['cancelled', 'done'])), }
|
||||
)
|
||||
|
||||
return_equipment = fields.Boolean(
|
||||
'Devolución',
|
||||
states=_states)
|
||||
|
||||
equipment = fields.Many2One(
|
||||
'optical_equipment.equipment',
|
||||
'Equipment',
|
||||
domain=[
|
||||
If(
|
||||
Eval('return_equipment', True),
|
||||
equipment = fields.Many2One('optical_equipment.equipment', "Equipment",
|
||||
domain=[If(Eval('return_equipment', True),
|
||||
('state', 'in', ['uncontrated', 'contrated']),
|
||||
('state', '=', 'registred'),
|
||||
),
|
||||
('product', '=', Eval('product')),
|
||||
('state', '=', 'registred')),
|
||||
('product', '=', Eval('product'))
|
||||
],
|
||||
states=_states,
|
||||
depends=['product_equipment'],
|
||||
)
|
||||
equipment_serial = fields.Function(
|
||||
fields.Char(
|
||||
'Serial',
|
||||
states=_states,
|
||||
depends=['product_equipment'],
|
||||
),
|
||||
'get_equipment_serial',
|
||||
)
|
||||
states={'invisible': If(~Eval('product_equipment'), True),
|
||||
'readonly': (Eval('state').in_(['cancelled', 'done'])), },
|
||||
depends=['product_equipment', 'move_type'])
|
||||
equipment_serial = fields.Function(fields.Char('Serial',
|
||||
states={'readonly': True,
|
||||
'invisible': If(~Eval('product_equipment'), True)},
|
||||
depends=['product_equipment']),
|
||||
'get_equipment_serial')
|
||||
product_equipment = fields.Function(fields.Boolean("It Equipment"), 'get_product_equipment')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
@@ -98,7 +72,14 @@ class Move(metaclass=PoolMeta):
|
||||
else:
|
||||
return None
|
||||
|
||||
@fields.depends('equipment', methods=['get_equipment_serial'])
|
||||
@fields.depends('product', 'equipment', 'uom')
|
||||
def on_change_product(self):
|
||||
if self.product:
|
||||
if (not self.uom
|
||||
or self.uom.category != self.product.default_uom.category):
|
||||
self.uom = self.product.default_uom
|
||||
|
||||
@fields.depends(methods=['get_equipment_serial'])
|
||||
def on_change_equipment(self):
|
||||
if self.equipment:
|
||||
self.product = self.equipment.product.id
|
||||
@@ -108,39 +89,27 @@ class Move(metaclass=PoolMeta):
|
||||
|
||||
|
||||
class ShipmentOut(metaclass=PoolMeta):
|
||||
'Customer Shipment'
|
||||
"Customer Shipment"
|
||||
__name__ = 'stock.shipment.out'
|
||||
|
||||
service_maintenance_initial = fields.Boolean(
|
||||
'Maintenance Initial', states={'readonly': True}
|
||||
)
|
||||
service_maintenance_initial = fields.Boolean('Maintenance Initial', states={'readonly': True})
|
||||
sale_type = fields.Char('Type sale origin')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(ShipmentOut, cls).__setup__()
|
||||
cls._buttons.update(
|
||||
{
|
||||
cls._buttons.update({
|
||||
'maintenance_initial': {
|
||||
'invisible': (
|
||||
(Eval('service_maintenance_initial', True))
|
||||
| (Eval('sale_type').in_(['maintenance', 'replaces']))
|
||||
)
|
||||
}
|
||||
}
|
||||
)
|
||||
'invisible': ((Eval('service_maintenance_initial', True))
|
||||
| (Eval('sale_type').in_(['maintenance', 'replaces'])))}
|
||||
})
|
||||
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(ShipmentOut, cls).view_attributes() + [
|
||||
(
|
||||
"//page[@name='inventory_moves']",
|
||||
'states',
|
||||
{
|
||||
('//page[@name="inventory_moves"]', 'states', {
|
||||
'invisible': False,
|
||||
},
|
||||
),
|
||||
]
|
||||
}),]
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
@@ -156,47 +125,35 @@ class ShipmentOut(metaclass=PoolMeta):
|
||||
for shipment in shipments:
|
||||
for move in shipment.inventory_moves:
|
||||
count = 0
|
||||
if not move.equipment:
|
||||
count += 1
|
||||
continue
|
||||
|
||||
if move.equipment:
|
||||
equipment = move.equipment
|
||||
Id = equipment.id
|
||||
equipment = Equipments.search(['id', '=', Id])[0]
|
||||
equipment.propietary = shipment.customer.id
|
||||
equipment.propietary_address = shipment.delivery_address.id
|
||||
equipment.location = Locations.search(
|
||||
['name', '=', 'Customer'])[0].id
|
||||
equipment.state = 'uncontrated'
|
||||
equipment.location = Locations.search(['name', '=', 'Cliente'])[0].id
|
||||
equipment.state = "uncontrated"
|
||||
equipment.shipment_destination = shipment
|
||||
equipment.sale_destination =\
|
||||
shipment.outgoing_moves[count].origin
|
||||
equipment.sale_destination = shipment.outgoing_moves[count].origin
|
||||
equipment.propietarys += (shipment.customer,)
|
||||
equipment.maintenance_frequency = (
|
||||
'6'
|
||||
if shipment.customer.customer_type == 'ips'
|
||||
else '12'
|
||||
)
|
||||
equipment.maintenance_frequency = "6" if shipment.customer.customer_type == "ips" else "12"
|
||||
count += 1
|
||||
equipment.save()
|
||||
else:
|
||||
count += 1
|
||||
|
||||
Move.delete([
|
||||
m for s in shipments
|
||||
for m in s.outgoing_moves
|
||||
if m.state == 'staging'
|
||||
])
|
||||
m for s in shipments for m in s.outgoing_moves
|
||||
if m.state == 'staging'])
|
||||
|
||||
Move.do([m for s in shipments for m in s.outgoing_moves])
|
||||
iterator = groupby(shipments, key=lambda s: s.company)
|
||||
for company, c_shipments in iterator:
|
||||
for company, c_shipments in groupby(
|
||||
shipments, key=lambda s: s.company):
|
||||
with Transaction().set_context(company=company.id):
|
||||
today = Date.today()
|
||||
cls.write(
|
||||
[s for s in c_shipments if not s.effective_date],
|
||||
{
|
||||
cls.write([s for s in c_shipments if not s.effective_date], {
|
||||
'effective_date': today,
|
||||
},
|
||||
)
|
||||
})
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
@@ -204,6 +161,9 @@ class ShipmentOut(metaclass=PoolMeta):
|
||||
pool = Pool()
|
||||
MaintenanceService = pool.get('optical_equipment_maintenance.service')
|
||||
Maintenance = pool.get('optical_equipment.maintenance')
|
||||
SaleLine = pool.get('sale.line')
|
||||
|
||||
Equipments = pool.get('optical_equipment.equipment')
|
||||
|
||||
for shipment in shipments:
|
||||
serial = False
|
||||
@@ -223,12 +183,11 @@ class ShipmentOut(metaclass=PoolMeta):
|
||||
if number_equipments < 1 or maintenance_required < 1:
|
||||
shipment.service_maintenance_initial = True
|
||||
shipment.save()
|
||||
# raise UserError(str("No se generó un mantenimiento inicial dado que los equipos no requiren mantenimiento, ó no se encontró ningún producto de tipo equipo en este envío."))
|
||||
break
|
||||
|
||||
sale_origin = shipment.outgoing_moves[0].origin.sale
|
||||
maintenanceService = MaintenanceService.search(
|
||||
['sale_origin', '=', sale_origin]
|
||||
)
|
||||
maintenanceService = MaintenanceService.search(['sale_origin', '=', sale_origin])
|
||||
if maintenanceService == []:
|
||||
maintenanceService = MaintenanceService(
|
||||
sale_date=shipment.outgoing_moves[0].origin.sale.sale_date,
|
||||
@@ -236,67 +195,41 @@ class ShipmentOut(metaclass=PoolMeta):
|
||||
maintenance_type='initial',
|
||||
propietary=shipment.customer.id,
|
||||
propietary_address=shipment.delivery_address.id,
|
||||
state='draft',
|
||||
)
|
||||
state='draft')
|
||||
maintenanceService.save()
|
||||
else:
|
||||
maintenanceService = maintenanceService[0]
|
||||
maintenanceService.state = 'draft'
|
||||
maintenanceService.save()
|
||||
|
||||
if not serial:
|
||||
error = 'Por favor Primero debe Asignar'
|
||||
+ 'un serial a todos los Equipos.'
|
||||
raise UserError(str(error))
|
||||
|
||||
if serial == True:
|
||||
for move in shipment.inventory_moves:
|
||||
valid = \
|
||||
move.product_equipment \
|
||||
and move.equipment \
|
||||
and move.equipment.product.template.maintenance_required
|
||||
|
||||
if (not valid):
|
||||
continue
|
||||
|
||||
template = move.equipment.product.template
|
||||
if move.product_equipment and move.equipment and move.equipment.product.template.maintenance_required:
|
||||
maintenance = Maintenance(
|
||||
service_maintenance=maintenanceService.id,
|
||||
maintenance_type='initial',
|
||||
propietary=shipment.customer.id,
|
||||
equipment_calibrate=(
|
||||
True if move.equipment.product.calibration else False
|
||||
),
|
||||
equipment_calibrate=True if move.equipment.product.calibration else False,
|
||||
propietary_address=shipment.delivery_address.id,
|
||||
equipment=move.equipment.id,
|
||||
initial_operation=move.equipment.product.initial_operation,
|
||||
check_equipment=template.check_equipment,
|
||||
check_electric_system=template.check_electric_system,
|
||||
clean_int_ext=template.clean_int_ext,
|
||||
clean_eyes=template.clean_eyes,
|
||||
check_calibration=template.check_calibration,
|
||||
check_equipment=move.equipment.product.template.check_equipment,
|
||||
check_electric_system=move.equipment.product.template.check_electric_system,
|
||||
clean_int_ext=move.equipment.product.template.clean_int_ext,
|
||||
clean_eyes=move.equipment.product.template.clean_eyes,
|
||||
check_calibration=move.equipment.product.template.check_calibration,
|
||||
temperature_min=maintenanceService.temperature_min,
|
||||
temperature_max=maintenanceService.temperature_max,
|
||||
temperature_uom=maintenanceService.temperature_uom.id,
|
||||
moisture_min=maintenanceService.moisture_min,
|
||||
moisture_max=maintenanceService.moisture_max,
|
||||
moisture_uom=maintenanceService.moisture_uom.id,
|
||||
)
|
||||
moisture_uom=maintenanceService.moisture_uom.id)
|
||||
maintenance.save()
|
||||
|
||||
shipment.service_maintenance_initial = True
|
||||
shipment.save()
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
@Workflow.transition('picked')
|
||||
@set_employee('picked_by')
|
||||
def pick(cls, shipments):
|
||||
super(ShipmentOut, cls).pick(shipments)
|
||||
for shipment in shipments:
|
||||
for line in shipment.inventory_moves:
|
||||
if line.product.equipment and not line.equipment:
|
||||
raise ValidationError(
|
||||
gettext("optical_equipment.line_without_serial"))
|
||||
else:
|
||||
raise UserError(
|
||||
str('Por favor Primero debe Asignar un serial a todos los Equipos.'))
|
||||
|
||||
|
||||
class ShipmentInternal(metaclass=PoolMeta):
|
||||
@@ -319,21 +252,15 @@ class ShipmentInternal(metaclass=PoolMeta):
|
||||
move.equipment.save()
|
||||
|
||||
Move.do([m for s in shipments for m in s.incoming_moves])
|
||||
cls.write(
|
||||
[s for s in shipments if not s.effective_date],
|
||||
{
|
||||
'effective_date': Date.today(),
|
||||
},
|
||||
)
|
||||
cls.write([s for s in shipments if not s.effective_date], {
|
||||
'effective_date': Date.today(), })
|
||||
|
||||
|
||||
class ShipmentOutReturn(metaclass=PoolMeta):
|
||||
'Customer Shipment Return'
|
||||
"Customer Shipment Return"
|
||||
__name__ = 'stock.shipment.out.return'
|
||||
|
||||
service_maintenance_initial = fields.Boolean(
|
||||
'Maintenance Initial', states={'readonly': True}
|
||||
)
|
||||
service_maintenance_initial = fields.Boolean('Maintenance Initial', states={'readonly': True})
|
||||
sale_type = fields.Char('Type sale origin')
|
||||
|
||||
@classmethod
|
||||
@@ -343,26 +270,25 @@ class ShipmentOutReturn(metaclass=PoolMeta):
|
||||
def receive(cls, shipments):
|
||||
Move = Pool().get('stock.move')
|
||||
Equipments = Pool().get('optical_equipment.equipment')
|
||||
Locations = Pool().get('stock.location')
|
||||
Move.do([m for s in shipments for m in s.incoming_moves])
|
||||
for s in shipments:
|
||||
for m in s.incoming_moves:
|
||||
if not m.equipment:
|
||||
continue
|
||||
|
||||
if m.equipment:
|
||||
equipment = m.equipment
|
||||
Id = equipment.id
|
||||
equipment = Equipments.search(['id', '=', Id])[0]
|
||||
equipment.propietary = s.company.party.id
|
||||
equipment.propietary_address = s.company.party.addresses[0].id
|
||||
equipment.location = m.to_location.id
|
||||
equipment.state = 'registred'
|
||||
equipment.state = "registred"
|
||||
equipment.save()
|
||||
|
||||
cls.create_inventory_moves(shipments)
|
||||
# Set received state to allow done transition
|
||||
cls.write(shipments, {'state': 'received'})
|
||||
to_do = [
|
||||
s for s in shipments if s.warehouse_storage == s.warehouse_input]
|
||||
to_do = [s for s in shipments
|
||||
if s.warehouse_storage == s.warehouse_input]
|
||||
|
||||
if to_do:
|
||||
cls.done(to_do)
|
||||
|
||||
2
move.xml
2
move.xml
@@ -2,7 +2,6 @@
|
||||
<!--This file file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="move_view_list_shipment">
|
||||
<field name="model">stock.move</field>
|
||||
<field name="inherit" ref="stock.move_view_list_shipment"/>
|
||||
@@ -40,5 +39,4 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="model">stock.shipment.out,-1</field>
|
||||
<field name="action" ref="report_capacitation"/>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
||||
23
party.py
23
party.py
@@ -2,27 +2,24 @@
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.pool import PoolMeta
|
||||
from trytond.model import fields
|
||||
from trytond.pyson import Eval
|
||||
from trytond.model import ModelSQL, ModelView, fields
|
||||
from trytond.pyson import Eval, If
|
||||
|
||||
#from . import equipment
|
||||
|
||||
_CUSTOMER_TYPE = [("ips", "IPS"), ("optica", "Optica"), ("otro", "Otro")]
|
||||
|
||||
_CUSTOMER_TYPE = [('ips', 'IPS'),
|
||||
('optica', 'Optica'),
|
||||
('otro', 'Otro')]
|
||||
|
||||
class Party(metaclass=PoolMeta):
|
||||
__name__ = "party.party"
|
||||
__name__ = 'party.party'
|
||||
|
||||
customer_type = fields.Selection(_CUSTOMER_TYPE, "Customer Type")
|
||||
|
||||
@classmethod
|
||||
def default_customer_type(csl):
|
||||
return "otro"
|
||||
|
||||
|
||||
class Address(metaclass=PoolMeta):
|
||||
__name__ = "party.address"
|
||||
__name__ = 'party.address'
|
||||
|
||||
campus = fields.Boolean("Campus")
|
||||
party_related = fields.Many2One(
|
||||
"party.party", "Party Related", states={"invisible": (~Eval("campus"))}
|
||||
)
|
||||
party_related = fields.Many2One('party.party', "Party Related",
|
||||
states ={ 'invisible': (~Eval("campus"))})
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="party_view_tree">
|
||||
<field name="model">party.party</field>
|
||||
<field name="inherit" ref="party.party_view_tree"/>
|
||||
@@ -24,5 +23,4 @@
|
||||
<field name="inherit" ref="party.address_view_form"/>
|
||||
<field name="name">address_form</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
||||
467
product.py
467
product.py
@@ -1,260 +1,182 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.model import ModelView, ModelSQL, fields
|
||||
from trytond.model import (
|
||||
ModelView, ModelSQL, fields, Exclude)
|
||||
from trytond.pyson import Bool, If, Eval, Id
|
||||
|
||||
|
||||
_RISK = [
|
||||
("n/a", "No aplíca"),
|
||||
("uno", "I"),
|
||||
("dosA", "IIA"),
|
||||
("dosB", "IIB")]
|
||||
_RISK = [('n/a', "No aplíca"),
|
||||
('uno', 'I'),
|
||||
('dosA', 'IIA'),
|
||||
('dosB', 'IIB')]
|
||||
|
||||
_USE = [
|
||||
("", ""),
|
||||
("medico", "Médico"),
|
||||
("basico", "Basico"),
|
||||
("apoyo", "Apoyo")]
|
||||
_USE = [('', ""),
|
||||
('medico', 'Médico'),
|
||||
('basico', 'Basico'),
|
||||
('apoyo', 'Apoyo')]
|
||||
|
||||
_BIOMEDICAL_CLASS = [
|
||||
("n/a", "No aplíca"),
|
||||
("diagnostico", "Diagnóstico"),
|
||||
("rehabilitación", "Rehabilitación"),
|
||||
]
|
||||
('n/a', "No aplíca"),
|
||||
('diagnostico', 'Diagnóstico'),
|
||||
('rehabilitación', 'Rehabilitación')]
|
||||
|
||||
_MAIN_TECNOLOGY = [
|
||||
("", ""),
|
||||
("mecanico", "Mecánico"),
|
||||
("electrico", "Electrico"),
|
||||
("electronico", "Electrónico"),
|
||||
("hidraulico", "Hidraulico"),
|
||||
("neumatico", "Neumatico"),
|
||||
]
|
||||
('', ""),
|
||||
('mecanico', 'Mecánico'),
|
||||
('electrico', 'Electrico'),
|
||||
('electronico', 'Electrónico'),
|
||||
('hidraulico', 'Hidraulico'),
|
||||
('neumatico', 'Neumatico')]
|
||||
|
||||
_EQUIPMENT_TYPE = [
|
||||
("", ""),
|
||||
("mobiliario_optico", "Mobiliario óptico"),
|
||||
("refraccion", "Refracción"),
|
||||
("medico", "Medicion"),
|
||||
("accesorios", "Accesorios"),
|
||||
]
|
||||
('', ""),
|
||||
('mobiliario_optico', 'Mobiliario óptico'),
|
||||
('refraccion', 'Refracción'),
|
||||
('medico', 'Medicion'),
|
||||
('accesorios', 'Accesorios')]
|
||||
|
||||
NON_MEASURABLE = ["service"]
|
||||
NON_MEASURABLE = ['service']
|
||||
|
||||
|
||||
class Template(metaclass=PoolMeta):
|
||||
"Template"
|
||||
__name__ = "product.template"
|
||||
'Template'
|
||||
__name__ = 'product.template'
|
||||
|
||||
product = fields.Many2One(
|
||||
"optical_equipment.maintenance",
|
||||
"Maintenance Activity",
|
||||
ondelete="CASCADE",
|
||||
)
|
||||
equipment = fields.Boolean(
|
||||
"It is equipment",
|
||||
states={
|
||||
"invisible": Eval("type", "goods") != "goods",
|
||||
},
|
||||
)
|
||||
maintenance_activity = fields.Boolean(
|
||||
"Maintenance Activity",
|
||||
states={
|
||||
"invisible": Eval("type", "service") != "service",
|
||||
"readonly": If(Eval("equipment", True), True)
|
||||
| If(Eval("replacement", True), True),
|
||||
},
|
||||
)
|
||||
replacement = fields.Boolean(
|
||||
"Replacement",
|
||||
states={
|
||||
"invisible": Eval("type", "goods") != "goods",
|
||||
"readonly": If(Eval("equipment", True), True)
|
||||
| If(Eval("maintenance_activity", True), True),
|
||||
},
|
||||
)
|
||||
product = fields.Many2One('optical_equipment.maintenance', "Maintenance Activity",
|
||||
ondelete='CASCADE',)
|
||||
equipment = fields.Boolean('It is equipment',
|
||||
states={'invisible': Eval('type', 'goods') != 'goods',
|
||||
})
|
||||
maintenance_activity = fields.Boolean('Maintenance Activity',
|
||||
states={'invisible': Eval('type', 'service') != 'service',
|
||||
'readonly': If(Eval('equipment', True), True)
|
||||
| If(Eval('replacement', True), True)
|
||||
})
|
||||
replacement = fields.Boolean('Replacement',
|
||||
states={'invisible': Eval('type', 'goods') != 'goods',
|
||||
'readonly': If(Eval('equipment', True), True)
|
||||
| If(Eval('maintenance_activity', True), True)
|
||||
})
|
||||
|
||||
maintenance_required = fields.Boolean(
|
||||
"Miantenance Required",
|
||||
states={
|
||||
"invisible": (Eval("type", "goods") != "goods")}
|
||||
)
|
||||
equipment_type = fields.Selection(
|
||||
_EQUIPMENT_TYPE, "Equipment type",
|
||||
states={"required": Eval("equipment", False)}
|
||||
)
|
||||
risk = fields.Selection(_RISK, "Type risk")
|
||||
use = fields.Selection(
|
||||
_USE,
|
||||
"Use",
|
||||
states={"required": Eval("equipment", False)},
|
||||
depends={"equipment"},
|
||||
)
|
||||
biomedical_class = fields.Selection(
|
||||
_BIOMEDICAL_CLASS,
|
||||
"Biomedical Class",
|
||||
states={"required": Eval("equipment", False)},
|
||||
)
|
||||
main_tecnology = fields.Selection(
|
||||
_MAIN_TECNOLOGY, "Main tecnology",
|
||||
states={"required": Eval("equipment", False)})
|
||||
maintenance_required = fields.Boolean('Miantenance Required',
|
||||
states={'invisible': (Eval('type', 'goods') != 'goods')})
|
||||
equipment_type = fields.Selection(_EQUIPMENT_TYPE, 'Equipment type',
|
||||
states={'required': Eval('equipment', False)})
|
||||
risk = fields.Selection(_RISK, 'Type risk')
|
||||
use = fields.Selection(_USE, 'Use',
|
||||
states={'required': Eval('equipment', False)},
|
||||
depends={'equipment'})
|
||||
biomedical_class = fields.Selection(_BIOMEDICAL_CLASS, 'Biomedical Class',
|
||||
states={'required': Eval('equipment', False)})
|
||||
main_tecnology = fields.Selection(_MAIN_TECNOLOGY, 'Main tecnology',
|
||||
states={'required': Eval('equipment', False)})
|
||||
calibration = fields.Boolean("Apply calibration")
|
||||
observation = fields.Text("Observation")
|
||||
observation = fields.Text('Observation')
|
||||
|
||||
# Mark, Category, Reference
|
||||
mark_category = fields.Many2One(
|
||||
"product.category",
|
||||
"Mark",
|
||||
domain=[("parent", "=", None), ("accounting", "=", False)],
|
||||
states={"required": Eval("equipment", False)},
|
||||
)
|
||||
model_category = fields.Many2One(
|
||||
"product.category",
|
||||
"Model",
|
||||
domain=[
|
||||
("parent", "=", Eval("mark_category")),
|
||||
("accounting", "=", False)],
|
||||
states={"required": Eval("equipment", False)})
|
||||
reference_category = fields.Many2One(
|
||||
"product.category",
|
||||
"Reference",
|
||||
states={
|
||||
"required": (Eval("equipment", True))
|
||||
},
|
||||
domain=[("parent", "=", Eval("model_category"))])
|
||||
mark_category = fields.Many2One('product.category', 'Mark',
|
||||
domain=[('parent', '=', None),
|
||||
('accounting', '=', False)],
|
||||
states={'required': Eval('equipment', False)})
|
||||
model_category = fields.Many2One('product.category', "Model",
|
||||
domain=[('parent', '=', Eval('mark_category')),
|
||||
('accounting', '=', False)],
|
||||
states={'required': Eval('equipment', False)})
|
||||
reference_category = fields.Many2One('product.category', "Reference",
|
||||
domain=[('parent', '=', Eval('model_category'))],)
|
||||
|
||||
# Information Equipment
|
||||
origin_country = fields.Many2One("country.country", "Origin Country")
|
||||
refurbish = fields.Boolean("Refurbish")
|
||||
# Iformation Equipment
|
||||
origin_country = fields.Many2One('country.country', "Origin Country")
|
||||
refurbish = fields.Boolean('Refurbish')
|
||||
software_required = fields.Boolean("Software Required")
|
||||
software_version = fields.Char(
|
||||
"Software version",
|
||||
states={"invisible": ~Eval("software_required", True)},
|
||||
depends={"software_required"},
|
||||
)
|
||||
software_version = fields.Char("Software version",
|
||||
states={'invisible': If(~Eval('software_required'), True)},
|
||||
depends={'software_required'})
|
||||
|
||||
# These are measurements required for the equipments, are in this place
|
||||
# for manage of class 'product.template'
|
||||
|
||||
temperature_min = fields.Float("Temp Min")
|
||||
temperature_max = fields.Float("Temp Max")
|
||||
temperature_uom = fields.Many2One(
|
||||
"product.uom",
|
||||
"Temperature UOM",
|
||||
temperature_uom = fields.Many2One('product.uom', 'Temperature UOM',
|
||||
domain=[
|
||||
("category", "=", Id("optical_equipment", "uom_cat_temperature"))],
|
||||
states={'invisible': (~Eval('temperature_min', True))}
|
||||
)
|
||||
('category', '=', Id(
|
||||
'optical_equipment', "uom_cat_temperature"))],
|
||||
states={'invisible': If(Eval('temperature_min') is None, True)})
|
||||
frequency = fields.Float("Frequency")
|
||||
frequency_uom = fields.Many2One(
|
||||
"product.uom",
|
||||
"Frequency UOM",
|
||||
frequency_uom = fields.Many2One('product.uom', "Frequency UOM",
|
||||
domain=[
|
||||
("category", "=", Id("optical_equipment", "uom_cat_frequency"))],
|
||||
states={'invisible': (Eval('frequency', True))})
|
||||
('category', '=', Id(
|
||||
'optical_equipment', 'uom_cat_frequency'))],
|
||||
states={'invisible': If(Eval('frequency') is None, True)}
|
||||
)
|
||||
moisture_min = fields.Float("Moisture Min")
|
||||
moisture_max = fields.Float("Moisture Max")
|
||||
moisture_uom = fields.Many2One(
|
||||
"product.uom",
|
||||
"Moisture UOM",
|
||||
moisture_uom = fields.Many2One('product.uom', "Moisture UOM",
|
||||
domain=[
|
||||
("category", "=", Id(
|
||||
"optical_equipment", "uom_cat_relative_humedity"))
|
||||
],
|
||||
states={'invisible': (~Eval('moisture_min', True))})
|
||||
('category', '=', Id(
|
||||
'optical_equipment', 'uom_cat_relative_humedity'))],
|
||||
states={'invisible': If(Eval('moisture_min') is None, True)},
|
||||
)
|
||||
electrical_equipment = fields.Boolean("Electrical Equipment")
|
||||
frequency = fields.Float(
|
||||
"Frequency", states={"invisible": ~Bool(Eval("electrical_equipment"))}
|
||||
)
|
||||
frequency_uom = fields.Many2One(
|
||||
"product.uom",
|
||||
"Frequency UOM",
|
||||
frequency = fields.Float("Frequency",
|
||||
states={'invisible': ~Bool(Eval('electrical_equipment'))})
|
||||
frequency_uom = fields.Many2One('product.uom', "Frequency UOM",
|
||||
domain=[
|
||||
("category", "=", Id("optical_equipment", "uom_cat_frequency"))],
|
||||
states={'invisible': (~Eval('frequency', True))
|
||||
| ~Eval('electrical_equipment', True)},)
|
||||
voltageAC = fields.Float(
|
||||
"Voltage AC", states={"invisible": ~Bool(Eval("electrical_equipment"))}
|
||||
('category', '=', Id(
|
||||
'optical_equipment', 'uom_cat_frequency'))],
|
||||
states={'invisible': If(Eval('frequency') is None, True) |
|
||||
~Eval('electrical_equipment', True)},
|
||||
)
|
||||
voltageAC_uom = fields.Many2One(
|
||||
"product.uom",
|
||||
"Voltage AC UOM",
|
||||
voltageAC = fields.Float("Voltage AC",
|
||||
states={'invisible': ~Bool(Eval('electrical_equipment'))})
|
||||
voltageAC_uom = fields.Many2One('product.uom', "Voltage AC UOM",
|
||||
domain=[
|
||||
("category", "=", Id(
|
||||
"optical_equipment", "uom_cat_electrical_tension"))
|
||||
],
|
||||
states={'invisible': (~Eval('voltageAC', True))
|
||||
| ~Eval('electrical_equipment', True)},
|
||||
('category', '=', Id(
|
||||
'optical_equipment', 'uom_cat_electrical_tension'))],
|
||||
states={'invisible': If(Eval('voltageAC') is None, True) |
|
||||
~Eval('electrical_equipment', True)},
|
||||
)
|
||||
voltageDC = fields.Float(
|
||||
"Voltage DC", states={"invisible": ~Bool(Eval("electrical_equipment"))}
|
||||
)
|
||||
voltageDC_uom = fields.Many2One(
|
||||
"product.uom",
|
||||
"Voltage DC UOM",
|
||||
voltageDC = fields.Float("Voltage DC",
|
||||
states={'invisible': ~Bool(Eval('electrical_equipment'))})
|
||||
voltageDC_uom = fields.Many2One('product.uom', "Voltage DC UOM",
|
||||
domain=[
|
||||
("category", "=", Id(
|
||||
"optical_equipment", "uom_cat_electrical_tension"))],
|
||||
states={'invisible': (
|
||||
~Eval('voltageDC', True) | ~Eval(
|
||||
'electrical_equipment', True))},)
|
||||
('category', '=', Id(
|
||||
'optical_equipment', 'uom_cat_electrical_tension'))],
|
||||
states={'invisible': If(Eval('voltageDC') is None, True) |
|
||||
~Eval('electrical_equipment', True)},)
|
||||
|
||||
useful_life = fields.Integer("Useful life")
|
||||
warranty = fields.Integer("Warranty")
|
||||
|
||||
# calibration parameters
|
||||
use_pattern = fields.Many2One(
|
||||
"optical_equipment.use_pattern",
|
||||
"Use Pattern",
|
||||
ondelete="RESTRICT",
|
||||
states={"required": Eval("calibration", True)},)
|
||||
measuring_range = fields.Selection(
|
||||
[("dioptria", "Dioptria"),
|
||||
("mmhg", "mmHg")], "Rango de Medición")
|
||||
MEP = fields.Float(
|
||||
"MEP",
|
||||
states={"required": Eval("calibration", False)},)
|
||||
uncertainy_pattern = fields.Float(
|
||||
"Uncertainy Pattern",
|
||||
states={"required": Eval("calibration", True)},
|
||||
help="Agregar valores separados por ',' Ej:-5,+5,-10,+10",)
|
||||
k_pattern = fields.Char(
|
||||
"K Pattern",
|
||||
states={"required": Eval("calibration", False)},
|
||||
help="Agregar valores separados por ',' Ej:-5,+5,-10,+10",
|
||||
)
|
||||
k_pattern_list = fields.One2Many(
|
||||
"optical_equipment.product_pattern",
|
||||
"product",
|
||||
"List of patterns K",
|
||||
states={"required": Eval("calibration", False)},
|
||||
)
|
||||
resolution_type = fields.Selection(
|
||||
[("", ""), ("analoga", "Analoga"), ("digital", "Digital")],
|
||||
"Resolution Type",
|
||||
states={"required": Eval("calibration", False)},
|
||||
)
|
||||
|
||||
d_resolution = fields.Float(
|
||||
"Resolution d",
|
||||
states={
|
||||
'invisible': (Eval('resolution_type') != 'digital'),
|
||||
'required': (Eval('resolution_type') == 'digital')
|
||||
})
|
||||
analog_resolution = fields.Float(
|
||||
"Analog resolution",
|
||||
states={'invisible': (Eval('resolution_type') != 'analoga'), },
|
||||
)
|
||||
a_factor_resolution = fields.Float(
|
||||
"(a) Resolution",
|
||||
states={'invisible': (Eval('resolution_type') != 'analoga')},
|
||||
)
|
||||
Usubi = fields.Integer("Usub i", states={
|
||||
"required": Eval("calibration", False)})
|
||||
use_pattern = fields.Many2One('optical_equipment.use_pattern', "Use Pattern", ondelete='RESTRICT',
|
||||
states={'required': Eval('calibration', True)})
|
||||
measuring_range = fields.Selection([
|
||||
('dioptria', "Dioptria"),
|
||||
('mmhg', "mmHg")], "Rango de Medición")
|
||||
MEP = fields.Float("MEP", states={'required': Eval('calibration', False)},)
|
||||
uncertainy_pattern = fields.Float("Uncertainy Pattern", states={'required': Eval('calibration', True)},
|
||||
help="Agregar valores separados por ',' Ej:-5,+5,-10,+10")
|
||||
k_pattern = fields.Char("K Pattern", states={'required': Eval('calibration', False)},
|
||||
help="Agregar valores separados por ',' Ej:-5,+5,-10,+10")
|
||||
k_pattern_list = fields.One2Many('optical_equipment.product_pattern', 'product', "List of patterns K",
|
||||
states={'required': Eval('calibration', False)},)
|
||||
resolution_type = fields.Selection([('', ""),
|
||||
('analoga', "Analoga"),
|
||||
('digital', "Digital")], "Resolution Type",
|
||||
states={'required': Eval('calibration', False)},)
|
||||
d_resolution = fields.Float("Resolution d",
|
||||
states={'invisible': If(Eval('resolution_type') != 'digital', True)},)
|
||||
analog_resolution = fields.Float("Analog resolution",
|
||||
states={'invisible': If(Eval('resolution_type') != 'analoga', True), },)
|
||||
a_factor_resolution = fields.Float("(a) Resolution",
|
||||
states={'invisible': If(Eval('resolution_type') != 'analoga', True)},)
|
||||
Usubi = fields.Integer("Usub i", states={'required': Eval('calibration', False)},)
|
||||
|
||||
# maintenance activities
|
||||
initial_operation = fields.Boolean(
|
||||
"Verificación inicial de funcionamiento")
|
||||
initial_operation = fields.Boolean("Verificación inicial de funcionamiento")
|
||||
check_equipment = fields.Boolean("Revisión del Equipo")
|
||||
check_electric_system = fields.Boolean("Revisión del sistema electríco")
|
||||
clean_int_ext = fields.Boolean("Limpieza interior y exterior")
|
||||
@@ -268,37 +190,27 @@ class Template(metaclass=PoolMeta):
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(Template, cls).view_attributes() + [
|
||||
(
|
||||
"//page[@id='features']",
|
||||
"states",
|
||||
{
|
||||
"invisible": ~Eval("equipment"),
|
||||
},
|
||||
),
|
||||
(
|
||||
"//page[@id='calibration']",
|
||||
"states",
|
||||
{"invisible": ~Eval("calibration")},
|
||||
),
|
||||
(
|
||||
"//page[@id='maintenance_activities']",
|
||||
"states",
|
||||
{"invisible": ~Eval("maintenance_required")},
|
||||
),
|
||||
('//page[@id="features"]', 'states', {
|
||||
'invisible': ~Eval('equipment'), }),
|
||||
('//page[@id="calibration"]', 'states', {
|
||||
'invisible': ~Eval('calibration')},),
|
||||
('//page[@id="maintenance_activities"]', 'states', {
|
||||
'invisible': ~Eval('maintenance_required')},)
|
||||
|
||||
]
|
||||
|
||||
@classmethod
|
||||
@fields.depends("measuring_range")
|
||||
@fields.depends('measuring_range')
|
||||
def default_measuring_range(self):
|
||||
return "dioptria"
|
||||
return 'dioptria'
|
||||
|
||||
@classmethod
|
||||
@fields.depends("temperature_min")
|
||||
@fields.depends('temperature_min')
|
||||
def default_temperature_min(self):
|
||||
return 0
|
||||
|
||||
@classmethod
|
||||
@fields.depends("temperature_max")
|
||||
@fields.depends('temperature_max')
|
||||
def default_temperature_max(self):
|
||||
return 0
|
||||
|
||||
@@ -323,13 +235,13 @@ class Template(metaclass=PoolMeta):
|
||||
return 0
|
||||
|
||||
def default_risk():
|
||||
return "n/a"
|
||||
return 'n/a'
|
||||
|
||||
def default_use():
|
||||
return None
|
||||
|
||||
def default_biomedical_class():
|
||||
return "n/a"
|
||||
return 'n/a'
|
||||
|
||||
def default_main_tecnology():
|
||||
return None
|
||||
@@ -340,66 +252,68 @@ class Template(metaclass=PoolMeta):
|
||||
def default_refurbish():
|
||||
return False
|
||||
|
||||
def default_refurbish():
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
@fields.depends("temperature")
|
||||
@fields.depends('temperature')
|
||||
def default_temperature_uom(self):
|
||||
pool = Pool()
|
||||
Measurements = pool.get("product.uom")
|
||||
measurement = Measurements.search(["name", "=", "Celsius"])[0].id
|
||||
Measurements = pool.get('product.uom')
|
||||
measurement = Measurements.search(['name', '=', 'Celsius'])[0].id
|
||||
|
||||
return measurement
|
||||
|
||||
@classmethod
|
||||
def default_frequency_uom(cls):
|
||||
pool = Pool()
|
||||
Measurements = pool.get("product.uom")
|
||||
measurement = Measurements.search(["name", "=", "Hertz"])[0].id
|
||||
Measurements = pool.get('product.uom')
|
||||
measurement = Measurements.search(['name', '=', 'Hertz'])[0].id
|
||||
|
||||
return measurement
|
||||
|
||||
@classmethod
|
||||
def default_moisture_uom(cls):
|
||||
pool = Pool()
|
||||
Measurements = pool.get("product.uom")
|
||||
measurement = Measurements.search(
|
||||
["name", "=", "Relative Humedity"])[0].id
|
||||
Measurements = pool.get('product.uom')
|
||||
measurement = Measurements.search(['name', '=', 'Relative Humedity'])[0].id
|
||||
|
||||
return measurement
|
||||
|
||||
@classmethod
|
||||
def default_voltageAC_uom(cls):
|
||||
pool = Pool()
|
||||
Measurements = pool.get("product.uom")
|
||||
measurement = Measurements.search(["name", "=", "Volt"])[0].id
|
||||
Measurements = pool.get('product.uom')
|
||||
measurement = Measurements.search(['name', '=', 'Volt'])[0].id
|
||||
|
||||
return measurement
|
||||
|
||||
@classmethod
|
||||
def default_voltageDC_uom(cls):
|
||||
pool = Pool()
|
||||
Measurements = pool.get("product.uom")
|
||||
measurement = Measurements.search(["name", "=", "Volt"])[0].id
|
||||
Measurements = pool.get('product.uom')
|
||||
measurement = Measurements.search(['name', '=', 'Volt'])[0].id
|
||||
|
||||
return measurement
|
||||
|
||||
@fields.depends("voltageDC", "voltageDC_uom")
|
||||
@fields.depends('voltageDC', 'voltageDC_uom')
|
||||
def on_change_voltageDC_uom(self):
|
||||
pool = Pool()
|
||||
Measurements = pool.get("product.uom")
|
||||
measurement = Measurements.search(["name", "=", "Volt"])[0].id
|
||||
Measurements = pool.get('product.uom')
|
||||
measurement = Measurements.search(['name', '=', 'Volt'])[0].id
|
||||
self.voltageDC_uom = measurement
|
||||
|
||||
# @fields.depends('software_required', 'software_version')
|
||||
# def on_change_with_sotfware_required(self):
|
||||
# self.software_version = None
|
||||
@fields.depends('software_required', 'software_version')
|
||||
def on_change_with_sotfware_required(self):
|
||||
self.software_version = None
|
||||
|
||||
@fields.depends("d_resolution", "analog_resolution", "a_factor_resolution")
|
||||
@fields.depends('d_resolution', 'analog_resolution', 'a_factor_resolution')
|
||||
def on_change_resolution_type(self):
|
||||
self.d_resolution = None
|
||||
self.analog_resolution = None
|
||||
self.a_factor_resolution = None
|
||||
|
||||
@fields.depends("equipment", "replacement")
|
||||
@fields.depends('equipment', 'replacement')
|
||||
def on_change_equipment(self):
|
||||
if self.equipment:
|
||||
self.replacement = False
|
||||
@@ -409,24 +323,24 @@ class Template(metaclass=PoolMeta):
|
||||
self.model_category = None
|
||||
self.reference_category = None
|
||||
self.equipment_type = None
|
||||
self.risk = "n/a"
|
||||
self.biomedical_class = "n/a"
|
||||
self.use = ""
|
||||
self.risk = 'n/a'
|
||||
self.biomedical_class = 'n/a'
|
||||
self.use = ''
|
||||
self.useful_life = 0
|
||||
self.warranty = 0
|
||||
|
||||
@fields.depends("mark_category", "model_category", "reference_category")
|
||||
@fields.depends('mark_category', 'model_category', 'reference_category')
|
||||
def on_change_mark_category(self):
|
||||
if not self.mark_category:
|
||||
self.model_category = None
|
||||
self.reference_category = None
|
||||
|
||||
@fields.depends("model_category", "reference_category")
|
||||
@fields.depends('model_category', 'reference_category')
|
||||
def on_change_model_category(self):
|
||||
if not self.model_category:
|
||||
self.reference_category = None
|
||||
|
||||
@fields.depends("electrical_equipment")
|
||||
@fields.depends('electrical_equipment')
|
||||
def on_change_electrical_equipment(self):
|
||||
if self.electrical_equipment:
|
||||
self.voltageAC = 0
|
||||
@@ -439,13 +353,13 @@ class Template(metaclass=PoolMeta):
|
||||
default = {}
|
||||
else:
|
||||
default = default.copy()
|
||||
default.setdefault("code", None)
|
||||
default.setdefault("images", None)
|
||||
default.setdefault('code', None)
|
||||
default.setdefault('images', None)
|
||||
return super().copy(templates, default=default)
|
||||
|
||||
|
||||
class Product(metaclass=PoolMeta):
|
||||
__name__ = "product.product"
|
||||
__name__ = 'product.product'
|
||||
|
||||
@classmethod
|
||||
def copy(cls, products, default=None):
|
||||
@@ -454,15 +368,15 @@ class Product(metaclass=PoolMeta):
|
||||
else:
|
||||
default = default.copy()
|
||||
|
||||
default.setdefault("suffix_code", None)
|
||||
default.setdefault("code", None)
|
||||
default.setdefault("poduct", None)
|
||||
default.setdefault("images", None)
|
||||
default.setdefault('suffix_code', None)
|
||||
default.setdefault('code', None)
|
||||
default.setdefault('poduct', None)
|
||||
default.setdefault('images', None)
|
||||
return super().copy(products, default=default)
|
||||
|
||||
|
||||
class Image(metaclass=PoolMeta):
|
||||
__name__ = "product.image"
|
||||
__name__ = 'product.image'
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
@@ -474,30 +388,29 @@ class Image(metaclass=PoolMeta):
|
||||
default = {}
|
||||
else:
|
||||
default = default.copy()
|
||||
default.setdefault("template", None)
|
||||
default.setdefault("product", None)
|
||||
default.setdefault('template', None)
|
||||
default.setdefault('product', None)
|
||||
return super().copy(images, default=default)
|
||||
|
||||
|
||||
class UsePattern(ModelSQL, ModelView):
|
||||
"Use Pattern"
|
||||
__name__ = "optical_equipment.use_pattern"
|
||||
_rec_name = "name_pattern"
|
||||
__name__ = 'optical_equipment.use_pattern'
|
||||
_rec_name = 'name_pattern'
|
||||
|
||||
name_pattern = fields.Char("Name Pattern", required=True)
|
||||
name_pattern = fields.Char('Name Pattern', required=True)
|
||||
|
||||
|
||||
class Pattern(ModelSQL, ModelView):
|
||||
"Pattern K of equipment"
|
||||
__name__ = "optical_equipment.product_pattern"
|
||||
_rec_name = "rec_name"
|
||||
__name__ = 'optical_equipment.product_pattern'
|
||||
_rec_name = 'rec_name'
|
||||
|
||||
product = fields.Many2One(
|
||||
"product.template", "Template", ondelete="CASCADE")
|
||||
product = fields.Many2One('product.template', "Template", ondelete='CASCADE')
|
||||
pattern = fields.Float("Value Pattern")
|
||||
rec_name = fields.Function(fields.Char("rec_name"), "get_rec_name")
|
||||
rec_name = fields.Function(fields.Char('rec_name'), 'get_rec_name')
|
||||
|
||||
@fields.depends("pattern")
|
||||
@fields.depends('pattern')
|
||||
def get_rec_name(self, name):
|
||||
if self.pattern:
|
||||
return str(self.pattern)
|
||||
|
||||
10
product.xml
10
product.xml
@@ -45,11 +45,11 @@
|
||||
<field name="inherit" ref="product.template_view_form"/>
|
||||
<field name="name">template_form</field>
|
||||
</record>
|
||||
<!-- <record model="ir.ui.view" id="template_view_tree1"> -->
|
||||
<!-- <field name="model">product.template</field> -->
|
||||
<!-- <field name="inherit" ref="product.template_view_tree"/> -->
|
||||
<!-- <field name="name">template_tree</field> -->
|
||||
<!-- </record> -->
|
||||
<record model="ir.ui.view" id="template_view_tree1">
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit" ref="product.template_view_tree"/>
|
||||
<field name="name">template_tree</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="pattern_view_form">
|
||||
<field name="model">optical_equipment.product_pattern</field>
|
||||
<field name="type">form</field>
|
||||
|
||||
148
purchase.py
148
purchase.py
@@ -1,16 +1,18 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# txhis repository contains the full copyright notices and license terms
|
||||
#This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
#txhis repository contains the full copyright notices and license terms
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.model import ModelView, fields
|
||||
from trytond.modules.product import round_price
|
||||
from trytond.model import (
|
||||
ModelView, ModelSQL, Workflow, fields)
|
||||
from trytond.modules.product import price_digits, round_price
|
||||
from trytond.pyson import Eval, If, Bool
|
||||
from trytond.exceptions import UserError
|
||||
from trytond.i18n import gettext
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
|
||||
class Purchase(metaclass=PoolMeta):
|
||||
"Purchase Equipment"
|
||||
__name__ = "purchase.purchase"
|
||||
__name__ = 'purchase.purchase'
|
||||
|
||||
equipment_create = fields.Boolean("Equipments Creates", readonly=True)
|
||||
|
||||
@@ -18,11 +20,10 @@ class Purchase(metaclass=PoolMeta):
|
||||
def __setup__(cls):
|
||||
super(Purchase, cls).__setup__()
|
||||
cls._buttons.update({
|
||||
"create_equipments": {
|
||||
"invisible": If(Eval("invoice_state") == "none", True)
|
||||
| If(Bool(Eval("equipment_create")), True),
|
||||
"depends": ["invoice_state"]}
|
||||
})
|
||||
'create_equipments': {
|
||||
'invisible': If(Eval('invoice_state') == 'none', True) |
|
||||
If(Bool(Eval('equipment_create')), True),
|
||||
'depends': ['invoice_state'],}})
|
||||
|
||||
@classmethod
|
||||
def copy(cls, purchases, default=None):
|
||||
@@ -31,15 +32,15 @@ class Purchase(metaclass=PoolMeta):
|
||||
else:
|
||||
default = default.copy()
|
||||
|
||||
default.setdefault("number", None)
|
||||
default.setdefault("invoice_state", "none")
|
||||
default.setdefault("invoices_ignored", None)
|
||||
default.setdefault("moves", None)
|
||||
default.setdefault("shipment_state", "none")
|
||||
default.setdefault("purchase_date", None)
|
||||
default.setdefault("quoted_by")
|
||||
default.setdefault("confirmed_by")
|
||||
default.setdefault("equipment_create", None)
|
||||
default.setdefault('number', None)
|
||||
default.setdefault('invoice_state', 'none')
|
||||
default.setdefault('invoices_ignored', None)
|
||||
default.setdefault('moves', None)
|
||||
default.setdefault('shipment_state', 'none')
|
||||
default.setdefault('purchase_date', None)
|
||||
default.setdefault('quoted_by')
|
||||
default.setdefault('confirmed_by')
|
||||
default.setdefault('equipment_create', None)
|
||||
|
||||
return super(Purchase, cls).copy(purchases, default=default)
|
||||
|
||||
@@ -48,15 +49,15 @@ class Purchase(metaclass=PoolMeta):
|
||||
def create_equipments(cls, purchases):
|
||||
if len(purchases) == 1:
|
||||
pool = Pool()
|
||||
Equipment = pool.get("optical_equipment.equipment")
|
||||
Equipment = pool.get('optical_equipment.equipment')
|
||||
Config = pool.get('optical_equipment.configuration')
|
||||
config = Config(1)
|
||||
|
||||
purchase = purchases[0]
|
||||
|
||||
for line in purchase.lines:
|
||||
if not line.product.equipment:
|
||||
continue
|
||||
|
||||
for i in range(0, int(line.quantity)):
|
||||
if line.product.equipment:
|
||||
for i in range(0,int(line.quantity)):
|
||||
equipment = Equipment(
|
||||
company=line.company,
|
||||
location=line.to_location,
|
||||
@@ -67,34 +68,23 @@ class Purchase(metaclass=PoolMeta):
|
||||
model_category=line.product.model_category,
|
||||
mark_category=line.product.mark_category,
|
||||
reference_category=line.product.reference_category,
|
||||
useful_life=(
|
||||
line.product.useful_life if
|
||||
line.product.useful_life else 0
|
||||
),
|
||||
calibration=(
|
||||
True if line.product.calibration
|
||||
else False),
|
||||
warranty=(
|
||||
line.product.warranty if
|
||||
line.product.warranty else 0),
|
||||
useful_life=line.product.useful_life if line.product.useful_life else 0,
|
||||
calibration=True if line.product.calibration else False,
|
||||
warranty=line.product.warranty if line.product.warranty else 0,
|
||||
risk=line.product.risk,
|
||||
origin_country=line.product.origin_country,
|
||||
use=line.product.use,
|
||||
biomedical_class=line.product.biomedical_class,
|
||||
refurbish=line.refurbish,
|
||||
serial=(None if line.quantity > 1
|
||||
else line.serial_equipment),
|
||||
serial=None if line.quantity > 1 else line.serial_equipment,
|
||||
health_register=line.health_register,
|
||||
software_version=(
|
||||
line.product.software_version
|
||||
if line.product.software_required
|
||||
else "No Aplica"
|
||||
),
|
||||
software_version=line.product.software_version if line.product.software_required else "No Aplica",
|
||||
maintenance_frequency="none",
|
||||
purchase_origin=line,
|
||||
)
|
||||
equipment.save()
|
||||
|
||||
else:
|
||||
continue
|
||||
purchase.equipment_create = True
|
||||
cls.save(purchases)
|
||||
else:
|
||||
@@ -103,39 +93,34 @@ class Purchase(metaclass=PoolMeta):
|
||||
|
||||
class Line(metaclass=PoolMeta):
|
||||
"Purchase Line Equipment"
|
||||
__name__ = "purchase.line"
|
||||
__name__ = 'purchase.line'
|
||||
|
||||
origin_country = fields.Many2One("country.country", "Origin Country")
|
||||
address_equipment = fields.Many2One(
|
||||
"party.address", "Direccion", required=True)
|
||||
serial_equipment = fields.Char(
|
||||
"Serial",
|
||||
size=None,
|
||||
# states={'invisible': Decimal(Eval('quantity')) > 1}
|
||||
)
|
||||
origin_country = fields.Many2One('country.country',"Origin Country")
|
||||
address_equipment = fields.Many2One('party.address', "Direccion", required=True)
|
||||
serial_equipment = fields.Char("Serial", size=None,
|
||||
states={'invisible': If(Eval('quantity') > 1, True)})
|
||||
refurbish = fields.Boolean("Refurbish")
|
||||
product_equipment = fields.Boolean(
|
||||
"Product Equipment", states={"readonly": True})
|
||||
product_equipment = fields.Boolean("Product Equipment",
|
||||
states={'readonly': True})
|
||||
software_version = fields.Char("Software version")
|
||||
health_register = fields.Char(
|
||||
"Health Register", states={"required": Eval("product_equipment", True)}
|
||||
)
|
||||
health_register = fields.Char("Health Register", states={'required': Eval('product_equipment', True)})
|
||||
|
||||
|
||||
@classmethod
|
||||
def default_address_equipment(cls):
|
||||
pool = Pool()
|
||||
Company = pool.get("company.company")
|
||||
company = Transaction().context.get("company")
|
||||
Company = pool.get('company.company')
|
||||
company = Transaction().context.get('company')
|
||||
if company:
|
||||
company = Company(company)
|
||||
|
||||
return company.party.addresses[0].id
|
||||
|
||||
@fields.depends(
|
||||
"product", "quantity", methods=["_get_context_purchase_price"])
|
||||
'product', 'quantity', methods=['_get_context_purchase_price'])
|
||||
def on_change_quantity(self):
|
||||
Product = Pool().get("product.product")
|
||||
if self.quantity and (self.quantity > 1 or self.quantity < 1):
|
||||
Product = Pool().get('product.product')
|
||||
if self.quantity > 1 or self.quantity < 1:
|
||||
self.serial_equipment = None
|
||||
|
||||
if not self.product:
|
||||
@@ -143,29 +128,17 @@ class Line(metaclass=PoolMeta):
|
||||
return
|
||||
|
||||
with Transaction().set_context(self._get_context_purchase_price()):
|
||||
self.unit_price = Product.get_purchase_price(
|
||||
[self.product], abs(self.quantity or 0)
|
||||
)[self.product.id]
|
||||
self.unit_price = Product.get_purchase_price([self.product],
|
||||
abs(self.quantity or 0))[self.product.id]
|
||||
|
||||
if self.unit_price:
|
||||
self.unit_price = round_price(self.unit_price)
|
||||
|
||||
@fields.depends(
|
||||
"product",
|
||||
"unit",
|
||||
"purchase",
|
||||
"_parent_purchase.party",
|
||||
"_parent_purchase.invoice_party",
|
||||
"product_supplier",
|
||||
"product_equipment",
|
||||
"serial_equipment",
|
||||
"software_version",
|
||||
"health_register",
|
||||
"refurbish",
|
||||
methods=[
|
||||
"compute_taxes",
|
||||
"compute_unit_price",
|
||||
"_get_product_supplier_pattern",])
|
||||
@fields.depends('product', 'unit', 'purchase', '_parent_purchase.party',
|
||||
'_parent_purchase.invoice_party', 'product_supplier', 'product_equipment',
|
||||
'serial_equipment', 'software_version', 'health_register',
|
||||
'refurbish', methods=['compute_taxes', 'compute_unit_price',
|
||||
'_get_product_supplier_pattern'])
|
||||
def on_change_product(self):
|
||||
if not self.product:
|
||||
self.product_equipment = False
|
||||
@@ -191,19 +164,17 @@ class Line(metaclass=PoolMeta):
|
||||
if not self.unit or self.unit.category != category:
|
||||
self.unit = self.product.purchase_uom
|
||||
|
||||
product_suppliers = list(
|
||||
self.product.product_suppliers_used(
|
||||
**self._get_product_supplier_pattern())
|
||||
)
|
||||
product_suppliers = list(self.product.product_suppliers_used(
|
||||
**self._get_product_supplier_pattern()))
|
||||
if len(product_suppliers) == 1:
|
||||
(self.product_supplier,) = product_suppliers
|
||||
self.product_supplier, = product_suppliers
|
||||
elif (self.product_supplier
|
||||
and self.product_supplier not in product_suppliers):
|
||||
self.product_supplier = None
|
||||
|
||||
self.unit_price = self.compute_unit_price()
|
||||
|
||||
self.type = "line"
|
||||
self.type = 'line'
|
||||
self.amount = self.on_change_with_amount()
|
||||
if self.product.equipment:
|
||||
self.product_equipment = True
|
||||
@@ -214,7 +185,6 @@ class Line(metaclass=PoolMeta):
|
||||
@classmethod
|
||||
def view_attributes(cls):
|
||||
return super(Line, cls).view_attributes() + [
|
||||
('//page[@id="equipment"]', "states",
|
||||
{
|
||||
"invisible": ~Eval("product_equipment", True),
|
||||
('//page[@id="equipment"]', 'states', {
|
||||
'invisible': ~Eval('product_equipment', True),
|
||||
})]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,24 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<office:document xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text">
|
||||
<office:meta><meta:creation-date>2022-11-03T17:09:30.500078764</meta:creation-date><dc:date>2024-04-24T22:52:51.232560466</dc:date><meta:editing-duration>PT2H46M44S</meta:editing-duration><meta:editing-cycles>66</meta:editing-cycles><meta:generator>LibreOffice/7.6.5.2$Linux_X86_64 LibreOffice_project/60$Build-2</meta:generator><meta:document-statistic meta:table-count="6" meta:image-count="1" meta:object-count="0" meta:page-count="3" meta:paragraph-count="100" meta:word-count="285" meta:character-count="3467" meta:non-whitespace-character-count="3265"/></office:meta>
|
||||
<office:meta><meta:creation-date>2022-11-03T17:09:30.500078764</meta:creation-date><dc:date>2023-12-07T22:30:22.616967086</dc:date><meta:editing-duration>PT2H40M53S</meta:editing-duration><meta:editing-cycles>64</meta:editing-cycles><meta:generator>LibreOffice/7.5.8.2$Linux_X86_64 LibreOffice_project/50$Build-2</meta:generator><meta:document-statistic meta:table-count="6" meta:image-count="1" meta:object-count="0" meta:page-count="4" meta:paragraph-count="100" meta:word-count="285" meta:character-count="3434" meta:non-whitespace-character-count="3232"/></office:meta>
|
||||
<office:settings>
|
||||
<config:config-item-set config:name="ooo:view-settings">
|
||||
<config:config-item config:name="ViewAreaTop" config:type="long">13153</config:config-item>
|
||||
<config:config-item config:name="ViewAreaTop" config:type="long">48830</config:config-item>
|
||||
<config:config-item config:name="ViewAreaLeft" config:type="long">0</config:config-item>
|
||||
<config:config-item config:name="ViewAreaWidth" config:type="long">36042</config:config-item>
|
||||
<config:config-item config:name="ViewAreaHeight" config:type="long">15725</config:config-item>
|
||||
<config:config-item config:name="ViewAreaWidth" config:type="long">36117</config:config-item>
|
||||
<config:config-item config:name="ViewAreaHeight" config:type="long">16425</config:config-item>
|
||||
<config:config-item config:name="ShowRedlineChanges" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="InBrowseMode" config:type="boolean">false</config:config-item>
|
||||
<config:config-item-map-indexed config:name="Views">
|
||||
<config:config-item-map-entry>
|
||||
<config:config-item config:name="ViewId" config:type="string">view2</config:config-item>
|
||||
<config:config-item config:name="ViewLeft" config:type="long">10208</config:config-item>
|
||||
<config:config-item config:name="ViewTop" config:type="long">17096</config:config-item>
|
||||
<config:config-item config:name="ViewLeft" config:type="long">9264</config:config-item>
|
||||
<config:config-item config:name="ViewTop" config:type="long">66677</config:config-item>
|
||||
<config:config-item config:name="VisibleLeft" config:type="long">0</config:config-item>
|
||||
<config:config-item config:name="VisibleTop" config:type="long">13153</config:config-item>
|
||||
<config:config-item config:name="VisibleRight" config:type="long">36040</config:config-item>
|
||||
<config:config-item config:name="VisibleBottom" config:type="long">28877</config:config-item>
|
||||
<config:config-item config:name="VisibleTop" config:type="long">48830</config:config-item>
|
||||
<config:config-item config:name="VisibleRight" config:type="long">36116</config:config-item>
|
||||
<config:config-item config:name="VisibleBottom" config:type="long">65253</config:config-item>
|
||||
<config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
|
||||
<config:config-item config:name="ViewLayoutColumns" config:type="short">1</config:config-item>
|
||||
<config:config-item config:name="ViewLayoutBookMode" config:type="boolean">false</config:config-item>
|
||||
@@ -28,118 +28,117 @@
|
||||
<config:config-item config:name="AnchoredTextOverflowLegacy" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="LegacySingleLineFontwork" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="ConnectorUseSnapRect" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="IgnoreBreakAfterMultilineField" config:type="boolean">false</config:config-item>
|
||||
</config:config-item-map-entry>
|
||||
</config:config-item-map-indexed>
|
||||
</config:config-item-set>
|
||||
<config:config-item-set config:name="ooo:configuration-settings">
|
||||
<config:config-item config:name="PrintRightPages" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintProspectRTL" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrintPageBackground" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintDrawings" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintFaxName" config:type="string"/>
|
||||
<config:config-item config:name="PrintReversed" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrintAnnotationMode" config:type="short">0</config:config-item>
|
||||
<config:config-item config:name="PrintHiddenText" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrintEmptyPages" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintGraphics" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="NoNumberingShowFollowBy" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="HyphenateURLs" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="ImagePreferredDPI" config:type="int">0</config:config-item>
|
||||
<config:config-item config:name="FootnoteInColumnToPageEnd" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="GutterAtTop" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="ContinuousEndnotes" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="FrameAutowidthWithMorePara" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="SubtractFlysAnchoredAtFlys" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="SurroundTextWrapSmall" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintLeftPages" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintPaperFromSetup" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrintControls" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="TreatSingleColumnBreakAsPageBreak" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="TabOverSpacing" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrintProspect" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrintBlackFonts" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrintAnnotationMode" config:type="short">0</config:config-item>
|
||||
<config:config-item config:name="PrintEmptyPages" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintSingleJobs" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="AutoFirstLineIndentDisregardLineSpace" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="HeaderSpacingBelowLastPara" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="ProtectBookmarks" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="ContinuousEndnotes" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="DisableOffPagePositioning" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrintTables" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="SubtractFlysAnchoredAtFlys" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="ApplyParagraphMarkFormatToNumbering" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintFaxName" config:type="string"/>
|
||||
<config:config-item config:name="SurroundTextWrapSmall" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="TreatSingleColumnBreakAsPageBreak" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PropLineSpacingShrinksFirstLine" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="TabOverSpacing" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="TabOverMargin" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="EmbedComplexScriptFonts" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="EmbedAsianScriptFonts" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintTextPlaceholder" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="EmbedSystemFonts" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="EmbedFonts" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="DisableOffPagePositioning" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="BackgroundParaOverDrawings" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="AllowPrintJobCancel" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="AddVerticalFrameOffsets" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="ProtectBookmarks" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="AddFrameOffsets" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintBlackFonts" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="TableRowKeep" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="ApplyParagraphMarkFormatToNumbering" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrinterIndependentLayout" config:type="string">high-resolution</config:config-item>
|
||||
<config:config-item config:name="RsidRoot" config:type="int">687431</config:config-item>
|
||||
<config:config-item config:name="PrintProspect" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="CollapseEmptyCellPara" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintPaperFromSetup" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="CurrentDatabaseCommand" config:type="string"/>
|
||||
<config:config-item config:name="CurrentDatabaseDataSource" config:type="string"/>
|
||||
<config:config-item config:name="SaveThumbnail" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="EmbeddedDatabaseName" config:type="string"/>
|
||||
<config:config-item config:name="UnbreakableNumberings" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="SaveGlobalDocumentLinks" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="MsWordCompTrailingBlanks" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintTables" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintLeftPages" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="AddParaTableSpacing" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrinterPaperFromSetup" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="CurrentDatabaseCommandType" config:type="int">0</config:config-item>
|
||||
<config:config-item config:name="ChartAutoUpdate" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="OutlineLevelYieldsNumbering" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="UseOldNumbering" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="AddParaSpacingToTableCells" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="FieldAutoUpdate" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PropLineSpacingShrinksFirstLine" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="TabAtLeftIndentForParagraphsInList" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintRightPages" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="DoNotCaptureDrawObjsOnPage" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="LoadReadonly" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="HeaderSpacingBelowLastPara" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="SaveVersionOnClose" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="ClippedPictures" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="MathBaselineAlignment" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="AlignTabStopPosition" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="UseFormerLineSpacing" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrintSingleJobs" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrinterName" config:type="string"/>
|
||||
<config:config-item config:name="AddParaLineSpacingToTableCells" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="IsKernAsianPunctuation" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="DoNotJustifyLinesWithManualBreak" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="CharacterCompressionType" config:type="short">0</config:config-item>
|
||||
<config:config-item config:name="IsLabelDocument" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="EmbedLatinScriptFonts" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrinterSetup" config:type="base64Binary"/>
|
||||
<config:config-item config:name="EmbedOnlyUsedFonts" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="ApplyUserData" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="AddParaTableSpacingAtStart" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="InvertBorderSpacing" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="ProtectFields" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="AddExternalLeading" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="LinkUpdateMode" config:type="short">1</config:config-item>
|
||||
<config:config-item config:name="UseFormerObjectPositioning" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="UnxForceZeroExtLeading" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="UseFormerTextWrapping" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="ConsiderTextWrapOnObjPos" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="StylesNoDefault" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="IgnoreFirstLineIndentInNumbering" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="EmptyDbFieldHidesPara" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="DoNotResetParaAttrsForNumFont" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="IgnoreTabsAndBlanksForLineCalculation" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="ClipAsCharacterAnchoredWriterFlyFrames" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="DropCapPunctuation" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="UseOldPrinterMetrics" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="RedlineProtectionKey" config:type="base64Binary"/>
|
||||
<config:config-item config:name="TabsRelativeToIndent" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="Rsid" config:type="int">3589123</config:config-item>
|
||||
<config:config-item config:name="UpdateFromTemplate" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="ProtectForm" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="EmbedFonts" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="ClippedPictures" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="FrameAutowidthWithMorePara" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="FloattableNomargins" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="MsWordCompMinLineHeightByFly" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="UnbreakableNumberings" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="AllowPrintJobCancel" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="UseFormerObjectPositioning" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="UseOldNumbering" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="RsidRoot" config:type="int">687431</config:config-item>
|
||||
<config:config-item config:name="PrinterPaperFromSetup" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="CurrentDatabaseDataSource" config:type="string"/>
|
||||
<config:config-item config:name="UpdateFromTemplate" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="AddFrameOffsets" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="LoadReadonly" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="Rsid" config:type="int">3473529</config:config-item>
|
||||
<config:config-item config:name="FootnoteInColumnToPageEnd" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="ProtectFields" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="SaveGlobalDocumentLinks" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="ClipAsCharacterAnchoredWriterFlyFrames" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="LinkUpdateMode" config:type="short">1</config:config-item>
|
||||
<config:config-item config:name="AddExternalLeading" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintGraphics" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="EmbedSystemFonts" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="IsLabelDocument" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="AddParaLineSpacingToTableCells" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="UseFormerTextWrapping" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="HyphenateURLs" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="AddParaTableSpacingAtStart" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="TabsRelativeToIndent" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="FieldAutoUpdate" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="SaveVersionOnClose" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="ChartAutoUpdate" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="ImagePreferredDPI" config:type="int">0</config:config-item>
|
||||
<config:config-item config:name="PrinterSetup" config:type="base64Binary"/>
|
||||
<config:config-item config:name="SmallCapsPercentage66" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="AlignTabStopPosition" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="DropCapPunctuation" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="MathBaselineAlignment" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrinterName" config:type="string"/>
|
||||
<config:config-item config:name="CharacterCompressionType" config:type="short">0</config:config-item>
|
||||
<config:config-item config:name="AddParaTableSpacing" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="DoNotJustifyLinesWithManualBreak" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrintHiddenText" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="IsKernAsianPunctuation" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrinterIndependentLayout" config:type="string">high-resolution</config:config-item>
|
||||
<config:config-item config:name="TabOverflow" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="AddParaSpacingToTableCells" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="AddVerticalFrameOffsets" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="TabAtLeftIndentForParagraphsInList" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="ApplyUserData" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="MsWordCompMinLineHeightByFly" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="PrintTextPlaceholder" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="IgnoreFirstLineIndentInNumbering" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="UseFormerLineSpacing" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrintPageBackground" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="RedlineProtectionKey" config:type="base64Binary"/>
|
||||
<config:config-item config:name="EmbedAsianScriptFonts" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="BackgroundParaOverDrawings" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="SaveThumbnail" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="ConsiderTextWrapOnObjPos" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="EmbeddedDatabaseName" config:type="string"/>
|
||||
<config:config-item config:name="ProtectForm" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="DoNotResetParaAttrsForNumFont" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="MsWordCompTrailingBlanks" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="EmptyDbFieldHidesPara" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="TableRowKeep" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="NoNumberingShowFollowBy" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="InvertBorderSpacing" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="IgnoreTabsAndBlanksForLineCalculation" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="DoNotCaptureDrawObjsOnPage" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="GutterAtTop" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="StylesNoDefault" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="UnxForceZeroExtLeading" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="PrintReversed" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="UseOldPrinterMetrics" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="CurrentDatabaseCommandType" config:type="int">0</config:config-item>
|
||||
<config:config-item config:name="PrintDrawings" config:type="boolean">true</config:config-item>
|
||||
<config:config-item config:name="OutlineLevelYieldsNumbering" config:type="boolean">false</config:config-item>
|
||||
<config:config-item config:name="CurrentDatabaseCommand" config:type="string"/>
|
||||
<config:config-item config:name="CollapseEmptyCellPara" config:type="boolean">true</config:config-item>
|
||||
</config:config-item-set>
|
||||
</office:settings>
|
||||
<office:scripts>
|
||||
@@ -160,14 +159,14 @@
|
||||
</office:font-face-decls>
|
||||
<office:styles>
|
||||
<style:default-style style:family="graphic">
|
||||
<style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:writing-mode="lr-tb" style:flow-with-text="false"/>
|
||||
<style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" loext:tab-stop-distance="0cm" style:font-independent-line-spacing="false">
|
||||
<style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.1181in" draw:shadow-offset-y="0.1181in" draw:start-line-spacing-horizontal="0.1114in" draw:start-line-spacing-vertical="0.1114in" draw:end-line-spacing-horizontal="0.1114in" draw:end-line-spacing-vertical="0.1114in" style:writing-mode="lr-tb" style:flow-with-text="false"/>
|
||||
<style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
|
||||
<style:tab-stops/>
|
||||
</style:paragraph-properties>
|
||||
<style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="DejaVu Serif" fo:font-size="12pt" fo:language="es" fo:country="CO" style:letter-kerning="true" style:font-name-asian="DejaVu Sans1" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="DejaVu Sans1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
|
||||
<style:text-properties style:use-window-font-color="true" loext:opacity="0%" loext:color-lum-mod="100%" loext:color-lum-off="0%" style:font-name="DejaVu Serif" fo:font-size="12pt" fo:language="es" fo:country="CO" style:letter-kerning="true" style:font-name-asian="DejaVu Sans1" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="DejaVu Sans1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/>
|
||||
</style:default-style>
|
||||
<style:default-style style:family="paragraph">
|
||||
<style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="lr-tb"/>
|
||||
<style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="0.4925in" style:writing-mode="lr-tb"/>
|
||||
<style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="DejaVu Serif" fo:font-size="12pt" fo:language="es" fo:country="CO" style:letter-kerning="true" style:font-name-asian="DejaVu Sans1" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="DejaVu Sans1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false" loext:hyphenation-no-last-word="false" loext:hyphenation-word-char-count="5" loext:hyphenation-zone="no-limit"/>
|
||||
</style:default-style>
|
||||
<style:default-style style:family="table">
|
||||
@@ -178,17 +177,17 @@
|
||||
</style:default-style>
|
||||
<style:style style:name="Standard" style:family="paragraph" style:class="text"/>
|
||||
<style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" style:contextual-spacing="false" fo:keep-with-next="always"/>
|
||||
<style:paragraph-properties fo:margin-top="0.1665in" fo:margin-bottom="0.0835in" style:contextual-spacing="false" fo:keep-with-next="always"/>
|
||||
<style:text-properties style:font-name="DejaVu Sans" fo:font-family="'DejaVu Sans'" style:font-family-generic="swiss" style:font-pitch="variable" fo:font-size="14pt" style:font-name-asian="DejaVu Sans1" style:font-family-asian="'DejaVu Sans'" style:font-family-generic-asian="system" style:font-pitch-asian="variable" style:font-size-asian="14pt" style:font-name-complex="DejaVu Sans1" style:font-family-complex="'DejaVu Sans'" style:font-family-generic-complex="system" style:font-pitch-complex="variable" style:font-size-complex="14pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
|
||||
<style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.247cm" style:contextual-spacing="false" fo:line-height="115%"/>
|
||||
<style:paragraph-properties fo:margin-top="0in" fo:margin-bottom="0.0972in" style:contextual-spacing="false" fo:line-height="115%"/>
|
||||
</style:style>
|
||||
<style:style style:name="List" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="list">
|
||||
<style:text-properties style:font-size-asian="12pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="Caption" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
|
||||
<style:paragraph-properties fo:margin-top="0.212cm" fo:margin-bottom="0.212cm" style:contextual-spacing="false" text:number-lines="false" text:line-number="0"/>
|
||||
<style:paragraph-properties fo:margin-top="0.0835in" fo:margin-bottom="0.0835in" style:contextual-spacing="false" text:number-lines="false" text:line-number="0"/>
|
||||
<style:text-properties fo:font-size="12pt" fo:font-style="italic" style:font-size-asian="12pt" style:font-style-asian="italic" style:font-size-complex="12pt" style:font-style-complex="italic"/>
|
||||
</style:style>
|
||||
<style:style style:name="Index" style:family="paragraph" style:parent-style-name="Standard" style:class="index">
|
||||
@@ -198,16 +197,16 @@
|
||||
<style:style style:name="Header_20_and_20_Footer" style:display-name="Header and Footer" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
|
||||
<style:paragraph-properties text:number-lines="false" text:line-number="0">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="8.795cm" style:type="center"/>
|
||||
<style:tab-stop style:position="17.59cm" style:type="right"/>
|
||||
<style:tab-stop style:position="3.4626in" style:type="center"/>
|
||||
<style:tab-stop style:position="6.9252in" style:type="right"/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Header" style:family="paragraph" style:parent-style-name="Header_20_and_20_Footer" style:class="extra">
|
||||
<style:paragraph-properties text:number-lines="false" text:line-number="0">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="8.795cm" style:type="center"/>
|
||||
<style:tab-stop style:position="17.59cm" style:type="right"/>
|
||||
<style:tab-stop style:position="3.4626in" style:type="center"/>
|
||||
<style:tab-stop style:position="6.9252in" style:type="right"/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
</style:style>
|
||||
@@ -226,8 +225,8 @@
|
||||
<style:style style:name="Footer" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
|
||||
<style:paragraph-properties text:number-lines="false" text:line-number="0">
|
||||
<style:tab-stops>
|
||||
<style:tab-stop style:position="8.795cm" style:type="center"/>
|
||||
<style:tab-stop style:position="17.59cm" style:type="right"/>
|
||||
<style:tab-stop style:position="3.4626in" style:type="center"/>
|
||||
<style:tab-stop style:position="6.9252in" style:type="right"/>
|
||||
</style:tab-stops>
|
||||
</style:paragraph-properties>
|
||||
<style:text-properties fo:font-size="9pt" style:font-size-asian="10.5pt"/>
|
||||
@@ -236,7 +235,7 @@
|
||||
<style:text-properties fo:font-size="14pt" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-style-complex="italic" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Subtitle" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="chapter">
|
||||
<style:paragraph-properties fo:margin-top="0.106cm" fo:margin-bottom="0.212cm" style:contextual-spacing="false" fo:text-align="center" style:justify-single-word="false"/>
|
||||
<style:paragraph-properties fo:margin-top="0.0417in" fo:margin-bottom="0.0835in" style:contextual-spacing="false" fo:text-align="center" style:justify-single-word="false"/>
|
||||
<style:text-properties fo:font-size="18pt" style:font-size-asian="18pt" style:font-size-complex="18pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="Title" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="chapter">
|
||||
@@ -244,10 +243,10 @@
|
||||
<style:text-properties fo:font-size="28pt" fo:font-weight="bold" style:font-size-asian="28pt" style:font-weight-asian="bold" style:font-size-complex="28pt" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="Quotations" style:family="paragraph" style:parent-style-name="Standard" style:class="html">
|
||||
<style:paragraph-properties fo:margin-left="1cm" fo:margin-right="1cm" fo:margin-top="0cm" fo:margin-bottom="0.499cm" style:contextual-spacing="false" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0.3937in" fo:margin-right="0.3937in" fo:margin-top="0in" fo:margin-bottom="0.1965in" style:contextual-spacing="false" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="Text_20_body_20_indent" style:display-name="Text body indent" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="text">
|
||||
<style:paragraph-properties fo:margin-left="0.499cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0.1965in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
</style:style>
|
||||
<style:style style:name="Heading_20_3" style:display-name="Heading 3" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:class="text">
|
||||
<style:text-properties fo:font-size="14pt" fo:font-weight="bold" style:font-size-asian="14pt" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-weight-complex="bold"/>
|
||||
@@ -262,10 +261,10 @@
|
||||
<style:text-properties style:font-name="StarSymbol" fo:font-family="StarSymbol" fo:font-size="9pt" style:font-name-asian="StarSymbol" style:font-family-asian="StarSymbol" style:font-size-asian="9pt" style:font-name-complex="StarSymbol" style:font-family-complex="StarSymbol" style:font-size-complex="9pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="Frame" style:family="graphic">
|
||||
<style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" fo:margin-left="0.201cm" fo:margin-right="0.201cm" fo:margin-top="0.201cm" fo:margin-bottom="0.201cm" style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" fo:background-color="transparent" draw:fill="none" draw:fill-color="#729fcf" fo:padding="0.15cm" fo:border="0.06pt solid #000000"/>
|
||||
<style:graphic-properties text:anchor-type="paragraph" svg:x="0in" svg:y="0in" fo:margin-left="0.0791in" fo:margin-right="0.0791in" fo:margin-top="0.0791in" fo:margin-bottom="0.0791in" style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" fo:background-color="transparent" draw:fill="none" draw:fill-color="#729fcf" fo:padding="0.0591in" fo:border="0.06pt solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="Graphics" style:family="graphic">
|
||||
<style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" style:wrap="dynamic" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph" fo:background-color="transparent" draw:fill="none" draw:fill-color="#729fcf"/>
|
||||
<style:graphic-properties text:anchor-type="paragraph" svg:x="0in" svg:y="0in" style:wrap="dynamic" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph" fo:background-color="transparent" draw:fill="none" draw:fill-color="#729fcf"/>
|
||||
</style:style>
|
||||
<text:outline-style style:name="Outline">
|
||||
<text:outline-level-style text:level="1" loext:num-list-format="%1%" style:num-format="">
|
||||
@@ -321,85 +320,69 @@
|
||||
</text:outline-style>
|
||||
<text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/>
|
||||
<text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/>
|
||||
<text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/>
|
||||
<number:currency-style style:name="N115P0" style:volatile="true">
|
||||
<text:linenumbering-configuration text:number-lines="false" text:offset="0.1965in" style:num-format="1" text:number-position="left" text:increment="5"/>
|
||||
<number:currency-style style:name="N130P0" style:volatile="true">
|
||||
<number:currency-symbol number:language="es" number:country="CO">$</number:currency-symbol>
|
||||
<number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
|
||||
</number:currency-style>
|
||||
<number:currency-style style:name="N115">
|
||||
<number:currency-style style:name="N130">
|
||||
<style:text-properties fo:color="#ff0000"/>
|
||||
<number:text>-</number:text>
|
||||
<number:currency-symbol number:language="es" number:country="CO">$</number:currency-symbol>
|
||||
<number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
|
||||
<style:map style:condition="value()>=0" style:apply-style-name="N115P0"/>
|
||||
<style:map style:condition="value()>=0" style:apply-style-name="N130P0"/>
|
||||
</number:currency-style>
|
||||
<style:default-page-layout>
|
||||
<style:page-layout-properties style:writing-mode="lr-tb" style:layout-grid-standard-mode="true"/>
|
||||
</style:default-page-layout>
|
||||
<loext:theme loext:name="Office Theme">
|
||||
<loext:theme-colors loext:name="LibreOffice">
|
||||
<loext:color loext:name="dark1" loext:color="#000000"/>
|
||||
<loext:color loext:name="light1" loext:color="#ffffff"/>
|
||||
<loext:color loext:name="dark2" loext:color="#000000"/>
|
||||
<loext:color loext:name="light2" loext:color="#ffffff"/>
|
||||
<loext:color loext:name="accent1" loext:color="#18a303"/>
|
||||
<loext:color loext:name="accent2" loext:color="#0369a3"/>
|
||||
<loext:color loext:name="accent3" loext:color="#a33e03"/>
|
||||
<loext:color loext:name="accent4" loext:color="#8e03a3"/>
|
||||
<loext:color loext:name="accent5" loext:color="#c99c00"/>
|
||||
<loext:color loext:name="accent6" loext:color="#c9211e"/>
|
||||
<loext:color loext:name="hyperlink" loext:color="#0000ee"/>
|
||||
<loext:color loext:name="followed-hyperlink" loext:color="#551a8b"/>
|
||||
</loext:theme-colors>
|
||||
</loext:theme>
|
||||
</office:styles>
|
||||
<office:automatic-styles>
|
||||
<style:style style:name="Tabla6" style:family="table">
|
||||
<style:table-properties style:width="17.59cm" table:align="margins"/>
|
||||
<style:table-properties style:width="6.925in" table:align="margins"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla6.A" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="8.795cm" style:rel-column-width="32767*"/>
|
||||
<style:table-column-properties style:column-width="3.4625in" style:rel-column-width="32767*"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla6.B" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="8.795cm" style:rel-column-width="32768*"/>
|
||||
<style:table-column-properties style:column-width="3.4625in" style:rel-column-width="32768*"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla6.A1" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border="none"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla6" style:family="table">
|
||||
<style:table-properties style:width="17.59cm" table:align="margins"/>
|
||||
<style:table-properties style:width="6.925in" table:align="margins"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla6.A" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="8.795cm" style:rel-column-width="32767*"/>
|
||||
<style:table-column-properties style:column-width="3.4625in" style:rel-column-width="32767*"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla6.B" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="8.795cm" style:rel-column-width="32768*"/>
|
||||
<style:table-column-properties style:column-width="3.4625in" style:rel-column-width="32768*"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla6.A1" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border="none"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla4" style:family="table">
|
||||
<style:table-properties style:width="17.59cm" table:align="margins" style:writing-mode="lr-tb"/>
|
||||
<style:table-properties style:width="6.925in" table:align="margins" style:writing-mode="lr-tb"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla4.A" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="8.795cm" style:rel-column-width="32767*"/>
|
||||
<style:table-column-properties style:column-width="3.4625in" style:rel-column-width="32767*"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla4.B" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="8.795cm" style:rel-column-width="32768*"/>
|
||||
<style:table-column-properties style:column-width="3.4625in" style:rel-column-width="32768*"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla4.A1" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border="none"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla2" style:family="table">
|
||||
<style:table-properties style:width="17.59cm" table:align="margins" fo:background-color="transparent" style:writing-mode="lr-tb">
|
||||
<style:table-properties style:width="6.925in" table:align="margins" fo:background-color="transparent" style:writing-mode="lr-tb">
|
||||
<style:background-image/>
|
||||
</style:table-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla2.A" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="8.795cm" style:rel-column-width="32767*"/>
|
||||
<style:table-column-properties style:column-width="3.4625in" style:rel-column-width="32767*"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla2.B" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="8.795cm" style:rel-column-width="32768*"/>
|
||||
<style:table-column-properties style:column-width="3.4625in" style:rel-column-width="32768*"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla2.1" style:family="table-row">
|
||||
<style:table-row-properties fo:background-color="transparent">
|
||||
@@ -407,67 +390,67 @@
|
||||
</style:table-row-properties>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla2.A1" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border="none"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla5" style:family="table">
|
||||
<style:table-properties style:width="17.59cm" table:align="margins"/>
|
||||
<style:table-properties style:width="6.925in" table:align="margins"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla5.A" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="8.795cm" style:rel-column-width="32767*"/>
|
||||
<style:table-column-properties style:column-width="3.4625in" style:rel-column-width="32767*"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla5.B" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="8.795cm" style:rel-column-width="32768*"/>
|
||||
<style:table-column-properties style:column-width="3.4625in" style:rel-column-width="32768*"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla5.A1" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="0.5pt solid #000000" fo:border-bottom="0.5pt solid #000000"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="0.5pt solid #000000" fo:border-bottom="0.5pt solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla5.B1" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border="0.5pt solid #000000"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border="0.5pt solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla5.A2" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla5.B2" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="0.5pt solid #000000" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.5pt solid #000000" fo:border-right="0.5pt solid #000000" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla1" style:family="table">
|
||||
<style:table-properties style:width="17.595cm" fo:margin-left="0cm" table:align="left"/>
|
||||
<style:table-properties style:width="6.9271in" fo:margin-left="0in" table:align="left"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla1.A" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="2.205cm"/>
|
||||
<style:table-column-properties style:column-width="0.8681in"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla1.B" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="3.507cm"/>
|
||||
<style:table-column-properties style:column-width="1.3806in"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla1.C" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="11.883cm"/>
|
||||
<style:table-column-properties style:column-width="4.6785in"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla1.A1" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="0.5pt solid #000000" fo:border-bottom="0.5pt solid #000000"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="0.5pt solid #000000" fo:border-bottom="0.5pt solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla1.C1" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border="0.5pt solid #000000"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border="0.5pt solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla1.A2" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="0.5pt solid #000000" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.5pt solid #000000" fo:border-right="0.5pt solid #000000" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="Tabla1.A3" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border-left="0.5pt solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="Table1" style:family="table">
|
||||
<style:table-properties style:width="17.59cm" table:align="margins"/>
|
||||
<style:table-properties style:width="6.925in" table:align="margins"/>
|
||||
</style:style>
|
||||
<style:style style:name="Table1.A" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="8.795cm" style:rel-column-width="32767*"/>
|
||||
<style:table-column-properties style:column-width="3.4625in" style:rel-column-width="32767*"/>
|
||||
</style:style>
|
||||
<style:style style:name="Table1.B" style:family="table-column">
|
||||
<style:table-column-properties style:column-width="8.795cm" style:rel-column-width="32768*"/>
|
||||
<style:table-column-properties style:column-width="3.4625in" style:rel-column-width="32768*"/>
|
||||
</style:style>
|
||||
<style:style style:name="Table1.A1" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border="none"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="Table1.B1" style:family="table-cell">
|
||||
<style:table-cell-properties fo:padding="0.097cm" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
|
||||
<style:table-cell-properties fo:padding="0.0382in" fo:border-left="none" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.5pt solid #000000"/>
|
||||
</style:style>
|
||||
<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Header">
|
||||
<style:paragraph-properties fo:text-align="center" style:justify-single-word="false"/>
|
||||
@@ -486,7 +469,7 @@
|
||||
<style:text-properties style:font-name="Droid Sans Japanese2" fo:font-size="7pt" officeooo:paragraph-rsid="0049dca0" style:font-size-asian="7pt" style:font-size-complex="7pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="P5" style:family="paragraph" style:parent-style-name="Standard">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-align="center" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-align="center" style:justify-single-word="false" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
<style:text-properties style:font-name="Droid Sans Japanese2" fo:font-size="7pt" officeooo:paragraph-rsid="0049dca0" style:font-size-asian="7pt" style:font-size-complex="7pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="P6" style:family="paragraph" style:parent-style-name="Header">
|
||||
@@ -502,7 +485,7 @@
|
||||
<style:text-properties fo:color="#666666" loext:opacity="100%" style:font-name="Droid Sans Japanese2" fo:font-size="7pt" style:text-underline-style="solid" style:text-underline-type="double" style:text-underline-width="auto" style:text-underline-color="font-color" fo:font-weight="bold" officeooo:rsid="0266c2a9" officeooo:paragraph-rsid="0049dca0" style:font-size-asian="7pt" style:font-weight-asian="bold" style:font-size-complex="7pt" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="P9" style:family="paragraph" style:parent-style-name="Header">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-align="center" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-align="center" style:justify-single-word="false" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
<style:text-properties fo:color="#666666" loext:opacity="100%" style:font-name="Droid Sans Japanese2" fo:font-size="7pt" fo:font-style="normal" style:text-underline-style="none" fo:font-weight="normal" officeooo:paragraph-rsid="0049dca0" style:font-size-asian="7pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="7pt" style:font-style-complex="normal" style:font-weight-complex="normal"/>
|
||||
</style:style>
|
||||
<style:style style:name="P10" style:family="paragraph" style:parent-style-name="Header">
|
||||
@@ -518,7 +501,7 @@
|
||||
<style:text-properties style:font-name="Droid Sans Japanese2" fo:font-size="7pt" officeooo:paragraph-rsid="0049dca0" style:font-size-asian="7pt" style:font-size-complex="7pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="P13" style:family="paragraph" style:parent-style-name="Standard">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-align="center" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-align="center" style:justify-single-word="false" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
<style:text-properties style:font-name="Droid Sans Japanese2" fo:font-size="7pt" officeooo:paragraph-rsid="0049dca0" style:font-size-asian="7pt" style:font-size-complex="7pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="P14" style:family="paragraph" style:parent-style-name="Header">
|
||||
@@ -578,11 +561,11 @@
|
||||
<style:text-properties style:font-name="Droid Sans Japanese2" fo:font-size="10pt" fo:font-weight="bold" officeooo:rsid="0030c0b3" officeooo:paragraph-rsid="0030c0b3" style:font-size-asian="10pt" style:font-weight-asian="bold" style:font-size-complex="10pt" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="P28" style:family="paragraph" style:parent-style-name="Standard">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
<style:text-properties style:font-name="Droid Sans Japanese2" fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="P29" style:family="paragraph" style:parent-style-name="Standard">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
<style:text-properties style:font-name="Droid Sans Japanese2" fo:font-size="10pt" officeooo:paragraph-rsid="0014b27d" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="P30" style:family="paragraph" style:parent-style-name="Standard">
|
||||
@@ -594,15 +577,15 @@
|
||||
<style:text-properties style:font-name="Droid Sans Japanese2" fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="P32" style:family="paragraph" style:parent-style-name="Standard">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
<style:text-properties style:font-name="Droid Sans Japanese2" fo:font-size="10pt" officeooo:paragraph-rsid="00274931" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="P33" style:family="paragraph" style:parent-style-name="Standard">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
<style:text-properties style:font-name="Droid Sans Japanese2" fo:font-size="10pt" officeooo:paragraph-rsid="00284349" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="P34" style:family="paragraph" style:parent-style-name="Standard">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
<style:text-properties style:font-name="Droid Sans Japanese2" fo:font-size="10pt" officeooo:paragraph-rsid="0030c0b3" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
|
||||
</style:style>
|
||||
<style:style style:name="P35" style:family="paragraph" style:parent-style-name="Table_20_Contents">
|
||||
@@ -650,7 +633,7 @@
|
||||
<style:text-properties fo:color="#666666" loext:opacity="100%" style:font-name="Droid Sans Japanese2" fo:font-size="7pt" style:text-underline-style="solid" style:text-underline-type="double" style:text-underline-width="auto" style:text-underline-color="font-color" fo:font-weight="bold" officeooo:rsid="0266c2a9" officeooo:paragraph-rsid="0049dca0" style:font-size-asian="7pt" style:font-weight-asian="bold" style:font-size-complex="7pt" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="P46" style:family="paragraph" style:parent-style-name="Header">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-align="center" style:justify-single-word="false" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-align="center" style:justify-single-word="false" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
<style:text-properties fo:color="#666666" loext:opacity="100%" style:font-name="Droid Sans Japanese2" fo:font-size="7pt" fo:font-style="normal" style:text-underline-style="none" fo:font-weight="normal" officeooo:paragraph-rsid="0049dca0" style:font-size-asian="7pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="7pt" style:font-style-complex="normal" style:font-weight-complex="normal"/>
|
||||
</style:style>
|
||||
<style:style style:name="P47" style:family="paragraph" style:parent-style-name="Header">
|
||||
@@ -700,19 +683,19 @@
|
||||
<style:text-properties style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" style:font-name="Droid Sans Japanese2" fo:font-size="10pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="bold" officeooo:rsid="000cde7f" officeooo:paragraph-rsid="0030c0b3" style:font-size-asian="10pt" style:font-style-asian="normal" style:font-weight-asian="bold" style:font-size-complex="10pt" style:font-weight-complex="bold" style:text-emphasize="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="P59" style:family="paragraph" style:parent-style-name="Standard">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
<style:text-properties style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" style:font-name="Droid Sans Japanese2" fo:font-size="10pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="bold" officeooo:rsid="000cde7f" officeooo:paragraph-rsid="00274931" style:font-size-asian="10pt" style:font-style-asian="normal" style:font-weight-asian="bold" style:font-size-complex="10pt" style:font-weight-complex="bold" style:text-emphasize="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="P60" style:family="paragraph" style:parent-style-name="Standard">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
<style:text-properties style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" style:font-name="Droid Sans Japanese2" fo:font-size="10pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="bold" officeooo:rsid="000cde7f" officeooo:paragraph-rsid="00284349" style:font-size-asian="10pt" style:font-style-asian="normal" style:font-weight-asian="bold" style:font-size-complex="10pt" style:font-weight-complex="bold" style:text-emphasize="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="P61" style:family="paragraph" style:parent-style-name="Standard">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
<style:text-properties style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" style:font-name="Droid Sans Japanese2" fo:font-size="10pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="bold" officeooo:rsid="000cde7f" officeooo:paragraph-rsid="002f4ce3" style:font-size-asian="10pt" style:font-style-asian="normal" style:font-weight-asian="bold" style:font-size-complex="10pt" style:font-weight-complex="bold" style:text-emphasize="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="P62" style:family="paragraph" style:parent-style-name="Standard">
|
||||
<style:paragraph-properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
|
||||
<style:paragraph-properties fo:margin-left="0in" fo:margin-right="0in" fo:text-indent="0in" style:auto-text-indent="false"/>
|
||||
<style:text-properties style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" style:font-name="Droid Sans Japanese2" fo:font-size="10pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="bold" officeooo:rsid="000cde7f" officeooo:paragraph-rsid="0030c0b3" style:font-size-asian="10pt" style:font-style-asian="normal" style:font-weight-asian="bold" style:font-size-complex="10pt" style:font-weight-complex="bold" style:text-emphasize="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="P63" style:family="paragraph" style:parent-style-name="Standard">
|
||||
@@ -845,6 +828,10 @@
|
||||
<style:style style:name="P95" style:family="paragraph" style:parent-style-name="Standard">
|
||||
<style:text-properties officeooo:rsid="000a7d47" officeooo:paragraph-rsid="000a7d47"/>
|
||||
</style:style>
|
||||
<style:style style:name="P96" style:family="paragraph" style:parent-style-name="Text_20_body">
|
||||
<style:paragraph-properties fo:text-align="start" style:justify-single-word="false"/>
|
||||
<style:text-properties style:font-name="Droid Sans Japanese2" fo:font-size="9pt" fo:font-weight="bold" officeooo:rsid="00286adc" officeooo:paragraph-rsid="00254a64" style:font-size-asian="9pt" style:font-weight-asian="bold" style:font-size-complex="9pt" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
<style:style style:name="T1" style:family="text">
|
||||
<style:text-properties fo:color="#333333" loext:opacity="100%" fo:font-weight="bold" officeooo:rsid="026544ec" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
|
||||
</style:style>
|
||||
@@ -960,10 +947,10 @@
|
||||
<style:text-properties style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" fo:font-size="9pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="normal" officeooo:rsid="000cde7f" style:font-size-asian="9pt" style:font-style-asian="normal" style:font-weight-asian="normal" style:font-size-complex="9pt" style:font-weight-complex="normal" style:text-emphasize="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="T39" style:family="text">
|
||||
<style:text-properties style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" fo:letter-spacing="-0.019cm" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" style:font-style-asian="normal" style:text-emphasize="none"/>
|
||||
<style:text-properties style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" fo:letter-spacing="-0.0075in" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" style:font-style-asian="normal" style:text-emphasize="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="T40" style:family="text">
|
||||
<style:text-properties style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" fo:letter-spacing="-0.018cm" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" style:font-style-asian="normal" style:text-emphasize="none"/>
|
||||
<style:text-properties style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" fo:letter-spacing="-0.0071in" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" style:font-style-asian="normal" style:text-emphasize="none"/>
|
||||
</style:style>
|
||||
<style:style style:name="T41" style:family="text">
|
||||
<style:text-properties style:text-outline="false" style:text-line-through-style="none" style:text-line-through-type="none" style:font-name="Droid Sans Japanese" fo:font-size="8pt" fo:font-style="normal" fo:text-shadow="none" style:text-underline-style="none" fo:font-weight="bold" style:font-size-asian="8pt" style:font-style-asian="normal" style:font-weight-asian="bold" style:text-emphasize="none"/>
|
||||
@@ -999,19 +986,19 @@
|
||||
<style:text-properties officeooo:rsid="00284349"/>
|
||||
</style:style>
|
||||
<style:style style:name="fr1" style:family="graphic" style:parent-style-name="Graphics">
|
||||
<style:graphic-properties style:vertical-pos="middle" style:vertical-rel="baseline" style:horizontal-pos="from-left" style:horizontal-rel="paragraph" style:mirror="none" fo:clip="rect(0cm, 0cm, 0cm, 0cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard" draw:wrap-influence-on-position="once-concurrent" loext:allow-overlap="true"/>
|
||||
<style:graphic-properties style:vertical-pos="middle" style:vertical-rel="baseline" style:horizontal-pos="from-left" style:horizontal-rel="paragraph" style:mirror="none" fo:clip="rect(0in, 0in, 0in, 0in)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="100%" draw:color-inversion="false" draw:image-opacity="100%" draw:color-mode="standard" draw:wrap-influence-on-position="once-concurrent" loext:allow-overlap="true"/>
|
||||
</style:style>
|
||||
<style:style style:name="fr2" style:family="graphic" style:parent-style-name="Frame">
|
||||
<style:graphic-properties style:run-through="foreground" style:wrap="none" style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph" fo:padding="0.15cm" fo:border="none" draw:wrap-influence-on-position="once-concurrent" loext:allow-overlap="true">
|
||||
<style:columns fo:column-count="1" fo:column-gap="0cm"/>
|
||||
<style:graphic-properties style:run-through="foreground" style:wrap="none" style:vertical-pos="from-top" style:vertical-rel="paragraph" style:horizontal-pos="from-left" style:horizontal-rel="paragraph" fo:padding="0.0591in" fo:border="none" draw:wrap-influence-on-position="once-concurrent" loext:allow-overlap="true">
|
||||
<style:columns fo:column-count="1" fo:column-gap="0in"/>
|
||||
</style:graphic-properties>
|
||||
</style:style>
|
||||
<style:page-layout style:name="pm1">
|
||||
<style:page-layout-properties fo:page-width="21.59cm" fo:page-height="27.94cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="44" style:layout-grid-base-height="0.55cm" style:layout-grid-ruby-height="0cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="true" style:layout-grid-display="true" style:layout-grid-base-width="0.37cm" style:layout-grid-snap-to="true" style:footnote-max-height="0cm" loext:margin-gutter="0cm">
|
||||
<style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
|
||||
<style:page-layout-properties fo:page-width="8.5in" fo:page-height="11in" style:num-format="1" style:print-orientation="portrait" fo:margin-top="0.7874in" fo:margin-bottom="0.7874in" fo:margin-left="0.7874in" fo:margin-right="0.7874in" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="44" style:layout-grid-base-height="0.2165in" style:layout-grid-ruby-height="0in" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="true" style:layout-grid-display="true" style:layout-grid-base-width="0.1457in" style:layout-grid-snap-to="true" style:footnote-max-height="0in" loext:margin-gutter="0in">
|
||||
<style:footnote-sep style:width="0.0071in" style:distance-before-sep="0.0398in" style:distance-after-sep="0.0398in" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
|
||||
</style:page-layout-properties>
|
||||
<style:header-style>
|
||||
<style:header-footer-properties fo:min-height="0cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="0.499cm" fo:background-color="transparent" draw:fill="none" draw:fill-color="#729fcf"/>
|
||||
<style:header-footer-properties fo:min-height="0in" fo:margin-left="0in" fo:margin-right="0in" fo:margin-bottom="0.1965in" fo:background-color="transparent" draw:fill="none" draw:fill-color="#729fcf"/>
|
||||
</style:header-style>
|
||||
<style:footer-style/>
|
||||
</style:page-layout>
|
||||
@@ -1027,7 +1014,7 @@
|
||||
<table:table-column table:style-name="Tabla6.B"/>
|
||||
<table:table-row>
|
||||
<table:table-cell table:style-name="Tabla6.A1" office:value-type="string">
|
||||
<text:p text:style-name="Table_20_Contents"><draw:frame draw:style-name="fr1" draw:name="Imagen2" text:anchor-type="as-char" svg:width="6.884cm" svg:height="1.538cm" draw:z-index="2"><draw:image draw:mime-type="image/jpeg">
|
||||
<text:p text:style-name="Table_20_Contents"><draw:frame draw:style-name="fr1" draw:name="Imagen2" text:anchor-type="as-char" svg:width="2.7102in" svg:height="0.6055in" draw:z-index="3"><draw:image draw:mime-type="image/jpeg">
|
||||
<office:binary-data>/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoM
|
||||
DAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsN
|
||||
FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAAR
|
||||
@@ -1600,7 +1587,7 @@
|
||||
<text:p text:style-name="P78">REGISTRO DE MANTENIMIENTO CORRECTIVO</text:p>
|
||||
<text:p text:style-name="P82"><text:placeholder text:placeholder-type="text"></when></text:placeholder></text:p>
|
||||
<text:p text:style-name="P79"><text:placeholder text:placeholder-type="text"></choose></text:placeholder></text:p>
|
||||
<text:p text:style-name="P72"><text:span text:style-name="T44">Fecha</text:span><text:span text:style-name="T30"> </text:span><text:span text:style-name="T36"><text:placeholder text:placeholder-type="text" text:description="maintenance.service_maintenance.estimated_agended.date()"><maintenance.service_maintenance.estimated_agended.date()></text:placeholder></text:span></text:p>
|
||||
<text:p text:style-name="P72"><text:span text:style-name="T44">Fecha</text:span><text:span text:style-name="T30"> </text:span><text:span text:style-name="T36"><text:placeholder text:placeholder-type="text" text:description="format_datetime(datetime.datetime.now(),user.language, '%25B %25d ,%25Y %25H:%25M%25p', maintenance.company.timezone)"><format_datetime(datetime.datetime.now(),user.language, '%b/%d/%Y', maintenance.company.timezone)></text:placeholder></text:span></text:p>
|
||||
<text:p text:style-name="P72"><text:span text:style-name="T43">Consecutivo</text:span> <text:span text:style-name="T45"><text:placeholder text:placeholder-type="text"><maintenance.code></text:placeholder></text:span></text:p>
|
||||
<text:p text:style-name="P95"/>
|
||||
<text:p text:style-name="P73"><text:span text:style-name="T31">INFORMACIÓN</text:span><text:span text:style-name="T39"> </text:span><text:span text:style-name="T31">DEL</text:span><text:span text:style-name="T40"> </text:span><text:span text:style-name="T31">PROPIETARIO</text:span></text:p>
|
||||
@@ -1771,7 +1758,7 @@
|
||||
<table:table-row>
|
||||
<table:table-cell table:style-name="Table1.A1" office:value-type="string">
|
||||
<text:p text:style-name="P34"><text:placeholder text:placeholder-type="text"><if test="maintenance.technician_signature"></text:placeholder></text:p>
|
||||
<text:p text:style-name="P62"><draw:frame draw:style-name="fr2" draw:name="image: (maintenance.technician_signature, 'image/png')" text:anchor-type="paragraph" svg:x="0.201cm" svg:y="0.295cm" svg:width="4.108cm" svg:height="1.949cm" draw:z-index="3">
|
||||
<text:p text:style-name="P62"><draw:frame draw:style-name="fr2" draw:name="image: (maintenance.technician_signature, 'image/png')" text:anchor-type="paragraph" svg:x="0.0791in" svg:y="0.1161in" svg:width="1.6173in" svg:height="0.7673in" draw:z-index="4">
|
||||
<draw:text-box>
|
||||
<text:p text:style-name="P48"/>
|
||||
<text:p text:style-name="Text">Texto <text:sequence text:ref-name="refText0" text:name="Text" text:formula="ooow:Text+1" style:num-format="1">1</text:sequence>: </text:p>
|
||||
@@ -1799,7 +1786,7 @@
|
||||
</table:table-cell>
|
||||
</table:table-row>
|
||||
</table:table>
|
||||
<text:p text:style-name="P22"><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p>
|
||||
<text:p text:style-name="P22"><text:soft-page-break/><text:placeholder text:placeholder-type="text"></for></text:placeholder></text:p>
|
||||
</office:text>
|
||||
</office:body>
|
||||
</office:document>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1533
report/Service.fodt
1533
report/Service.fodt
File diff suppressed because it is too large
Load Diff
134
sale.py
134
sale.py
@@ -1,18 +1,18 @@
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
from trytond.model import ModelView, fields
|
||||
from trytond.pyson import Eval, If
|
||||
from trytond.model import ModelView, ModelSQL, fields
|
||||
from trytond.modules.currency.fields import Monetary
|
||||
from trytond.pyson import Eval, Bool, If, Get, Equal
|
||||
from decimal import Decimal
|
||||
from trytond.modules.product import price_digits
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.model import Workflow
|
||||
from trytond.modules.company.model import (
|
||||
set_employee)
|
||||
employee_field, set_employee, reset_employee)
|
||||
|
||||
from trytond.exceptions import UserError
|
||||
|
||||
from trytond.wizard import (
|
||||
Button, StateAction, StateView, Wizard)
|
||||
from trytond.i18n import gettext
|
||||
from trytond.modules.sale.exceptions import PartyLocationError
|
||||
from datetime import datetime
|
||||
Button, StateAction, StateTransition, StateView, Wizard)
|
||||
|
||||
|
||||
class Sale(metaclass=PoolMeta):
|
||||
@@ -20,39 +20,29 @@ class Sale(metaclass=PoolMeta):
|
||||
__name__ = 'sale.sale'
|
||||
|
||||
quote_number = fields.Char("Quote Number", readonly=True)
|
||||
|
||||
sale_type = fields.Selection([
|
||||
('maintenance', 'Maintenance'),
|
||||
sale_type = fields.Selection([('maintenance', 'Maintenance'),
|
||||
('equipments', 'Equipments'),
|
||||
('replaces', 'Replaces')],
|
||||
"Sale Type", required=True,
|
||||
states={
|
||||
'readonly': Eval('state') != 'draft'})
|
||||
|
||||
maintenance_type = fields.Selection([
|
||||
('', ""),
|
||||
('replaces', 'Replaces')], "Sale Type", required=True,
|
||||
states={'readonly': Eval('state') != 'draft'})
|
||||
maintenance_type = fields.Selection([('', ""),
|
||||
('preventive', 'Preventive'),
|
||||
('corrective', 'Corrective')],
|
||||
"Maintenance Type",
|
||||
('corrective', 'Corrective')
|
||||
], "Maintenance Type",
|
||||
states={
|
||||
'invisible': Eval('sale_type') != "maintenance",
|
||||
'required': Eval('sale_type') == "maintenance",
|
||||
'readonly': Eval('state') != 'draft'},
|
||||
depends=['sale_type'])
|
||||
|
||||
contract_ref = fields.Reference(
|
||||
"Contract Base", selection='get_origin_contract',
|
||||
domain={
|
||||
'optical_equipment.contract': [
|
||||
contract_ref = fields.Reference("Contract Base", selection='get_origin_contract',
|
||||
domain={'optical_equipment.contract': [
|
||||
('party', '=', Eval('party')),
|
||||
('state', '=', 'closed'),
|
||||
]},
|
||||
states={
|
||||
'invisible': (
|
||||
Eval('sale_type') != 'maintenance')},
|
||||
states={'invisible': (Eval('sale_type') != 'maintenance')},
|
||||
search_context={
|
||||
'related_party': Eval('party'), })
|
||||
|
||||
'related_party': Eval('party'),
|
||||
},)
|
||||
agended = fields.Boolean("Scheduling", states={
|
||||
'invisible': (Eval('sale_type') != 'maintenance')})
|
||||
payment_term_description = fields.Char("Payment Term", states={
|
||||
@@ -86,14 +76,6 @@ class Sale(metaclass=PoolMeta):
|
||||
('processing', 'draft')
|
||||
))
|
||||
|
||||
@classmethod
|
||||
def default_agended(self):
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def default_sale_date(cls):
|
||||
return datetime.today().date()
|
||||
|
||||
@fields.depends('lines', 'sale_type', 'agended')
|
||||
def on_chage_sale_type(self):
|
||||
self.lines = []
|
||||
@@ -102,6 +84,10 @@ class Sale(metaclass=PoolMeta):
|
||||
elif self.sale_type == "maintenance":
|
||||
self.invoice_method = 'order'
|
||||
|
||||
@classmethod
|
||||
def default_agended(self):
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def _get_origin_contract(cls):
|
||||
'Return list of Model names for origin Reference'
|
||||
@@ -143,48 +129,50 @@ class Sale(metaclass=PoolMeta):
|
||||
except UserError:
|
||||
raise UserError(str('Validation Error'))
|
||||
else:
|
||||
raise UserError(
|
||||
gettext('optical_equipment.msg_not_sequence_quote'))
|
||||
raise UserError(gettext('optical_equipment.msg_not_sequence_quote'))
|
||||
|
||||
@classmethod
|
||||
@ classmethod
|
||||
def copy(cls, sales, default=None):
|
||||
today = datetime.today().date()
|
||||
if default is None:
|
||||
default = {}
|
||||
else:
|
||||
default = default.copy()
|
||||
|
||||
default.setdefault('number', None)
|
||||
default.setdefault('invoice_state', 'none')
|
||||
default.setdefault('invoices_ignored', None)
|
||||
default.setdefault('moves', None)
|
||||
default.setdefault('shipment_state', 'none')
|
||||
default.setdefault('sale_date', today)
|
||||
default.setdefault('quoted_by')
|
||||
default.setdefault('confirmed_by')
|
||||
|
||||
return super(Sale, cls).copy(sales, default=default)
|
||||
|
||||
@classmethod
|
||||
@ModelView.button_action(
|
||||
@ classmethod
|
||||
@ ModelView.button_action(
|
||||
'optical_equipment.wizard_print_balance_sale_party')
|
||||
def report(cls, sales):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
@ModelView.button
|
||||
@Workflow.transition('quotation')
|
||||
@ classmethod
|
||||
@ ModelView.button
|
||||
@ Workflow.transition('quotation')
|
||||
def quote(cls, sales):
|
||||
pool = Pool()
|
||||
AdvancePaymentCondition = pool.get('sale.advance_payment.condition')
|
||||
for sale in sales:
|
||||
sale.check_for_quotation()
|
||||
cls.set_quote_number(sales)
|
||||
|
||||
# for sale in sales:
|
||||
# sale.set_advance_payment_term()
|
||||
# cls.save(sales)
|
||||
for sale in sales:
|
||||
sale.set_advance_payment_term()
|
||||
cls.save(sales)
|
||||
|
||||
@classmethod
|
||||
@ModelView.button_action(
|
||||
@ classmethod
|
||||
@ ModelView.button_action(
|
||||
'optical_equipment.wizard_confirm_sale_date')
|
||||
@Workflow.transition('confirmed')
|
||||
@set_employee('confirmed_by')
|
||||
@ Workflow.transition('confirmed')
|
||||
@ set_employee('confirmed_by')
|
||||
def confirm(cls, sales):
|
||||
pool = Pool()
|
||||
Configuration = pool.get('sale.configuration')
|
||||
@@ -204,9 +192,7 @@ class Sale(metaclass=PoolMeta):
|
||||
state_agended='no_agenda',
|
||||
propietary=sale.party,
|
||||
propietary_address=sale.shipment_address,
|
||||
contract_origin=(
|
||||
sale.contract_ref.id
|
||||
if sale.contract_ref else None),
|
||||
contract_origin=sale.contract_ref if sale.contract_ref else None,
|
||||
sale_origin=sale,
|
||||
sale_date=sale.sale_date,
|
||||
state="draft"
|
||||
@@ -228,6 +214,8 @@ class SaleLine(metaclass=PoolMeta):
|
||||
__name__ = 'sale.line'
|
||||
|
||||
product_equipment = fields.Boolean("Product Equipment")
|
||||
unit_digits = fields.Function(fields.Integer('Unit Digits'),
|
||||
'on_change_with_unit_digits')
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
@@ -236,17 +224,17 @@ class SaleLine(metaclass=PoolMeta):
|
||||
If(Eval('_parent_sale.sale_type') == 'maintenance',
|
||||
[('type', '=', 'service'),
|
||||
('maintenance_activity', '=', True)], []))
|
||||
cls.product.domain.append(
|
||||
If(Eval('_parent_sale.sale_type') == 'replaces',
|
||||
cls.product.domain.append(If(Eval('_parent_sale.sale_type') == 'replaces',
|
||||
[('replacement', '=', True)], []))
|
||||
|
||||
@fields.depends(
|
||||
'product', 'unit', 'quantity', 'sale',
|
||||
'_parent_sale.party', '_parent_sale.sale_type',
|
||||
methods=[
|
||||
'_get_tax_rule_pattern',
|
||||
'_get_context_sale_price',
|
||||
'on_change_with_amount'])
|
||||
def on_change_with_unit_digits(self, name=None):
|
||||
if self.unit:
|
||||
return self.unit.digits
|
||||
return 2
|
||||
|
||||
@fields.depends('product', 'unit', 'quantity', 'sale',
|
||||
'_parent_sale.party', '_parent_sale.sale_type', methods=['_get_tax_rule_pattern',
|
||||
'_get_context_sale_price', 'on_change_with_amount'])
|
||||
def on_change_product(self):
|
||||
Product = Pool().get('product.product')
|
||||
if not self.product:
|
||||
@@ -265,8 +253,7 @@ class SaleLine(metaclass=PoolMeta):
|
||||
self.product_equipment = False
|
||||
party = self.sale.party
|
||||
|
||||
# Set taxes before unit_price
|
||||
# to have taxes in context of sale price
|
||||
# Set taxes before unit_price to have taxes in context of sale price
|
||||
taxes = []
|
||||
pattern = self._get_tax_rule_pattern()
|
||||
for tax in self.product.customer_taxes_used:
|
||||
@@ -286,13 +273,11 @@ class SaleLine(metaclass=PoolMeta):
|
||||
category = self.product.sale_uom.category
|
||||
if not self.unit or self.unit.category != category:
|
||||
self.unit = self.product.sale_uom
|
||||
# self.unit_digits = self.product.sale_uom.digits
|
||||
self.unit_digits = self.product.sale_uom.digits
|
||||
|
||||
with Transaction().set_context(self._get_context_sale_price()):
|
||||
self.unit_price = Product.get_sale_price(
|
||||
[self.product],
|
||||
self.quantity or 0
|
||||
)[self.product.id]
|
||||
self.unit_price = Product.get_sale_price([self.product],
|
||||
self.quantity or 0)[self.product.id]
|
||||
|
||||
if self.unit_price:
|
||||
self.unit_price = self.unit_price.quantize(
|
||||
@@ -340,7 +325,7 @@ class SaleLine(metaclass=PoolMeta):
|
||||
|
||||
move = Move()
|
||||
move.quantity = quantity
|
||||
move.unit = self.unit
|
||||
move.uom = self.unit
|
||||
move.product = self.product
|
||||
move.from_location = self.from_location
|
||||
move.to_location = self.to_location
|
||||
@@ -371,8 +356,7 @@ class ConfirmSaleDate(Wizard):
|
||||
|
||||
start = StateView('optical_equipment.confirm_sale_date.form',
|
||||
'optical_equipment.confirm_sale_date_view_form', [
|
||||
Button('Confirmar', 'confirm_date',
|
||||
'tryton-ok', default=True),
|
||||
Button('Confirmar', 'confirm_date', 'tryton-ok', default=True),
|
||||
])
|
||||
|
||||
confirm_date = StateAction('sale.act_sale_form')
|
||||
|
||||
5
sale.xml
5
sale.xml
@@ -2,7 +2,6 @@
|
||||
<!--This file file is part of Tryton. The COPYRIGHT file at the top level
|
||||
of this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="sale_view_tree">
|
||||
<field name="model">sale.sale</field>
|
||||
<field name="inherit" ref="sale.sale_view_tree"/>
|
||||
@@ -70,11 +69,9 @@
|
||||
<field name="report">optical_equipment/report/Payment.fodt</field>
|
||||
<field name="single" eval="True"/>
|
||||
</record>
|
||||
<!--
|
||||
<record model="ir.action.keyword" id="report_payment_keyword">
|
||||
<field name="keyword">form_print</field>
|
||||
<field name="model">account.statement.line,-1</field>
|
||||
<field name="action" ref="report_payment"/>
|
||||
</record> -->
|
||||
</data>
|
||||
</record>
|
||||
</tryton>
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
<!--This file file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<record model="ir.ui.view" id="shipment_out_view_form">
|
||||
<field name="model">stock.shipment.out</field>
|
||||
<field name="inherit" ref="stock.shipment_out_view_form"/>
|
||||
<field name="name">shipment_out_form</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
Before Width: | Height: | Size: 5.2 KiB |
@@ -1,495 +0,0 @@
|
||||
===========================
|
||||
Optical Equipment Scenario
|
||||
===========================
|
||||
Imports::
|
||||
>>> from proteus import Model, Wizard
|
||||
>>> from trytond.tests.tools import activate_modules, set_user
|
||||
>>> from datetime import date, timedelta, datetime
|
||||
>>> import xml.etree.ElementTree as ET
|
||||
>>> from trytond.modules.company.tests.tools import create_company, get_company
|
||||
>>> from trytond.modules.account.tests.tools import (create_chart, create_fiscalyear, create_tax, get_accounts)
|
||||
>>> from trytond.modules.account_invoice.tests.tools import (create_payment_term, set_fiscalyear_invoice_sequences)
|
||||
>>> from decimal import Decimal
|
||||
>>> import datetime
|
||||
>>> today = datetime.date.today()
|
||||
>>> from trytond.tools import file_open
|
||||
|
||||
Activate modules::
|
||||
>>> config = activate_modules('optical_equipment')
|
||||
|
||||
Create company::
|
||||
>>> _ = create_company()
|
||||
>>> company = get_company()
|
||||
|
||||
Create user admin::
|
||||
>>> Group = Model.get("res.group")
|
||||
>>> User = Model.get("res.user")
|
||||
>>> user = User(config.user)
|
||||
>>> user.login = "admin"
|
||||
>>> user.save()
|
||||
>>> group, = Group().find(["name", "=", "Administration"])
|
||||
>>> group
|
||||
proteus.Model.get('res.group')(1)
|
||||
|
||||
>>> group_equipment, = Group().find(["name", "=", "Equipment Administration"])
|
||||
>>> group_equipment
|
||||
proteus.Model.get('res.group')(18)
|
||||
|
||||
>>> group.users.append(user)
|
||||
>>> group.save()
|
||||
>>> group_equipment.users
|
||||
[proteus.Model.get('res.user')(1)]
|
||||
|
||||
Set employee::
|
||||
>>> User = Model.get('res.user')
|
||||
>>> Party = Model.get('party.party')
|
||||
>>> Employee = Model.get('company.employee')
|
||||
>>> employee_party = Party(name="Employee")
|
||||
>>> employee_party.save()
|
||||
>>> employee = Employee(party=employee_party)
|
||||
>>> employee.save()
|
||||
>>> user = User(config.user)
|
||||
>>> user.employees.append(employee)
|
||||
>>> user.employee = employee
|
||||
>>> user.save()
|
||||
>>> set_user(user.id)
|
||||
|
||||
Create fiscal year::
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(create_fiscalyear(company))
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Create chart of accounts::
|
||||
>>> _ = create_chart(company)
|
||||
>>> accounts = get_accounts(company)
|
||||
>>> accounts
|
||||
{'receivable': proteus.Model.get('account.account')(5), 'payable': proteus.Model.get('account.account')(4), 'revenue': proteus.Model.get('account.account')(6), 'expense': proteus.Model.get('account.account')(3), 'cash': proteus.Model.get('account.account')(2), 'tax': proteus.Model.get('account.account')(7)}
|
||||
|
||||
>>> revenue = accounts['revenue']
|
||||
>>> expense = accounts['expense']
|
||||
>>> cash = accounts['cash']
|
||||
|
||||
>>> Journal = Model.get('account.journal')
|
||||
>>> PaymentMethod = Model.get('account.invoice.payment.method')
|
||||
>>> cash_journal, = Journal.find([('type', '=', 'cash')])
|
||||
>>> cash_journal.save()
|
||||
>>> payment_method = PaymentMethod()
|
||||
>>> payment_method.name = 'Cash'
|
||||
>>> payment_method.journal = cash_journal
|
||||
>>> payment_method.credit_account = cash
|
||||
>>> payment_method.debit_account = cash
|
||||
>>> payment_method.save()
|
||||
|
||||
Create tax::
|
||||
>>> tax = create_tax(Decimal('.10'))
|
||||
>>> tax.save()
|
||||
|
||||
Create configuration equipment::
|
||||
>>> Config = Model.get("optical_equipment.configuration")
|
||||
>>> UOM = Model.get("product.uom")
|
||||
>>> celsius = UOM.find([("name", "=", "Celsius")])
|
||||
>>> celsius
|
||||
[proteus.Model.get('product.uom')(39)]
|
||||
|
||||
>>> moisture = UOM.find([("name", "=", "Relative Humedity")])
|
||||
>>> moisture
|
||||
[proteus.Model.get('product.uom')(42)]
|
||||
|
||||
>>> config = Config().find([])[0]
|
||||
>>> equipment_sequence, = Model.get("ir.sequence").find(["name", "=", "Equipment"])
|
||||
>>> equipment_sequence
|
||||
proteus.Model.get('ir.sequence')(14)
|
||||
|
||||
>>> config.technician_responsible = employee
|
||||
>>> with file_open("optical_equipment/tests/files/signature.png", "rb") as signature:
|
||||
... config.technician_signature = signature.read()
|
||||
>>> config.invima = "RH-202309-02409"
|
||||
>>> config.equipment_sequence = equipment_sequence
|
||||
>>> maintenance_sequence, = Model.get("ir.sequence").find(["name", "=", "Maintenance"])
|
||||
>>> maintenance_sequence
|
||||
proteus.Model.get('ir.sequence')(15)
|
||||
|
||||
|
||||
>>> config.maintenance_sequence = maintenance_sequence
|
||||
>>> agended_sequence, = Model.get("ir.sequence").find(["name", "=", "Agended"])
|
||||
>>> agended_sequence
|
||||
proteus.Model.get('ir.sequence')(13)
|
||||
|
||||
>>> config.agended_sequence = agended_sequence
|
||||
|
||||
>>> contract_sequence, = Model.get("ir.sequence").find(["name", "=", "Contract"])
|
||||
>>> contract_sequence
|
||||
proteus.Model.get('ir.sequence')(12)
|
||||
>>> config.contract_sequence = contract_sequence
|
||||
|
||||
>>> sale_quote_number, = Model.get("ir.sequence").find(["name", "=", "Sale Quote"])
|
||||
>>> sale_quote_number
|
||||
proteus.Model.get('ir.sequence')(16)
|
||||
>>> config.sale_quote_number = sale_quote_number
|
||||
|
||||
>>> config.temperature_min = 19
|
||||
>>> config.temperature_max = 21
|
||||
>>> config.temperature_uom = celsius[0]
|
||||
|
||||
>>> config.moisture_min = 43
|
||||
>>> config.moisture_max = 45
|
||||
>>> config.moisture_uom = moisture[0]
|
||||
>>> config.save()
|
||||
|
||||
Create supplier::
|
||||
>>> Party = Model.get('party.party')
|
||||
>>> supplier = Party(name='Supplier')
|
||||
>>> supplier.save()
|
||||
|
||||
|
||||
Create customer type optica::
|
||||
>>> customer_optica = Party(name='Customer optica', customer_type='optica')
|
||||
>>> customer_optica.save()
|
||||
>>> customer_optica.customer_type
|
||||
'optica'
|
||||
|
||||
|
||||
Create customer type ips::
|
||||
>>> customer_ips = Party(name='Customer ips', customer_type='ips')
|
||||
>>> customer_ips.save()
|
||||
>>> customer_ips.customer_type
|
||||
'ips'
|
||||
|
||||
Creaate contact optica::
|
||||
>>> local_phone = customer_optica.contact_mechanisms.new()
|
||||
>>> local_phone.type = 'phone'
|
||||
>>> local_phone.value = '666666666'
|
||||
>>> local_phone.value
|
||||
'666666666'
|
||||
|
||||
Creaate contact ips::
|
||||
>>> local_phone = customer_ips.contact_mechanisms.new()
|
||||
>>> local_phone.type = 'phone'
|
||||
>>> local_phone.value = '666666666'
|
||||
>>> local_phone.value
|
||||
'666666666'
|
||||
|
||||
|
||||
Create account categories::
|
||||
>>> ProductCategory = Model.get('product.category')
|
||||
>>> optical_equitment_category = ProductCategory(name="Optical Equipment")
|
||||
>>> optical_equitment_category.accounting = True
|
||||
>>> optical_equitment_category.account_expense = expense
|
||||
>>> optical_equitment_category.account_revenue = revenue
|
||||
>>> children_1 = optical_equitment_category.childs.new(name="Optical Mobiliario")
|
||||
>>> optical_equitment_category.save()
|
||||
>>> len(optical_equitment_category.childs)
|
||||
1
|
||||
|
||||
Create taxes::
|
||||
>>> optical_equitment_category_tax, = optical_equitment_category.duplicate()
|
||||
>>> optical_equitment_category_tax.customer_taxes.append(tax)
|
||||
>>> optical_equitment_category_tax.save()
|
||||
|
||||
Create mark, model and reference category::
|
||||
>>> mark_category = ProductCategory(name="ADLER")
|
||||
>>> mark_category.save()
|
||||
>>> model_category = ProductCategory(name="ADLER_01", parent=mark_category)
|
||||
>>> model_category.save()
|
||||
>>> reference_category = ProductCategory(name="ADLER_01", parent=model_category)
|
||||
>>> reference_category.save()
|
||||
|
||||
>>> mark_category.childs
|
||||
[proteus.Model.get('product.category')(6)]
|
||||
|
||||
Create product optical equipment::
|
||||
>>> ProductUom = Model.get('product.uom')
|
||||
>>> unit, = ProductUom.find([('name', '=', 'Unit')])
|
||||
>>> ProductTemplate = Model.get('product.template')
|
||||
>>> template = ProductTemplate()
|
||||
>>> template.name = 'UNIDAD REFRACCION ESTANDAR'
|
||||
>>> template.default_uom = unit
|
||||
>>> template.type = 'goods'
|
||||
>>> template.salable = True
|
||||
>>> template.purchasable = True
|
||||
>>> template.equipment = True
|
||||
>>> template.list_price = Decimal('10')
|
||||
>>> template.account_category = optical_equitment_category_tax
|
||||
>>> template.maintenance_required = True
|
||||
|
||||
Mark Maintenance Activities::
|
||||
>>> template.initial_operation = True
|
||||
>>> template.check_equipment = True
|
||||
>>> template.check_electric_system = True
|
||||
>>> template.clean_int_ext = True
|
||||
>>> template.preventive_activities = "Se verificaron las condiciones ambientales, se verificó estado físico del equipo, se verificó funcionamiento, se verificó tomas eléctricas y conexiones, se verificó el estado de los pulsadores, se verificó que el motor de la silla suba y baje, se realizó limpieza general, se lubricaron partes que lo requieren, se confirmó nuevamente funcionamiento."
|
||||
|
||||
Mark Calibration Required::
|
||||
>>> template.calibration = True
|
||||
>>> template.uncertainy_pattern = 0.1
|
||||
>>> template.k_pattern = '-5.00'
|
||||
>>> UsePattern = Model.get('optical_equipment.use_pattern')
|
||||
>>> schematic_eye, = UsePattern.find([('name_pattern', '=', 'Schematic Eye')])
|
||||
>>> template.use_pattern = schematic_eye
|
||||
>>> k_pattern = template.k_pattern_list.new(pattern=-5)
|
||||
>>> k_pattern.save()
|
||||
>>> template.MEP = 0.1
|
||||
>>> template.Usubi = 200
|
||||
>>> template.resolution_type = 'digital'
|
||||
>>> template.d_resolution = 0.25
|
||||
>>> template.equipment_type = 'mobiliario_optico'
|
||||
>>> template.biomedical_class = 'diagnostico'
|
||||
>>> template.main_tecnology = 'electronico'
|
||||
>>> template.mark_category = mark_category
|
||||
>>> template.model_category = model_category
|
||||
>>> template.use = 'medico'
|
||||
>>> template.reference_category = reference_category
|
||||
>>> template.save()
|
||||
>>> len(template.k_pattern_list)
|
||||
1
|
||||
>>> product, = template.products
|
||||
>>> product.name
|
||||
'UNIDAD REFRACCION ESTANDAR'
|
||||
|
||||
Create Product Maintenance Service::
|
||||
>>> maintenanceServiceProduct = ProductTemplate()
|
||||
>>> maintenanceServiceProduct.name = 'Mantenimiento Correctivo'
|
||||
>>> maintenanceServiceProduct.maintenance_activity = True
|
||||
>>> maintenanceServiceProduct.default_uom = unit
|
||||
>>> maintenanceServiceProduct.type = 'service'
|
||||
>>> maintenanceServiceProduct.salable = True
|
||||
>>> maintenanceServiceProduct.purchasable = True
|
||||
>>> maintenanceServiceProduct.list_price = Decimal('10')
|
||||
>>> maintenanceServiceProduct.account_category = optical_equitment_category_tax
|
||||
>>> maintenanceServiceProduct.save()
|
||||
>>> product1, = maintenanceServiceProduct.products
|
||||
>>> product1.name
|
||||
'Mantenimiento Correctivo'
|
||||
|
||||
|
||||
Create payment term::
|
||||
>>> payment_term = create_payment_term()
|
||||
>>> payment_term.save()
|
||||
|
||||
Purchase 5 products:
|
||||
>>> Purchase = Model.get('purchase.purchase')
|
||||
>>> PurchaseLine = Model.get('purchase.line')
|
||||
>>> purchase = Purchase()
|
||||
>>> purchase.party = supplier
|
||||
>>> purchase.payment_term = payment_term
|
||||
>>> purchase.invoice_method = 'order'
|
||||
>>> purchase_line = PurchaseLine()
|
||||
>>> purchase.lines.append(purchase_line)
|
||||
>>> purchase_line.product = product
|
||||
>>> purchase_line.quantity = 2.0
|
||||
>>> purchase_line.product_equipment
|
||||
True
|
||||
>>> purchase_line.unit_price = Decimal('6182237.0000')
|
||||
>>> purchase_line.health_register = 'COL123evergreen'
|
||||
>>> purchase.click('quote')
|
||||
>>> purchase.click('confirm')
|
||||
>>> purchase.click('create_equipments')
|
||||
>>> Equipment = Model.get('optical_equipment.equipment')
|
||||
>>> equipments = Equipment.find()
|
||||
>>> equipments
|
||||
[proteus.Model.get('optical_equipment.equipment')(1), proteus.Model.get('optical_equipment.equipment')(2)]
|
||||
>>> len(equipments)
|
||||
2
|
||||
>>> purchase.equipment_create
|
||||
1
|
||||
|
||||
Finalize the purchase inventory movements::
|
||||
>>> for move in purchase.moves:
|
||||
... move.click('do')
|
||||
|
||||
Registred equipment without serial::
|
||||
>>> equipment_1 = equipments[0]
|
||||
>>> equipment_2 = equipments[1]
|
||||
>>> equipment_1.click('registred') # doctest: +IGNORE_EXCEPTION_DETAIL
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
UserError: ...
|
||||
>>> equipment_1.serial = "2020DM-0021167"
|
||||
>>> equipment_1.click('registred')
|
||||
>>> equipment_2.serial = "2020DM-002119"
|
||||
>>> equipment_2.click('registred')
|
||||
|
||||
First sale::
|
||||
>>> Sale = Model.get('sale.sale')
|
||||
>>> SaleLine = Model.get('sale.line')
|
||||
>>> sale = Sale()
|
||||
>>> sale.party = customer_optica
|
||||
>>> sale.contact = local_phone
|
||||
>>> sale.description = 'El producto se debe entregar el fin de semana'
|
||||
>>> sale.sale_date = today
|
||||
>>> sale.sale_type = 'equipments'
|
||||
>>> sale.payment_term = payment_term
|
||||
>>> sale.invoice_method = 'order'
|
||||
>>> sale_line = SaleLine()
|
||||
>>> sale.lines.append(sale_line)
|
||||
>>> sale_line.product = product
|
||||
>>> sale_line.quantity = 2.0
|
||||
>>> sale_line = SaleLine()
|
||||
>>> sale.lines.append(sale_line)
|
||||
>>> sale_line.type = 'comment'
|
||||
>>> sale_line.description = 'Comment'
|
||||
>>> sale_line = SaleLine()
|
||||
>>> sale.lines.append(sale_line)
|
||||
>>> sale_line.product = product
|
||||
>>> sale_line.quantity = 3.0
|
||||
>>> sale.click('quote')
|
||||
>>> SaleConfirmDate = sale.click('confirm')
|
||||
>>> SaleConfirmDate.form.sale_date == today
|
||||
True
|
||||
>>> SaleConfirmDate.execute('confirm_date')
|
||||
>>> sale.state
|
||||
'processing'
|
||||
>>> sale.shipments
|
||||
[proteus.Model.get('stock.shipment.out')(1)]
|
||||
|
||||
Duplicate Sale::
|
||||
>>> sale.duplicate()
|
||||
[proteus.Model.get('sale.sale')(2)]
|
||||
|
||||
Return Sale::
|
||||
>>> SaleReturn = Wizard('sale.return_sale', [sale])
|
||||
>>> SaleReturn.execute('return_')
|
||||
|
||||
Verify that the sale state could be returned to the draft state::
|
||||
>>> sale.click("draft")
|
||||
>>> sale.state
|
||||
'draft'
|
||||
>>> sale_line = SaleLine()
|
||||
>>> sale.lines.append(sale_line)
|
||||
>>> sale_line.product = product
|
||||
>>> sale_line.quantity = 2.0
|
||||
>>> sale.click('quote')
|
||||
>>> SaleConfirmDate = sale.click('confirm')
|
||||
>>> SaleConfirmDate.execute('confirm_date')
|
||||
>>> sale.shipments
|
||||
[proteus.Model.get('stock.shipment.out')(1), proteus.Model.get('stock.shipment.out')(2)]
|
||||
|
||||
Verify that the shipment cannot be assigned if the shipment lines do not have equipment::
|
||||
>>> shipment_one = sale.shipments[0]
|
||||
>>> shipment_one.click('pick') # doctest: +IGNORE_EXCEPTION_DETAIL
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValidationError: ...
|
||||
|
||||
Restrict assignment when the shipment has no serialized items::
|
||||
>>> shipment_one = sale.shipments[0]
|
||||
>>> line_one = shipment_one.inventory_moves[0]
|
||||
>>> line_one.equipment = equipment_1
|
||||
>>> line_one.equipment_serial
|
||||
'2020DM-0021167'
|
||||
>>> line_two = shipment_one.inventory_moves[1]
|
||||
>>> line_two.equipment = equipment_2
|
||||
>>> line_two.equipment_serial
|
||||
'2020DM-002119'
|
||||
>>> shipment_one.click('assign_try')
|
||||
>>> shipment_one.click('pick')
|
||||
>>> shipment_one.click('pack')
|
||||
>>> shipment_one.click('done')
|
||||
|
||||
Create a new Maintenance Service::
|
||||
>>> shipment_one.click('maintenance_initial')
|
||||
>>> MantenanceServices = Model.get("optical_equipment_maintenance.service")
|
||||
>>> mantenanceServices, = MantenanceServices.find()
|
||||
>>> mantenanceServices
|
||||
proteus.Model.get('optical_equipment_maintenance.service')(1)
|
||||
>>> mantenanceServices.state
|
||||
'draft'
|
||||
|
||||
>>> MaintenanceLines = Model.get("optical_equipment.maintenance")
|
||||
>>> maintenanceLines = MaintenanceLines.find()
|
||||
>>> maintenanceLines
|
||||
[proteus.Model.get('optical_equipment.maintenance')(1), proteus.Model.get('optical_equipment.maintenance')(2)]
|
||||
>>> maintenanceLines[0].state
|
||||
'draft'
|
||||
|
||||
>>> maintenance_1 = maintenanceLines[0]
|
||||
>>> maintenance_2 = maintenanceLines[1]
|
||||
>>> maintenance_1.equipment.state
|
||||
'uncontrated'
|
||||
>>> maintenance_1.equipment.propietary == customer_optica
|
||||
True
|
||||
>>> maintenance_1.equipment.propietary_address.street
|
||||
|
||||
>>> maintenance_2.equipment.state
|
||||
'uncontrated'
|
||||
>>> maintenance_2.equipment.propietary == customer_optica
|
||||
True
|
||||
>>> maintenance_2.equipment.propietary_address.street
|
||||
|
||||
Assing schedule to maintenance service::
|
||||
>>> AssingSchedule = Wizard('optical_equipment_maintenance.assing_agended', [mantenanceServices])
|
||||
>>> AssingSchedule.form.estimated_agended = datetime.datetime.now()
|
||||
>>> AssingSchedule.form.technical = employee
|
||||
>>> AssingSchedule.execute('assing_agended')
|
||||
|
||||
>>> mantenanceServices.state
|
||||
'agended'
|
||||
|
||||
>>> mantenanceServices.click('in_progress')
|
||||
>>> mantenanceServices.state
|
||||
'in_progress'
|
||||
|
||||
>>> mantenanceServices.lines
|
||||
[proteus.Model.get('optical_equipment.maintenance')(1), proteus.Model.get('optical_equipment.maintenance')(2)]
|
||||
|
||||
Calibrate Maintenance Lines::
|
||||
>>> mantenance_lines = mantenanceServices.lines
|
||||
>>> mantenance_line_one = mantenance_lines[0]
|
||||
>>> mantenance_line_two = mantenance_lines[1]
|
||||
>>> mantenance_line_one.click('samples')
|
||||
>>> len(mantenance_line_one.lines_calibration)
|
||||
5
|
||||
>>> mantenance_line_one.click('calibrate')
|
||||
>>> mantenance_line_one.calibration_total
|
||||
[proteus.Model.get('optical_equipment.maintenance.calibration')(1)]
|
||||
>>> len(mantenance_line_one.graph_calibration)
|
||||
14857
|
||||
|
||||
>>> mantenance_line_one.click('finished')
|
||||
>>> mantenance_line_one.state
|
||||
'finished'
|
||||
|
||||
Finished Maintenance Service::
|
||||
>>> mantenanceServices.click('finished') # doctest: +IGNORE_EXCEPTION_DETAIL
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValidationError: ...
|
||||
|
||||
>>> mantenance_line_two.click('samples')
|
||||
>>> len(mantenance_line_two.lines_calibration)
|
||||
5
|
||||
>>> mantenance_line_two.click('calibrate')
|
||||
>>> mantenance_line_two.calibration_total
|
||||
[proteus.Model.get('optical_equipment.maintenance.calibration')(2)]
|
||||
>>> len(mantenance_line_two.graph_calibration)
|
||||
14857
|
||||
>>> mantenance_line_two.click('finished')
|
||||
>>> mantenanceServices.click('finished')
|
||||
>>> mantenanceServices.state
|
||||
'finished'
|
||||
|
||||
Create a New Contract::
|
||||
|
||||
|
||||
Sale Maintenance Service::
|
||||
>>> sale2 = Sale()
|
||||
>>> sale2.party = customer_optica
|
||||
>>> sale2.contact = local_phone
|
||||
>>> sale2.description = 'El producto se debe entregar el fin de semana'
|
||||
>>> sale2.sale_date = today
|
||||
>>> sale2.sale_type = 'maintenance'
|
||||
>>> sale2.maintenance_type = 'corrective'
|
||||
>>> sale2.payment_term = payment_term
|
||||
>>> sale2.invoice_method = 'order'
|
||||
>>> sale_line = SaleLine()
|
||||
>>> sale2.lines.append(sale_line)
|
||||
>>> sale_line.product = product1
|
||||
>>> sale_line.quantity = 1.0
|
||||
>>> sale2.click('quote')
|
||||
>>> SaleConfirmDate = sale2.click('confirm')
|
||||
>>> SaleConfirmDate.form.sale_date == today
|
||||
True
|
||||
>>> SaleConfirmDate.execute('confirm_date')
|
||||
>>> sale2.state
|
||||
'processing'
|
||||
>>> sale2.shipments
|
||||
[]
|
||||
@@ -1,8 +0,0 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.tests.test_tryton import load_doc_tests
|
||||
|
||||
|
||||
def load_tests(*args, **kwargs):
|
||||
return load_doc_tests(__name__, __file__, *args, **kwargs)
|
||||
@@ -1,5 +1,5 @@
|
||||
[tryton]
|
||||
version=7.0.0
|
||||
version=6.8.0
|
||||
depends:
|
||||
ir
|
||||
company
|
||||
@@ -28,4 +28,3 @@ xml:
|
||||
sale.xml
|
||||
balance_sale_party.xml
|
||||
shipment.xml
|
||||
messages.xml
|
||||
@@ -2,7 +2,7 @@
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<!-- <xpath expr="//field[@name='street']" position="replace"> -->
|
||||
<!-- <field name="street" expand="1"/> -->
|
||||
<!-- </xpath> -->
|
||||
<xpath expr="//field[@name='street']" position="replace">
|
||||
<field name="street" expand="1"/>
|
||||
</xpath>
|
||||
</data>
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<form>
|
||||
<label name="diopter"/>
|
||||
<field name="diopter"/>
|
||||
<label name="dev_std"/>
|
||||
<field name="dev_std"/>
|
||||
<label name="uncertain_type_A"/>
|
||||
<field name="uncertain_type_A"/>
|
||||
<label name="uncertain_pattern"/>
|
||||
<field name="uncertain_pattern"/>
|
||||
<label name="k_c_calibration"/>
|
||||
<field name="k_c_calibration"/>
|
||||
<label name="uncertain_U_b1"/>
|
||||
<field name="uncertain_U_b1"/>
|
||||
<label name="d_resolution"/>
|
||||
<field name="d_resolution"/>
|
||||
<label name="uncertain_U_b2_dig"/>
|
||||
<field name="uncertain_U_b2_dig"/>
|
||||
<label name="uncertain_U_b2_ana"/>
|
||||
<field name="uncertain_U_b2_ana"/>
|
||||
<label name="uncertain_combinated"/>
|
||||
<field name="uncertain_combinated"/>
|
||||
<label name="uncertain_eff"/>
|
||||
<field name="uncertain_eff"/>
|
||||
<label name="t_student"/>
|
||||
<field name="t_student"/>
|
||||
<label name="uncertain_expanded"/>
|
||||
<field name="uncertain_expanded"/>
|
||||
<label name="graph_dates"/>
|
||||
<field name="graph_dates"/>
|
||||
<label name="state"/>
|
||||
<field name="state"/>
|
||||
</form>
|
||||
@@ -33,8 +33,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="history_equipments"/>
|
||||
</page>
|
||||
<page string="Other Info" id="other">
|
||||
<!-- <label name="company"/> -->
|
||||
<!-- <field name="company"/> -->
|
||||
<label name="company"/>
|
||||
<field name="company"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<label name="price_contract"/>
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<form>
|
||||
<!-- <xpath expr="/form/field[@name='maintenance_type']" position="after"> -->
|
||||
<!-- <label name="equipment"/> -->
|
||||
<!-- <field name="equipment"/> -->
|
||||
<!-- </xpath> -->
|
||||
<data>
|
||||
<xpath expr="/form/field[@name='maintenance_type']" position="after">
|
||||
<label name="equipment"/>
|
||||
<field name="equipment"/>
|
||||
</form>
|
||||
</xpath>
|
||||
</data>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<group colspan="6" yexpand="1" id="lines_calibration">
|
||||
<field name="lines_calibration"/>
|
||||
<newline/>
|
||||
<field name="calibration_total" view_ids="optical_equipment.calibration_total_view_tree,optical_equipment.calibration_total_view_form"/>
|
||||
<field name="calibration_total"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Graph" id="graph">
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="//field[@name='name']" position="after">
|
||||
<field name="attributes_name" expand="1"/>
|
||||
</xpath>
|
||||
</data>
|
||||
@@ -8,7 +8,7 @@
|
||||
<xpath expr="//field[@name='number']" position="replace">
|
||||
<field name="number"/>
|
||||
</xpath>
|
||||
<!-- <xpath expr="//field[@name='untaxed_amount']" position="after"> -->
|
||||
<!-- <field name="residual_amount"/> -->
|
||||
<!-- </xpath> -->
|
||||
<xpath expr="//field[@name='untaxed_amount']" position="after">
|
||||
<field name="residual_amount"/>
|
||||
</xpath>
|
||||
</data>
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/form/notebook/page[@id='general']/group[@id='checkboxes']"
|
||||
position="inside">
|
||||
<xpath expr="/form/notebook/page[@id='general']/group[@id='checkboxes']" position="inside">
|
||||
<newline/>
|
||||
<label name="equipment"/>
|
||||
<field name="equipment"/>
|
||||
<label name="replacement"/>
|
||||
<field name="replacement"/>
|
||||
<newline/>
|
||||
<label name="maintenance_activity"/>
|
||||
<field name="maintenance_activity"/>
|
||||
</xpath>
|
||||
@@ -112,7 +113,7 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="check_calibration"/>
|
||||
|
||||
<newline/>
|
||||
<separator name="preventive_activities" colspan="4"/>
|
||||
<separator name="preventive" colspan="4"/>
|
||||
<label name="preventive_activities"/>
|
||||
<field name="preventive_activities" colspan="3"/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user