267 Commits
7.0 ... 6.2

Author SHA1 Message Date
cb4a4f3cbe Merge branch '6.2' of https://gitea.onecluster.org/OneTeam/trytondo-optical_equipment into 6.2 2023-03-21 02:36:44 -05:00
c764466384 add CompanyReport 2023-03-21 02:35:12 -05:00
bd2ae1a13a change field states lines 2023-03-09 15:36:35 +00:00
b251ee70f4 add states fields in contract 2023-03-06 19:31:11 +00:00
40d90d7370 add method copy to purchase 2023-03-06 15:33:49 +00:00
752057c5a7 Merge branch '6.2' of https://gitea.onecluster.org/OneTeam/trytondo-optical_equipment into 6.2 2023-02-27 10:48:47 -05:00
42b2438fa0 add payments, quote_number in sale 2023-02-27 10:46:56 -05:00
cbcc2d0077 return sale 2023-02-22 16:46:47 +00:00
5dd4826e1d update range axis X in graph 2023-02-13 07:46:33 -05:00
aff9915942 update Delivery Certificated 2023-01-27 15:46:11 -05:00
b0de46cb68 update button maintenance_inicial 2023-01-27 15:40:11 -05:00
2f998cf7f0 update optical_equipment 2023-01-27 15:10:43 -05:00
11c93fc6b6 update optical_equipment 2023-01-27 15:09:16 -05:00
b5cb5eac76 uncomment library scipy 2023-01-24 12:59:27 -05:00
36f3d1d731 add group attributes to purchase 2023-01-12 09:58:43 -05:00
79ee2e0e7e update traslations 2023-01-11 21:02:27 -05:00
85b8d3028e add change propietary in maintenance service 2023-01-11 20:16:14 -05:00
56f9eb92a0 add change propietary in maintenance service 2023-01-11 20:16:01 -05:00
739032bd8e change of state agended 2023-01-11 15:52:08 -05:00
25f2b90809 Update Sale report 2023-01-11 14:24:51 -05:00
2ee3d9fb74 closed #96 2023-01-11 14:11:46 -05:00
f1a158d5e9 update traslations of reports 2022-12-21 17:41:16 -05:00
56b90c5d22 activities maintenance in button maintenance_initial 2022-12-21 13:20:56 -05:00
f9b4cf621d update button draft in equipments 2022-12-20 20:34:23 +00:00
446e4df3e0 update reports 2022-12-20 15:18:26 -05:00
5541e06c19 update reports 2022-12-20 15:07:52 -05:00
318e8b1369 update reports 2022-12-20 14:58:11 -05:00
7dfb7ca8ea update reports 2022-12-20 14:48:46 -05:00
125239adf7 update reports 2022-12-20 14:34:01 -05:00
667a32c35d Service maintenance state finished 2022-12-19 18:16:02 -05:00
b9aa95516d Default environmental conditions in the initial button of customer delivery notes 2022-12-19 18:08:12 -05:00
1a13fbfa98 Predetermined environmental conditions in maintenance service 2022-12-16 13:15:14 -05:00
d0ff946f8e update reports 2022-12-15 12:14:46 -05:00
96ba378c57 Maintenance Activities add Template Product 2022-12-14 19:32:14 -05:00
ac426e48d6 update optical_equipment 2022-12-14 19:07:25 +00:00
d7ff8ac268 Add button Generate Samples 2022-12-12 11:53:38 -05:00
5b8f627652 update optical_equipment 2022-12-12 12:01:03 -05:00
1e04245079 update optical equipment 2022-12-12 16:21:15 +00:00
e5025a901a update optical_equipment 2022-12-12 10:52:39 -05:00
6d5a6f1d14 update optical_equipment 2022-12-12 15:27:37 +00:00
e718afff36 update optical_equipment 2022-12-06 16:06:33 -05:00
96c06074e5 update optical equipment 2022-12-06 17:29:36 +00:00
5ba64c4747 update optical equipment 2022-12-05 17:12:32 -05:00
68289a1138 update optical_equipment 2022-12-01 01:38:29 -05:00
3f86f2d249 update optical_equipment 2022-12-01 01:34:53 -05:00
52bc550098 add report sale_internal 2022-12-01 00:01:20 -05:00
88b413eec9 change propietary cross-equipment 2022-11-30 22:35:13 -05:00
d44f213d18 change propietary cross-equipment 2022-11-30 22:32:54 -05:00
6274e72221 change propietary cross-propietary 2022-12-01 02:52:23 +00:00
4df3df99aa update optical_equipment 2022-11-27 02:03:42 -05:00
ad7d55670f update optical_equipment 2022-11-27 06:01:36 +00:00
8bede84e96 add domains in calibrations 2022-11-27 00:44:19 -05:00
ca72657c69 update value_patterns 2022-11-27 01:15:14 +00:00
2bf28c7bea update optical_equipment 2022-11-23 16:35:32 -05:00
0d4621eddf update optical_equipment 2022-11-23 16:24:43 -05:00
4e24263784 update reports 2022-11-23 15:26:26 -05:00
8a5bdef142 update reports 2022-11-23 15:22:58 -05:00
29ebdfcfaa update optical_equipment 2022-11-23 20:13:53 +00:00
d24c3751ff update optical_equipment 2022-11-21 00:24:14 -05:00
244979e7b0 Update error 2022-11-20 21:45:16 -05:00
f1ab596006 Update report cv_equipment 2022-11-20 21:27:33 -05:00
0d431be4fc update types risk 2022-11-21 00:43:25 +00:00
2e0a0d725c update cv equipment 2022-11-18 15:21:25 -05:00
3463ddf1ca update cv equipment 2022-11-18 15:16:52 -05:00
b639aaee28 update cv equipment 2022-11-18 15:12:40 -05:00
749a52332a update certificated calibration 2022-11-18 14:42:34 -05:00
462ecdbb4f update certificated calibration 2022-11-18 14:35:54 -05:00
2ffcca013b update type measuring_range 2022-11-18 19:24:34 +00:00
c61b422cbc update certificated calibration 2022-11-18 13:58:37 -05:00
2b312d787d update optical_equipment 2022-11-18 13:51:06 -05:00
42965ff680 update optical_equipment 2022-11-18 13:50:53 -05:00
c32c506346 add attributes group to saleline 2022-11-15 12:48:30 -05:00
f88612dfa1 add attributes group to saleline 2022-11-15 12:48:22 -05:00
9c36d6663d add report maintenance timeline closed #94 2022-11-10 15:50:20 -05:00
0b33a1c2c3 corrections to sales 2022-11-10 13:38:33 -05:00
df4bca7485 corrections to sales 2022-11-10 13:37:15 -05:00
6929fec5ec enviromental conditions in calibration 2022-11-09 16:33:30 -05:00
1ac2816f39 update calibration 2022-11-09 13:11:53 -05:00
34e71ade15 update calibration 2022-11-09 11:30:42 -05:00
ebf7d7fc99 update calibratio 2022-11-09 09:57:48 -05:00
8f3c07a69d health register required in purchase 2022-11-09 09:19:59 -05:00
c0e3024e46 health register required in purchase 2022-11-09 09:14:25 -05:00
b1ff95cf27 correction paths of reports 2022-11-08 22:17:01 -05:00
446df7a69e correction paths of reports 2022-11-08 22:14:07 -05:00
4e026a1422 update graph 2022-11-08 21:27:53 -05:00
4d9e352611 update graph 2022-11-08 16:16:52 -05:00
8b93ae13e0 update graph 2022-11-08 16:15:01 -05:00
12f66e35bb update graph 2022-11-08 15:49:45 -05:00
3bdb22d3f6 update graph 2022-11-08 15:20:45 -05:00
2de04793cc add report prorrogation 2022-11-08 14:59:00 -05:00
b9c222c642 add report prorrogation 2022-11-08 14:58:51 -05:00
4dd0c83e5e add report 2022-11-08 08:37:13 -05:00
62309d5095 update maintenance 2022-11-03 16:14:55 -05:00
836ee474a6 modification to reports 2022-11-02 18:20:52 -05:00
e2ff22223c modification to reports 2022-11-02 18:16:13 -05:00
9355cb73d1 mistake 0 2022-11-02 09:28:24 -05:00
196a5a90cc mean in calibration total 2022-11-01 16:01:28 -05:00
f9be62649a update report calibration 2022-10-31 18:25:13 -05:00
8a6e334223 add reports 2022-10-31 12:14:04 -05:00
bd26902a9e clean home 2022-10-29 12:24:18 -05:00
bca233fa37 add graphs to calibration 2022-10-28 16:24:50 -05:00
b31e9f39f7 Merge branch '6.2' of https://gitea.onecluster.org/OneTeam/trytondo-optical_equipment into 6.2 2022-10-28 16:24:20 -05:00
92d92d4c50 add graphs to calibration 2022-10-28 16:21:40 -05:00
4f18a39a96 Change field contact sale 2022-10-27 15:28:42 -05:00
b64c897618 Reports sale and maintenance_service 2022-10-20 23:31:33 -05:00
587ff4094f cambios finales 2022-10-19 20:51:14 -05:00
16d5ee6df5 Traducciones Faltantes 2022-10-19 16:56:25 -05:00
d69e4b141a change to location of equipments 2022-10-18 10:40:09 -05:00
bcfb207a30 Correction to field date in ssing agended 2022-10-18 09:49:11 -05:00
6a9711a919 change name report 2022-10-14 16:33:57 +00:00
d1fc0872f0 add reports maintenance history 2022-10-14 11:32:00 -05:00
3ad449f466 changes finished 2022-10-14 16:29:33 +00:00
534f89486d changes finished 2022-10-14 16:27:31 +00:00
89cdad5101 resports finished 2022-10-13 11:51:45 -05:00
9f352bbd63 Merge branch '6.2' of https://gitea.onecluster.org/OneTeam/trytondo-optical_equipment into 6.2 2022-10-13 11:50:15 -05:00
bc8dc103ed resports finished 2022-10-13 11:48:41 -05:00
a6a400017a changes finished reports 2022-10-13 16:40:58 +00:00
c6486b2243 add reports 2022-10-12 17:40:41 -05:00
16dedba779 add reports 2022-10-12 17:40:08 -05:00
253500af41 add rec_names 2022-10-12 12:17:58 -05:00
ae62a07fe1 add report calibration 2022-10-11 18:19:20 -05:00
517cc3a58e Add the diopter field 2022-10-11 18:11:29 -05:00
13cc3b6e3e changes finished 2022-10-11 16:54:47 -05:00
9a9a0eecff add report calibration 2022-10-11 16:08:41 -05:00
917e820b37 add report calibration 2022-10-11 16:04:54 -05:00
ecde79d84d add report calibration 2022-10-11 14:21:06 -05:00
3535043b99 add formats and reports 2022-10-11 13:22:36 -05:00
9d8c526aeb add formats and reports 2022-10-11 13:22:26 -05:00
a442f1d098 changes finished 2022-10-10 18:50:13 -05:00
01f3e58c7e changes finished 2022-10-10 18:49:56 -05:00
a3ef82f4d1 add traslations 2022-10-10 09:59:35 -05:00
9493d39b9f changes finished 2022-10-06 21:19:48 -05:00
221c887cb6 changes finished 2022-10-06 00:26:24 -05:00
4767cc94c7 changes finished 2022-10-05 18:39:23 -05:00
e47594fb10 changes finished 2022-10-05 18:37:22 -05:00
739440efb9 correction to direction model calendar 2022-10-05 13:56:04 -05:00
41d44b4956 changes finished 2022-10-05 10:48:45 -05:00
927e6c060d calibration 2022-10-04 01:44:23 -05:00
a1b4cc5616 calibration 2022-10-04 01:44:02 -05:00
e630edb389 management maintenances services, maintenances, agended 2022-09-27 11:30:21 -05:00
87a843754d create model maintenance_service 2022-09-23 12:05:03 -05:00
9736b1baf3 create model maintenance_service 2022-09-23 11:03:47 -05:00
8cd2cf17bf correction to module contracts 2022-09-21 09:24:00 -05:00
86b6bef61d corrections to relations many2many 2022-09-20 11:00:02 -05:00
d1940a271d add class contract - equipment 2022-09-19 18:34:22 -05:00
20a0df5c50 corrections to module contracts 2022-09-19 07:59:01 -05:00
50dc5aa2b0 module contracts 2022-09-19 00:41:50 -05:00
4d09b42324 add traductions modules contracts 2022-09-18 01:23:12 -05:00
9b09080ae8 add wizard for contract management and creation of model contracts maangement 2022-09-16 14:50:05 -05:00
0c88126ae8 Create Traductions module subscriptions 2022-09-13 14:01:12 -05:00
206bad122b modification to report contract.fodt 2022-09-12 14:41:36 -05:00
7c7db3a3c0 add report contract 2022-09-12 13:21:08 -05:00
e9f288bfbd modifity to wizzard 'CreateSubscriptionInvoice' 2022-09-07 14:13:26 -05:00
6a3ce61e06 model of move 2022-09-02 13:24:59 -05:00
f1e0d9b274 update format cv Equipment 2022-08-23 10:47:43 -05:00
113de78608 changes pending 2022-08-19 11:44:18 -05:00
ef5154ed6f changes pending 2022-08-19 10:31:39 -05:00
785d8890f2 correction to format sheet out 2022-08-15 18:47:05 -05:00
55bef63e37 traslate pending 2022-08-15 14:31:38 -05:00
b19e096c94 traslate pending 2022-08-15 13:27:37 -05:00
61473998d2 only one quantity for sale 2022-08-15 00:10:20 -05:00
46ad43845f add format shipment equipments 2022-08-14 13:12:58 -05:00
9e73d4ec09 shipment equipments 2022-08-14 11:16:13 -05:00
c4151da4f2 changes in cv of equipment 2022-08-13 00:46:47 -05:00
f056418573 states in serial tree 2022-08-12 22:32:21 -05:00
c678e72f4a add traductions to module equipments 2022-08-12 17:35:20 -05:00
1d302cc485 Traducciones al módulo de equipos 2022-08-12 09:58:37 -05:00
7bf05f4857 changes to equipments 2022-08-10 23:16:03 -05:00
33f3cdc5ef template cv of equipment 2022-08-10 21:46:00 -05:00
a8ce002f4f correction errors 2022-08-10 18:08:58 -05:00
da07c0eee0 add report equipment to equipment 2022-08-10 16:57:46 -05:00
9bdee108ac add report equipment to equipment 2022-08-10 16:57:31 -05:00
054b78fd01 value for default 0 in fields of equipment 2022-08-10 09:38:54 -05:00
b7976c2b04 module subscriptions 2022-08-06 10:10:14 -05:00
9981598350 init model calibrations 2022-08-03 16:21:55 -05:00
5c857d8a9e changes de state and propietary of equipment 2022-08-03 13:14:15 -05:00
3c3e38e7fa fields change product in purchase 2022-08-02 21:28:03 -05:00
f7740e3827 fields empy when change product in purchase 2022-08-02 20:42:13 -05:00
b657f5cd4d correction to assigned serial 2022-08-02 19:37:32 -05:00
5566df2b5d relation maintenances to equipment 2022-08-02 00:37:47 -05:00
e234737535 add function for search of equipments 2022-07-30 19:05:41 -05:00
35a5d217ac entry of serial and button registred 2022-07-28 09:37:31 -05:00
af32d1c9fb view invisible in 'features' and 'calibration' 2022-07-26 21:23:12 -05:00
720710e094 change traslate 'enviromental conditions' 2022-07-26 19:33:04 -05:00
5d88267435 change required resolution 2022-07-26 19:29:55 -05:00
8fad2a7cf3 correction to module products 2022-07-26 19:21:12 -05:00
40204302f4 del states in serial for view tree edit serial 2022-07-26 16:17:48 -05:00
7e7ce08625 add file views add serials 2022-07-26 15:50:05 -05:00
f802a9c3e5 commits pendientes 2022-07-24 22:50:56 -05:00
6bca322af8 maintenance frequency in equipments 2022-07-23 13:33:17 -05:00
ebf2dd372e view asigned serials 2022-07-22 16:13:54 -05:00
569db4ba4b changes menores 2022-07-21 17:14:54 -05:00
35ea0a037c delete constraint serial unique 2022-07-21 12:56:33 -05:00
42218f5f06 delete sequence_serial in line_purchase 2022-07-21 12:52:09 -05:00
a0fbc157ff delete serial draft 2022-07-21 12:46:56 -05:00
c056bbc38a sequence draft serial, add multiple equipments 2022-07-21 02:47:05 -05:00
f08e0a0f83 traductions module products 2022-07-20 22:09:59 -05:00
40846ec28b traductions module products 2022-07-20 22:09:29 -05:00
8400110fdb button 'create equipment' invisible when purchase not has invoice 2022-07-19 12:54:30 -05:00
209a2083b3 correction to bugs and add complete behaviors 2022-07-18 23:19:17 -05:00
8e173c4758 activitys of maintenance 2022-07-18 13:36:20 -05:00
50f6249562 tabs in maintenance 2022-07-18 12:52:18 -05:00
610106befe add field maintenance type 2022-07-18 09:36:19 -05:00
11473f11ba add function _equipment_to_subscription to wizard create_subscription 2022-07-16 11:30:04 -05:00
41ec228407 wizard 'create equipments' 2022-07-14 21:09:07 -05:00
4d02d61639 registred class diary in __init__ 2022-07-14 11:35:48 -05:00
103b9d89ba create model diary 2022-07-14 11:32:43 -05:00
04d7041be7 delete view address_equipment 2022-07-14 11:20:58 -05:00
a5c58d104e add maintenance_lines 2022-07-13 13:00:11 -05:00
97a1f77fbc add atribute template of product 'replacement' and 'maintenance_activity' 2022-07-13 12:33:23 -05:00
6ee312bb2e correction to workflow on maintenance 2022-07-13 09:53:18 -05:00
e26d7e50d6 model 'maintenance' 2022-07-12 17:19:08 -05:00
5b652cb2ac init model 'Maintenance' 2022-07-12 12:28:49 -05:00
3d14ee5dc0 add lines to subcription 2022-07-12 11:54:19 -05:00
76513e61c1 address_equipment for default in line the sale 2022-07-12 09:02:37 -05:00
65770b97c7 add default_shipment_address 2022-07-11 16:18:53 -05:00
9aa5fad86b add field 'equipment' which contains the relation with 'optical_equipment.equipment' 2022-07-11 14:53:42 -05:00
9bb6f4066c add field 'equipment' which contains the relation with 'optical_equipment.equipment' 2022-07-11 14:46:21 -05:00
425c7e225a _do_create_subscription wizard 'create_subscription' 2022-07-09 00:13:59 -05:00
d453653bfc create view 'sale.create.subscription' 2022-07-08 07:11:24 -05:00
f14684b403 add view 2022-07-08 06:00:35 -05:00
a8ba3f056c initial model for wizard 'create_subscription' 2022-07-07 18:10:19 -05:00
a9f20c356f domain of values in template the equipment 2022-07-07 11:54:26 -05:00
db126e496e charge company for default in equipment 2022-07-07 11:04:56 -05:00
ffaed5fe49 sequence in equipments 2022-07-07 10:53:15 -05:00
0fe894d10f add workflow to equipments 2022-07-07 00:16:16 -05:00
8910886374 correction 2022-07-05 11:43:58 -05:00
8ec9c4c130 corrections 2022-07-05 10:36:21 -05:00
e00a5415ef change position field 'equipments create' 2022-07-04 16:31:10 -05:00
93a409daf6 change values in line of purchase if change product o not product 2022-07-04 16:24:40 -05:00
5e820d5670 model sequence equipments 2022-07-04 15:52:07 -05:00
6883d20a7d model sequence equipments 2022-07-04 15:51:08 -05:00
1a9b979e3b Add groups admin to menu 'menu_equipment' 2022-07-04 15:06:05 -05:00
2cc22349e2 add views to model 'optical_equipment.configuration' 2022-07-04 14:49:08 -05:00
609cf1e386 create model 'configuration_equipment' 2022-07-04 11:52:07 -05:00
47743f378e correct name variable 2022-07-04 11:39:40 -05:00
2f92c8f74b change name 'equipment_available' to 'equipment_create' 2022-07-04 11:37:57 -05:00
8cc60e6540 changes position 'useful_life' and 'warranty' 2022-07-04 11:33:32 -05:00
d0ab043193 values for default fields _uom 2022-07-04 11:20:40 -05:00
1e03f2e213 measurements default in product 2022-07-03 09:23:35 -05:00
553e3bf668 add value 'otro' type_client28 2022-07-03 08:33:14 -05:00
9756cea8c1 add value 'otro' type_client#28 2022-07-03 08:30:23 -05:00
0931aa7727 tab 'equipment' in sale invisible with product 2022-07-01 00:14:59 -05:00
0566d0d66f exclude categorys 'accounting' equal True 2022-06-30 22:58:30 -05:00
a99a70fd1d add message.xml to tryton.cfg 2022-06-30 22:13:16 -05:00
b432c75314 add constrain a serial unique 2022-06-30 17:46:13 -05:00
a9876fada4 views 2022-06-30 13:00:56 -05:00
f0f76ca652 add domains to fields 2022-06-30 12:32:41 -05:00
141cb90ead modification to template of products 2022-06-30 11:21:37 -05:00
98b33d8b8c tab 'equipment invisible in line of purchase when product is 'equipment' 2022-06-30 09:32:01 -05:00
b23e83eb25 add field address for default of the company to equipment in purchase 2022-06-30 08:26:53 -05:00
93f037923b tab 'equipment' in saleline invisible if product not is a equipment 2022-06-29 15:33:53 -05:00
5058a46c37 tab 'equipment' in purchase invisible if product not is a equipment 2022-06-29 14:33:11 -05:00
274a095b72 button 'create_equipments' invisible in case to 'equipments_availables = True' 2022-06-29 14:13:39 -05:00
887ec2eeaa add view 'create_equipments' and domain on the button 2022-06-29 13:27:23 -05:00
cf34d85596 add button 'create_equipment' 2022-06-29 12:07:11 -05:00
f49769990e field Subscription of 'optical_equipment.equipment' always readonly 2022-06-29 00:57:30 -05:00
7b5cdd61b0 delete model measurements and put in model product 2022-06-28 23:21:54 -05:00
5dce5130ce add measurement 'relative humedity' and domain 2022-06-28 12:34:42 -05:00
5d948b5427 add domain in measurements of equipments 2022-06-28 12:21:10 -05:00
ff34a02dd5 change in class 'Measurements' to 'Template' 2022-06-27 15:43:43 -05:00
87639119e4 add domain in measurements 2022-06-27 14:41:57 -05:00
b61bcce44b add fields 'campus' and 'party_related' 2022-06-27 12:30:12 -05:00
7e2648e114 add model address 2022-06-26 13:31:03 -05:00
5430dc54ee add model address 2022-06-26 13:30:05 -05:00
4818d84db1 change version tryton.cfg '6.2' 2022-06-26 12:18:37 -05:00
cceb3906ba create branch 6.2 add model 'party.address' 2022-06-26 10:56:07 -05:00
100 changed files with 39130 additions and 323 deletions

5
.gitignore vendored
View File

@@ -28,6 +28,11 @@ share/python-wheels/
.installed.cfg .installed.cfg
*.egg *.egg
MANIFEST MANIFEST
GPATH
GRTAGS
GTAGS
# PyInstaller # PyInstaller
# Usually these files are written by a python script from a template # Usually these files are written by a python script from a template

View File

@@ -1,17 +1,56 @@
from trytond.pool import Pool from trytond.pool import Pool
from . import (party, product, purchase, sale, from . import (address, diary, party, product, purchase, sale,
equipment, subscription, measurements) equipment, configuration_equipment, contract, maintenance, move, exceptions)
def register(): def register():
Pool.register( Pool.register(
address.Address,
diary.Diary,
party.Party, party.Party,
product.Template, product.Template,
product.Product, product.Product,
product.Pattern,
purchase.Purchase, purchase.Purchase,
purchase.Line, purchase.Line,
sale.SaleLine,
equipment.OpticalEquipment, equipment.OpticalEquipment,
subscription.Subscription, equipment.EquipmentMaintenance,
subscription.SubscriptionEquipment, equipment.EquipmentParty,
measurements.Measurements, equipment.ChangePropietary,
equipment.ChangeEquipment,
configuration_equipment.Configuration,
maintenance.Calibration,
maintenance.CreateContractInitial,
maintenance.CalibrationSample,
maintenance.Maintenance,
maintenance.MaintenanceService,
maintenance.MaintenanceActivity,
maintenance.MaintenanceLine,
maintenance.AgendedInitial,
maintenance.ReAgended,
maintenance.ServiceMaintenanceAgended,
maintenance.ChangePropietaryMaintenance,
move.Move,
move.ShipmentOut,
move.ShipmentOutReturn,
move.ShipmentInternal,
sale.Sale,
sale.SaleLine,
contract.Contract,
contract.ContractEquipment,
contract.ContractMaintenanceServices,
module='optical_equipment', type_='model') module='optical_equipment', type_='model')
Pool.register(
maintenance.AssingAgended,
maintenance.ReAssingAgended,
maintenance.CreateContract,
maintenance.NewPropietaryMaintenance,
equipment.NewPropietary,
module='optical_equipment', type_='wizard')
Pool.register(
maintenance.CalibrationReport,
maintenance.MaintenanceServiceReport,
contract.ContractReport,
equipment.EquipmentReport,
move.PickingListDeliveryReport,
move.CapacitationReport,
module='optical_equipment', type_='report')

16
account.xml Normal file
View File

@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!--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>
<record model="ir.action.report" id="report_payment">
<field name="name">Pagos</field>
<field name="model">account.move.line</field>
<field name="report_name">account.move.line</field>
<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.move.line,-1</field>
<field name="action" ref="report_payment"/>
</record></tryton>

11
address.py Normal file
View File

@@ -0,0 +1,11 @@
from trytond.pool import PoolMeta
from trytond.model import fields
from trytond.pyson import Eval, If
class Address(metaclass=PoolMeta):
__name__ = 'party.address'
campus = fields.Boolean("Campus")
party_related = fields.Many2One('party.party', "Party Related",
states ={ 'invisible': (~Eval("campus"))})

15
address.xml Normal file
View File

@@ -0,0 +1,15 @@
<?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>
<record model="ir.ui.view" id="address_view_tree">
<field name="model">party.address</field>
<field name="inherit" ref="party.address_view_tree"/>
<field name="name">address_tree</field>
</record>
<record model="ir.ui.view" id="address_view_form">
<field name="model">party.address</field>
<field name="inherit" ref="party.address_view_form"/>
<field name="name">address_form</field>
</record>
</tryton>

View File

View File

@@ -0,0 +1,36 @@
from trytond.model import (
ModelSingleton, ModelSQL, ModelView, fields)
from trytond.pyson import Id
from trytond.modules.company.model import (
CompanyMultiValueMixin, CompanyValueMixin)
class Configuration(ModelSingleton, ModelSQL, ModelView, CompanyMultiValueMixin):
'Equipment Configuration'
__name__='optical_equipment.configuration'
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'))
])

View File

@@ -0,0 +1,33 @@
<?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>
<record model="ir.ui.view" id="optical_equipment_configuration_view_form">
<field name="model">optical_equipment.configuration</field>
<field name="type">form</field>
<field name="name">optical_equipment_configuration_form</field>
</record>
<record model="ir.action.act_window" id="act_optical_equipment_configuration_form">
<field name="name">Configuration</field>
<field name="res_model">optical_equipment.configuration</field>
</record>
<record model="ir.action.act_window.view" id="act_optical_equipment_configuration_form_view1">
<field name="sequence" eval="10"/>
<field name="view" ref="optical_equipment_configuration_view_form"/>
<field name="act_window" ref="act_optical_equipment_configuration_form"/>
</record>
<menuitem
name="Configuration"
parent="menu_equipment"
sequence="0"
id="menu_equipment_configuration"
icon="tryton-settings"/>
<menuitem
parent="menu_equipment_configuration"
action="act_optical_equipment_configuration_form"
sequence="10"
id="menu_optical_equipment_configuration"
icon="tryton-list"/>
</data>
</tryton>

186
contract.py Normal file
View File

@@ -0,0 +1,186 @@
from trytond.pool import Pool, PoolMeta
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, StateTransition, StateView, Wizard)
from trytond.modules.currency.fields import Monetary
from trytond.modules.product import price_digits
import datetime
from datetime import timedelta
class Contract(Workflow, ModelSQL, ModelView):
'Contracts'
__name__ = 'optical_equipment.contract'
_rec_name = 'number'
_order_name = 'number'
company = fields.Many2One(
'company.company', "Company", required=True, select=True,
states={
'readonly': (Eval('state') != 'draft') | Eval('party', True),
},help="Make the subscription belong to the company.")
number = fields.Char(
"Number", readonly=True, select=True,
help="The main identification of the subscription.")
reference = fields.Char(
"Reference", select=True,
help="The identification of an external origin.")
description = fields.Char("Description",
states={
'readonly': Eval('state') != 'draft',
})
party = fields.Many2One(
'party.party', "Party", required=True,
states={
'readonly': (Eval('state') != 'draft') | Eval('party', True),
},help="The party who subscribes.")
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(
Bool(Eval('start_date')),
Eval('start_date', 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'})
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):
super(Contract, cls).__setup__()
cls._order = [
('number', 'DESC NULLS FIRST'),
('id', 'DESC'),
]
cls._transitions = ({
('draft', 'running'),
('running', 'draft'),
('running', 'closed'),
('running', 'cancelled'),
})
cls._buttons.update({
'draft': {'invisible': Eval('state').in_(['draft','closed'])},
'running': {'invisible': Eval('state').in_(['cancelled', 'running'])},
'cancelled': {'invisible': Eval('state').in_(['draft', 'cancelled'])}
})
@staticmethod
def default_company():
return Transaction().context.get('company')
@staticmethod
def default_state():
return 'draft'
@classmethod
def set_number(cls, contracts):
pool = Pool()
Config = pool.get('optical_equipment.configuration')
config = Config(4)
if config.contract_sequence != None:
if not contracts[0].number:
try:
contracts[0].number = config.contract_sequence.get()
cls.save(contracts)
except UserError:
raise UserError(str('Validation Error'))
else:
raise UserError(gettext('optical_equipment.msg_not_sequence_equipment'))
@classmethod
@ModelView.button
@Workflow.transition('draft')
def draft(cls, contracts):
contract = contracts[0]
for equipment in contract.equipments:
equipment.state = "uncontrated"
equipment.contract_history += (contract.id,)
equipment.save()
@classmethod
@ModelView.button
@Workflow.transition('running')
def running(cls, contracts):
contract = contracts[0]
for equipment in contract.equipments:
equipment.state = "contrated"
equipment.contract_history += (contract.id,)
equipment.save()
cls.set_number(contracts)
contract.state='running'
contract.save()
@classmethod
@ModelView.button
@Workflow.transition('cancelled')
def cancelled(cls, contracts):
pass
class ContractMaintenanceServices(ModelSQL):
'Contract - Maintenance Services'
__name__ = 'optical_equipment_maintenance.service-equipment.contract'
maintenance_services = fields.Many2One('optical_equipment_maintenance.service', "Maintenance Service", select=True)
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', select=True)
contract = fields.Many2One('optical_equipment.contract', 'Contract', select=True)
class ContractReport(CompanyReport):
__name__ = 'optical_equipment.contract'
@classmethod
def execute(cls, ids, data):
with Transaction().set_context(address_with_party=True):
return super(ContractReport, cls).execute(ids, data)
@classmethod
def get_context(cls, records, header, data):
pool = Pool()
Date = pool.get('ir.date')
context = super().get_context(records, header, data)
context['today'] = Date.today()
return context

135
contract.xml Normal file
View File

@@ -0,0 +1,135 @@
<?xml version="1.0"?>
<!--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>
<record model="ir.ui.view" id="contract_view_form">
<field name="model">optical_equipment.contract</field>
<field name="type">form</field>
<field name="name">contract_form</field>
</record>
<record model="ir.ui.view" id="contract_view_list">
<field name="model">optical_equipment.contract</field>
<field name="type">tree</field>
<field name="name">contract_list</field>
</record>
<record model="ir.action.act_window" id="act_contract_form">
<field name="name">Contracts</field>
<field name="res_model">optical_equipment.contract</field>
</record>
<record model="ir.action.act_window.view"
id="act_contract_form_view1">
<field name="sequence" eval="10"/>
<field name="view" ref="contract_view_list"/>
<field name="act_window" ref="act_contract_form"/>
</record>
<record model="ir.action.act_window.view"
id="act_contract_form_view2">
<field name="sequence" eval="20"/>
<field name="view" ref="contract_view_form"/>
<field name="act_window" ref="act_contract_form"/>
</record>
<record model="ir.action.act_window.domain"
id="act_contract_form_domain_draft">
<field name="name">Draft</field>
<field name="sequence" eval="10"/>
<field name="domain" eval="[('state', '=', 'draft')]" pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_contract_form"/>
</record>
<record model="ir.action.act_window.domain"
id="act_contract_form_domain_running">
<field name="name">Running</field>
<field name="sequence" eval="30"/>
<field name="domain" eval="[('state', '=', 'running')]" pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_contract_form"/>
</record>
<record model="ir.action.act_window.domain"
id="act_contract_form_domain_closed">
<field name="name">Closed</field>
<field name="sequence" eval="40"/>
<field name="domain" eval="[('state', '=', 'closed')]" pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_contract_form"/>
</record>
<record model="ir.action.act_window.domain"
id="act_contract_form_domain_all">
<field name="name">All</field>
<field name="sequence" eval="9999"/>
<field name="domain"></field>
<field name="act_window" ref="act_contract_form"/>
</record>
<record model="ir.model.button" id="draft_running_button">
<field name="name">draft</field>
<field name="string">Draft</field>
<field name="model" search="[('model', '=', 'optical_equipment.contract')]"/>
</record>
<record model="ir.model.button" id="contrac_running_button">
<field name="name">running</field>
<field name="string">Run</field>
<field name="model" search="[('model', '=', 'optical_equipment.contract')]"/>
</record>
<record model="ir.model.button" id="contract_cancelled_button">
<field name="name">cancelled</field>
<field name="string">Cancel</field>
<field name="model" search="[('model', '=', 'optical_equipment.contract')]"/>
</record>
<record model="res.group" id="group_contract_admin">
<field name="name">Contract Administration</field>
</record>
<record model="res.user-res.group"
id="user_admin_group_contract_admin">
<field name="user" ref="res.user_admin"/>
<field name="group" ref="group_contract_admin"/>
</record>
<record model="ir.sequence.type" id="sequence_type_contract">
<field name="name">Contract</field>
</record>
<record model="ir.sequence.type-res.group"
id="sequence_type_contract_group_admin">
<field name="sequence_type" ref="sequence_type_contract"/>
<field name="group" ref="res.group_admin"/>
</record>
<record model="ir.sequence.type-res.group"
id="sequence_type_contract_group_contract_admin">
<field name="sequence_type" ref="sequence_type_contract"/>
<field name="group" ref="group_contract_admin"/>
</record>
<record model="ir.sequence" id="sequence_contract">
<field name="name">Contract</field>
<field name="sequence_type" ref="sequence_type_contract"/>
</record>
<record model="ir.action.report" id="report_contract">
<field name="name">Contract</field>
<field name="model">optical_equipment.contract</field>
<field name="report_name">optical_equipment.contract</field>
<field name="report">optical_equipment/report/Contract.fodt</field>
<field name="single" eval="True"/>
</record>
<record model="ir.action.keyword" id="report_contract_keyword">
<field name="keyword">form_print</field>
<field name="model">optical_equipment.contract,-1</field>
<field name="action" ref="report_contract"/>
</record>
<record model="ir.action.report" id="report_prorrogation">
<field name="name">Prorrogation</field>
<field name="model">optical_equipment.contract</field>
<field name="report_name">optical_equipment.contract</field>
<field name="report">optical_equipment/report/Prorrogation.fodt</field>
<field name="single" eval="True"/>
</record>
<record model="ir.action.keyword" id="report_prorrogation_keyword">
<field name="keyword">form_print</field>
<field name="model">optical_equipment.contract,-1</field>
<field name="action" ref="report_prorrogation"/>
</record>
<menuitem
parent="menu_equipment"
name="Contracts Management"
sequence="50"
id="menu_contracts"/>
<menuitem
parent="menu_contracts"
action="act_contract_form"
sequence="30"
id="menu_contract_form"/>
</tryton>

0
cv.py
View File

View File

24
diary.py Normal file
View File

@@ -0,0 +1,24 @@
from trytond.model import (
ModelSQL, ModelView, fields)
class Diary(ModelSQL, ModelView):
'Diary'
__name__ = 'optical_equipment_maintenance.diary'
_rec_name = 'code'
code = fields.Char("Code", select=True,states={'readonly': True })
date_expected = fields.DateTime("Expected Date", required=True)
date_estimated = fields.DateTime("Estimated Date")
date_end = fields.DateTime("Date End")
maintenance_service = fields.Many2One('optical_equipment_maintenance.service', 'Maintenance Service', required=True)
technical = fields.Many2One('company.employee', "Technical", required=True)
state = fields.Selection([('draft', "Draft"),
('agended', "Agended"),
('in_progress', "In Progress"),
('failed', "Failed"),
('finished', "Finished")
], "State", required=True, readonly=True, sort=True)
@classmethod
def default_state(self):
return 'draft'

106
diary.xml Normal file
View File

@@ -0,0 +1,106 @@
<?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>
<record model="res.group" id="group_agended_admin">
<field name="name">Agended Administration</field>
</record>
<record model="res.user-res.group"
id="user_admin_group_agended_admin">
<field name="user" ref="res.user_admin"/>
<field name="group" ref="group_agended_admin"/>
</record>
<record model="ir.action.act_window" id="act_agended_list_form">
<field name="name">Agended</field>
<field name="res_model">optical_equipment_maintenance.diary</field>
<field name="search_value"></field>
</record>
<record model="ir.ui.view" id= "agended_list_view_tree">
<field name="model">optical_equipment_maintenance.diary</field>
<field name="type">tree</field>
<field name="name">diary_tree</field>
</record>
<record model="ir.ui.view" id="agended_list_view_form">
<field name="model">optical_equipment_maintenance.diary</field>
<field name="type">form</field>
<field name="name">diary_form</field>
</record>
<record model="ir.action.act_window.domain" id="act_agended_list_form_domain_draft">
<field name="name">Draft</field>
<field name="sequence" eval="10"/>
<field name="domain"
eval="[('state', '=', 'draft')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_agended_list_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_agended_list_form_domain_agended">
<field name="name">Agended</field>
<field name="sequence" eval="20"/>
<field name="domain"
eval="[('state', '=', 'agended')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_agended_list_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_agended_list_form_domain_in_progress">
<field name="name">In progress</field>
<field name="sequence" eval="30"/>
<field name="domain"
eval="[('state', '=', 'in_progress')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_agended_list_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_agended_list_form_domain_failed">
<field name="name">Failed</field>
<field name="sequence" eval="30"/>
<field name="domain"
eval="[('state', '=', 'failed')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_agended_list_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_agended_list_form_domain_finished">
<field name="name">Finished</field>
<field name="sequence" eval="40"/>
<field name="domain"
eval="[('state', '=', 'finished')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_agended_list_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_agended_list_form_domain_all">
<field name="name">All</field>
<field name="sequence" eval="9999"/>
<field name="domain"></field>
<field name="act_window" ref="act_agended_list_form"/>
</record>
<record model="ir.sequence.type" id="sequence_type_agended">
<field name="name">Agended</field>
</record>
<record model="ir.sequence.type-res.group"
id="sequence_type_agended_group_admin">
<field name="sequence_type" ref="sequence_type_agended"/>
<field name="group" ref="res.group_admin"/>
</record>
<record model="ir.sequence.type-res.group"
id="sequence_type_agended_group_agended_admin">
<field name="sequence_type" ref="sequence_type_agended"/>
<field name="group" ref="group_agended_admin"/>
</record>
<record model="ir.sequence" id="sequence_agended">
<field name="name">Agended</field>
<field name="sequence_type" ref="sequence_type_agended"/>
</record>
<menuitem parent="menu_equipment"
name="Diary"
sequence="10"
id="menu_diary"/>
<menuitem parent="menu_diary"
action="act_agended_list_form"
sequence="20"
id="menu_agended_list_form"/>
</data>
</tryton>

View File

@@ -1,58 +1,401 @@
# 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 collections import defaultdict
from trytond.pool import Pool from trytond.pool import Pool
from trytond.model import ModelSQL, ModelView, fields 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.exceptions import UserError
from trytond.model.exceptions import AccessError
from trytond.wizard import (
Button, StateAction, StateTransition, StateView, Wizard)
from trytond.modules.company import CompanyReport
class OpticalEquipment(ModelSQL, ModelView):
_MAINTENANCE_FREQUENCY = [("none", ''),
("6", 'Seis Meses'),
("12", 'Doce Meses')]
class OpticalEquipment(DeactivableMixin, Workflow, ModelSQL, ModelView):
'Optical Equipment' 'Optical Equipment'
__name__ = "optical_equipment.equipment" __name__ = 'optical_equipment.equipment'
_rec_name = 'rec_name'
_order_name = 'code'
company = fields.Many2One('company.company', "Company") _states={
location = fields.Many2One('stock.location', "Location") 'readonly': Eval('state') != 'draft',
party = fields.Many2One('party.party', "Party") }
party_address = fields.Many2One('party.address', "Party Address")
#origin = fields.reference("Origin", selection='get_origin', select=True)
product = fields.Many2One('product.product', "Product")
refurbish = fields.Boolean("Refurbish")
equipment_type = fields.Char('type')
risk = fields.Char('Type risk')
use = fields.Char('Use')
biomedical_class = fields.Char('Biomedical Class')
main_tecnology = fields.Char('Main tecnology')
calibration = fields.Boolean("Apply calibration")
mark_category = fields.Many2One('product.category', 'Mark')
model_category = fields.Many2One('product.category', "Model")
reference = fields.Char("Reference", size=None)
origin_country = fields.Many2One('country.country',"Origin Country")
software_version = fields.Char("Software version", size=None)
useful_life = fields.Char("Useful life", size=None)
warranty = fields.Char("Warranty", size=None)
serial = fields.Char("Serial", size=None)
health_register = fields.Char("Health Register", size=None)
subscription_history = fields.Many2Many('sale.subscription-optical_equipment.equipment', 'equipment', 'subscription', "Subscriptions") _depends = ['state']
_states_serial={
'readonly': Eval('state') != 'draft',
}
code = fields.Char(
"Code", select=True,states={'readonly': True })
state = fields.Selection([('draft', "Draft"),
('registred', "Registred"),
('uncontrated', "UnContrated"),
('contrated', "Contrated")
], "State",
required=True, readonly=True, sort=False)
contract = fields.Many2One('optical_equipment.contract', "Contract", ondelete='CASCADE')
company = fields.Many2One('company.company', "Company", readonly=True)
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
)
propietarys = fields.Many2Many('optical_equipment.equipment-party.party', 'equipment', 'party', "Propietarys")
product = fields.Many2One('product.product', "Product",
domain=[('equipment', '=', True)],
states=_states,
depends=['equipment']
)
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
)
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",
domain=[('parent', '=', Eval('model_category'))],
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,)
contract_history = fields.Many2Many('optical_equipment.contract-optical_equipment.equipment', 'equipment','contract', "Contracts", states={'readonly': True})
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',select=True,
states={'readonly': True})
sale_destination = fields.Reference("Sale Destination", selection='get_destination',select=True,
states={'readonly': True})
shipment_destination = fields.Reference("Stock Move", selection='get_shipment', select=True,
states={'readonly': True})
rec_name = fields.Function(fields.Char("rec_name"), 'get_rec_name')
del _states_serial, _states, _depends
@fields.depends('product', 'serial', 'code')
def get_rec_name(self, name):
name = str(self.product.name) + '@' + str(self.serial) + '/' + str(self.code)
return name
@staticmethod @staticmethod
def get_origin(): def _get_shipment():
return None 'Return list of Model names for shipment Reference'
return [
'stock.shipment.in',
'stock.shipment.out',
'stock.shipment.out.return',
'stock.shipment.in.return',
'stock.shipment.internal',
]
@classmethod @classmethod
def get_subscription_history(cls, records, names): def get_shipment(cls):
IrModel = Pool().get('ir.model')
get_name = IrModel.get_name
models = cls._get_shipment()
return [(None, '')] + [(m, get_name(m)) for m in models]
@classmethod
def _get_origin(cls):
'Return list of Model names for origin Reference'
pool = Pool() pool = Pool()
ids = [] Purchase = pool.get('purchase.line')
for record in records:
ids.append(record.id)
Subscriptions = pool.get('sale.subscription-optical_equipment.equipment') return [Purchase.__name__]
subscriptions = Subscriptions.search([("equipment", 'in', ids)])
subscriptions_history_id = []
DICC = {}
for subscription in subscriptions: @classmethod
DICC[subscription.equipment.id] = subscription.id def get_origin(cls):
Model = Pool().get('ir.model')
get_name = Model.get_name
models = cls._get_origin()
#raise UserError(str(type(subscriptions_history_id[0]))) return [(None, '')] + [(m, get_name(m)) for m in models]
#raise UserError(str(list(subscriptions_history_id[0])))
#raise UserError(str(type(subscriptions_history_id)))
return DICC @classmethod
def _get_destination(cls):
'Return list of Model names for origin Reference'
pool = Pool()
Sale = pool.get('sale.line')
return [Sale.__name__]
@classmethod
def get_destination(cls):
Model = Pool().get('ir.model')
get_name = Model.get_name
models = cls._get_destination()
return [(None, '')] + [(m, get_name(m)) for m in models]
@classmethod
def __setup__(cls):
super(OpticalEquipment, cls).__setup__()
cls._transitions = ({
('draft', 'registred'),
('registred', 'draft'),
('registred', 'uncontrated'),
('uncontrated', 'contrated'),
})
cls._buttons.update({
'draft': {
'invisible': Eval('state') != 'registred'},
'registred': {
'invisible': Eval('state').in_(['registred', 'uncontrated', 'contrated'])}}
)
@classmethod
def set_code(cls, equipments):
pool = Pool()
Config = pool.get('optical_equipment.configuration')
config = Config(1)
for equipment in equipments:
if config.equipment_sequence != None:
if not equipment.code:
try:
equipment.code = config.equipment_sequence.get()
cls.save(equipments)
except UserError:
raise UserError(str('Validation Error'))
else:
raise UserError(gettext('optical_equipment.msg_not_sequence_equipment'))
def get_maintenances_of_equipment(self, records):
pool = Pool()
MaintenancesEquipment = pool.get('optical_equipment.maintenance')
maintenancesEquipment = set()
maintenancesEquipment = MaintenancesEquipment.search(['equipment', '=', self.id])
maintenances = []
for key in maintenancesEquipment:
maintenances.append(key.id)
return maintenances
@classmethod
def default_state(cls):
return 'draft'
@staticmethod
def default_company():
return Transaction().context.get('company')
@fields.depends('propietary', 'maintenance_frequency')
def on_change_propietary(self):
if self.propietary:
if self.propietary.client_type == 'ips':
self.maintenance_frequency = "6"
else:
self.maintenance_frequency = "12"
else:
self.maintenance_frequency = "none"
@fields.depends('product', 'equipment_type','use',
'biomedical_class', 'calibration',
'mark_category', 'model_category')
def on_change_product(self):
if self.product:
self.equipment_type=self.product.equipment_type
self.use=self.product.use
self.biomedical_class=self.product.biomedical_class
self.calibration=self.product.calibration
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.calibration=True if self.product.calibration else False
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
self.biomedical_class=self.product.biomedical_class
else:
self.equipment_type=None
self.use=None
self.biomedical_class=None
self.calibration=None
self.mark_category=None
self.model_category=None
self.reference_category=None
self.useful_life=None
self.calibration=False
self.warranty=None
self.risk=None
self.origin_country=None
self.use=None
self.biomedical_class=None
self.refurbish=None
self.serial=None
self.health_register=None
self.software_version=None
@classmethod
def delete(cls, equipments):
for equipment in equipments:
if equipment.purchase_origin:
raise AccessError(
gettext('estos equipos no se pueden borrar'))
elif equipment.state != 'draft' and equipment.serial != None:
raise AccessError(
gettext('estos equipos no se pueden borrar'))
super(OpticalEquipment, cls).delete(equipments)
@classmethod
@ModelView.button
@Workflow.transition('draft')
def draft(cls, equipments):
pass
@classmethod
@ModelView.button
@Workflow.transition('registred')
def registred(cls, equipments):
for i in equipments:
if i.serial == None:
raise UserError(str("El Equipo no cuenta con un Serial"))
else:
cls.set_code(equipments)
class EquipmentMaintenance(ModelSQL, ModelView):
'Optical Equipment - Equipment - Maintenance'
__name__ ='optical_equipment.maintenance-optical_equipment.equipment'
equipment = fields.Many2One('optical_equipment.equipment', 'Equipment', select=True)
maintenance = fields.Many2One('optical_equipment.maintenance', 'Maintenances', select=True)
class EquipmentContract(ModelSQL, ModelView):
'Optical Equipment - Contracs Equipment'
__name__ = 'optical_equipment.contract-optical_equipment.equipment'
equipment = fields.Many2One('optical_equipment.equipment', 'Equipment', select=True)
contract = fields.Many2One('optical_equipment.contract', 'Contract', select=True)
class EquipmentParty(ModelSQL, ModelView):
'Optical Equipment - Party'
__name__ = 'optical_equipment.equipment-party.party'
equipment = fields.Many2One('optical_equipment.equipment', "Equipment", select=True)
party = fields.Many2One('party.party', "Party", select=True)
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",
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,
domain=[('party', '=', Eval('new_propietary'))],
states={'required': True})
change_date = fields.Date("Change Date", readonly=True)
@classmethod
def default_change_date(cls):
pool = Pool()
Date = pool.get('ir.date')
return Date.today()
class NewPropietary(Wizard):
'Change Propietary'
__name__ = 'optical_equipment.change_propietary'
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')
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
for equipment in equipments:
equipment.propietarys += (equipment.propietary,)
equipment.propietary = new_propietary
equipment.propietary_address = new_address
equipment.maintenance_frequency = "6" if new_propietary.client_type == 'ips' else "12"
equipment.save()
class ChangeEquipment(ModelSQL):
'Change Equipment'
__name__ = 'optical_equipment.equipment-change_propietary.form'
maintenance_service = fields.Many2One('optical_equipment_maintenance.service', "Maintenance Service")
equipment = fields.Many2One('optical_equipment.equipment', 'Equipment')
change = fields.Many2One('optical_equipment.change_propietary.form', 'Change')
class EquipmentReport(CompanyReport):
__name__ = 'optical_equipment.equipment'
@classmethod
def execute(cls, ids, data):
with Transaction().set_context(address_with_party=True):
return super(EquipmentReport, cls).execute(ids, data)
@classmethod
def get_context(cls, records, header, data):
pool = Pool()
Date = pool.get('ir.date')
context = super().get_context(records, header, data)
context['today'] = Date.today()
return context

View File

@@ -3,13 +3,30 @@
this repository contains the full copyright notices and license terms. --> this repository contains the full copyright notices and license terms. -->
<tryton> <tryton>
<data> <data>
<record model="res.group" id="group_equipment_admin">
<field name="name">Equipment Administration</field>
</record>
<record model="res.user-res.group"
id="user_admin_group_equipment_admin">
<field name="user" ref="res.user_admin"/>
<field name="group" ref="group_equipment_admin"/>
</record>
<record model="res.group" id="group_maintenance_admin">
<field name="name">Maintenance Administration</field>
</record>
<record model="res.user-res.group"
id="user_admin_group_maintenance_admin">
<field name="user" ref="res.user_admin"/>
<field name="group" ref="group_maintenance_admin"/>
</record>
<menuitem <menuitem
name="Equipment" name="Equipment"
sequence="40" sequence="40"
id="menu_equipment"/> id="menu_equipment"/>
<record model="ir.action.act_window" id="act_optical_equipment"> <record model="ir.action.act_window" id="act_optical_equipment_form">
<field name="name">Equipments</field> <field name="name">Equipments</field>
<field name="res_model">optical_equipment.equipment</field> <field name="res_model">optical_equipment.equipment</field>
<field name="search_value"></field>
</record> </record>
<record model="ir.ui.view" id="optical_equipment_view_tree"> <record model="ir.ui.view" id="optical_equipment_view_tree">
<field name="model">optical_equipment.equipment</field> <field name="model">optical_equipment.equipment</field>
@@ -22,15 +39,182 @@
<field name="name">optical_equipment_form</field> <field name="name">optical_equipment_form</field>
</record> </record>
<record model="ir.action.act_window.view" id="act_optical_equipment_view1"> <record model="ir.action.act_window.view" id="act_optical_equipment_view1">
<field name="sequence" eval="50"/> <field name="sequence" eval="10"/>
<field name="view" ref="optical_equipment_view_tree"/> <field name="view" ref="optical_equipment_view_tree"/>
<field name="act_window" ref="act_optical_equipment"/> <field name="act_window" ref="act_optical_equipment_form"/>
</record> </record>
<record model="ir.action.act_window.view" id="act_optical_equipment_view2"> <record model="ir.action.act_window.view" id="act_optical_equipment_view2">
<field name="sequence" eval="50"/> <field name="sequence" eval="20"/>
<field name="view" ref="optical_equipment_view_form"/> <field name="view" ref="optical_equipment_view_form"/>
<field name="act_window" ref="act_optical_equipment"/> <field name="act_window" ref="act_optical_equipment_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_optical_equipment_form_domain_draft">
<field name="name">Draft</field>
<field name="sequence" eval="10"/>
<field name="domain"
eval="[('state', '=', 'draft')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_optical_equipment_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_optical_equipment_form_domain_registred">
<field name="name">Registred</field>
<field name="sequence" eval="20"/>
<field name="domain"
eval="[('state', '=', 'registred')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_optical_equipment_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_optical_equipment_form_domain_uncontrated">
<field name="name">UnContrated</field>
<field name="sequence" eval="30"/>
<field name="domain"
eval="[('state', '=', 'uncontrated')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_optical_equipment_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_optical_equipment_form_domain_contrated">
<field name="name">Contrated</field>
<field name="sequence" eval="30"/>
<field name="domain"
eval="[('state', '=', 'contrated')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_optical_equipment_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_optical_equipment_form_domain_all">
<field name="name">All</field>
<field name="sequence" eval="9999"/>
<field name="domain"></field>
<field name="act_window" ref="act_optical_equipment_form"/>
</record>
<record model="ir.model.button" id="draft_equipment_button">
<field name="name">draft</field>
<field name="string">Draft</field>
<field name="model" search="[('model', '=', 'optical_equipment.equipment')]"/>
</record>
<record model="ir.model.button" id="registred_equipment_button">
<field name="name">registred</field>
<field name="string">Registred</field>
<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>
<field name="search_value"></field>
</record>
<record model="ir.ui.view" id="optical_equipment_view_tree1">
<field name="model">optical_equipment.equipment</field>
<field name="type">tree</field>
<field name="name">optical_equipment_serial_tree</field>
</record>
<record model="ir.action.act_window.view" id="act_optical_equipment_view3">
<field name="sequence" eval="10"/>
<field name="view" ref="optical_equipment_view_tree1"/>
<field name="act_window" ref="act_optical_equipment_form1"/>
</record>
<record model="ir.action.act_window.domain" id="act_optical_equipment_serial_form_domain_draft">
<field name="name">Draft</field>
<field name="sequence" eval="10"/>
<field name="domain"
eval="[('state', '=', 'draft')]"
pyson="1"/>
<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.ui.menu-res.group"
id="menu_party_group_equipment_admin">
<field name="menu" ref="menu_equipment"/>
<field name="group" ref="group_equipment_admin"/>
</record>
<record model="ir.sequence.type" id="sequence_type_equipment">
<field name="name">Equipment</field>
</record>
<record model="ir.sequence.type-res.group"
id="sequence_type_equipment_group_admin">
<field name="sequence_type" ref="sequence_type_equipment"/>
<field name="group" ref="res.group_admin"/>
</record>
<record model="ir.sequence.type-res.group"
id="sequence_type_equipment_group_equipment_admin">
<field name="sequence_type" ref="sequence_type_equipment"/>
<field name="group" ref="group_equipment_admin"/>
</record>
<record model="ir.sequence" id="sequence_equipment">
<field name="name">Equipment</field>
<field name="sequence_type" ref="sequence_type_equipment"/>
</record>
<record model="ir.sequence.type" id="sequence_type_maintenances">
<field name="name">Maintenances</field>
</record>
<record model="ir.sequence.type-res.group"
id="sequence_type_maintenance_group_admin">
<field name="sequence_type" ref="sequence_type_maintenances"/>
<field name="group" ref="res.group_admin"/>
</record>
<record model="ir.sequence.type-res.group"
id="sequence_type_maintenance_group_maintenance_admin">
<field name="sequence_type" ref="sequence_type_maintenances"/>
<field name="group" ref="group_maintenance_admin"/>
</record>
<record model="ir.sequence" id="sequence_maintenances">
<field name="name">Maintenance</field>
<field name="sequence_type" ref="sequence_type_maintenances"/>
</record>
<record model="ir.action.report" id="report_equipment">
<field name="name">Equipment</field>
<field name="model">optical_equipment.equipment</field>
<field name="report_name">optical_equipment.equipment</field>
<field name="report">optical_equipment/report/CV_Equipment.fodt</field>
<field name="single" eval="True"/>
</record>
<record model="ir.action.keyword" id="report_equipment_keyword">
<field name="keyword">form_print</field>
<field name="model">optical_equipment.equipment,-1</field>
<field name="action" ref="report_equipment"/>
</record>
<record model="ir.action.report" id="report_history_maintenance">
<field name="name">Maintenance History</field>
<field name="model">optical_equipment.equipment</field>
<field name="report_name">optical_equipment.equipment</field>
<field name="report">optical_equipment/report/Maintenance_History.fodt</field>
<field name="single" eval="True"/>
</record>
<record model="ir.action.keyword" id="report_history_maintenance_keyword">
<field name="keyword">form_print</field>
<field name="model">optical_equipment.equipment,-1</field>
<field name="action" ref="report_history_maintenance"/>
</record>
<record model="ir.ui.view" id="change_propietary_view_form">
<field name="model">optical_equipment.change_propietary.form</field>
<field name="type">form</field>
<field name="name">change_propietary_form</field>
</record>
<record model="ir.action.wizard" id="equipment_change_propietary">
<field name="name">Change Propietary</field>
<field name="wiz_name">optical_equipment.change_propietary</field>
<field name="model">optical_equipment.equipment</field>
</record>
<record model="ir.action.keyword" id="equipment_change_propietary_keyword">
<field name="keyword">form_action</field>
<field name="model">optical_equipment.equipment,-1</field>
<field name="action" ref="equipment_change_propietary"/>
</record> </record>
<menuitem parent="menu_equipment" sequence="40" action="act_optical_equipment" id="menu_optical_equipment"/>
</data> </data>
</tryton> </tryton>

11
exceptions.py Normal file
View File

@@ -0,0 +1,11 @@
# 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.exceptions import UserError
from trytond.model.exceptions import ValidationError
class InvalidNumberPurchases(UserError):
pass
class NotSequenceEquipment(ValidationError):
pass

1436
locale/es.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

300
maintenance.xml Normal file
View File

@@ -0,0 +1,300 @@
<?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>
<record model="ir.action.act_window" id="act_maintenance_form">
<field name="name">Maintenances</field>
<field name="res_model">optical_equipment.maintenance</field>
<field name="search_value"></field>
</record>
<record model="ir.ui.view" id= "maintenance_view_tree">
<field name="model">optical_equipment.maintenance</field>
<field name="type">tree</field>
<field name="name">maintenance_tree</field>
</record>
<record model="ir.ui.view" id="maintenance_view_form">
<field name="model">optical_equipment.maintenance</field>
<field name="type">form</field>
<field name="name">maintenance_form</field>
</record>
<record model="ir.ui.view" id="change_propietary_maintenance_view_form">
<field name="model">optical_equipment.change_propietary_maintenance.form</field>
<field name="type">form</field>
<field name="name">change_propietary_maintenance_form</field>
</record>
<record model="ir.action.act_window" id="act_maintenance_service_form">
<field name="name">Services Maintenance</field>
<field name="res_model">optical_equipment_maintenance.service</field>
<field name="search_value"></field>
</record>
<record model="ir.ui.view" id= "maintenance_service_view_tree">
<field name="model">optical_equipment_maintenance.service</field>
<field name="type">tree</field>
<field name="name">maintenance_service_tree</field>
</record>
<record model="ir.ui.view" id="maintenance_service_view_form">
<field name="model">optical_equipment_maintenance.service</field>
<field name="type">form</field>
<field name="name">maintenance_service_form</field>
</record>
<record model="ir.ui.view" id= "maintenance_equipment_view_form">
<field name="model">optical_equipment.maintenance-optical_equipment.equipment</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">
<field name="model">optical_equipment_maintenance.activity</field>
<field name="type">form</field>
<field name="name">maintenance_activity_form</field>
</record>
<record model="ir.ui.view" id="maintenance_activity_view_tree">
<field name="model">optical_equipment_maintenance.activity</field>
<field name="type">tree</field>
<field name="priority" eval="10"/>
<field name="name">maintenance_activity_tree</field>
</record>
<record model="ir.action.act_window.view" id="act_maintenance_view1">
<field name="sequence" eval="10"/>
<field name="view" ref="maintenance_view_tree"/>
<field name="act_window" ref="act_maintenance_form"/>
</record>
<record model="ir.action.act_window.view" id="act_maintenance_view2">
<field name="sequence" eval="20"/>
<field name="view" ref="maintenance_view_form"/>
<field name="act_window" ref="act_maintenance_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_maintenance_form_domain_draft">
<field name="name">Draft</field>
<field name="sequence" eval="10"/>
<field name="domain"
eval="[('state', '=', 'draft')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_maintenance_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_maintenance_form_domain_finished">
<field name="name">Finished</field>
<field name="sequence" eval="40"/>
<field name="domain"
eval="[('state', '=', 'finished')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_maintenance_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_maintenance_form_domain_all">
<field name="name">All</field>
<field name="sequence" eval="9999"/>
<field name="domain"></field>
<field name="act_window" ref="act_maintenance_form"/>
</record>
<record model="ir.model.button" id="maintenance_service_draft_button">
<field name="name">draft</field>
<field name="string">Draft</field>
<field name="model" search="[('model', '=', 'optical_equipment_maintenance.service')]"/>
</record>
<record model="ir.model.button" id="maintenance_service_in_progress_button">
<field name="name">in_progress</field>
<field name="string">In progress</field>
<field name="model" search="[('model', '=', 'optical_equipment_maintenance.service')]"/>
</record>
<record model="ir.model.button" id="maintenance_service_finished_button">
<field name="name">finished</field>
<field name="string">Finished</field>
<field name="model" search="[('model', '=', 'optical_equipment_maintenance.service')]"/>
</record>
<record model="ir.model.button" id="maintenance_finished_button">
<field name="name">finished</field>
<field name="string">Finished</field>
<field name="model" search="[('model', '=', 'optical_equipment.maintenance')]"/>
</record>
<record model="ir.model.button" id="maintenance_samples_button">
<field name="name">samples</field>
<field name="string">Generate Samples</field>
<field name="model" search="[('model', '=', 'optical_equipment.maintenance')]"/>
</record>
<record model="ir.model.button" id="maintenance_calibrate_button">
<field name="name">calibrate</field>
<field name="string">Calibrate</field>
<field name="model" search="[('model', '=', 'optical_equipment.maintenance')]"/>
</record>
<record model="ir.action.act_window.domain" id="act_maintenance_service_form_domain_draft">
<field name="name">Draft</field>
<field name="sequence" eval="10"/>
<field name="domain"
eval="[('state', '=', 'draft')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_maintenance_service_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_maintenance_service_form_domain_agended">
<field name="name">Agended</field>
<field name="sequence" eval="20"/>
<field name="domain"
eval="[('state', '=', 'agended')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_maintenance_service_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_maintenance_service_form_domain_in_progress">
<field name="name">In progress</field>
<field name="sequence" eval="30"/>
<field name="domain"
eval="[('state', '=', 'in_progress')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_maintenance_service_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_maintenance_service_form_domain_failed">
<field name="name">Failed</field>
<field name="sequence" eval="30"/>
<field name="domain"
eval="[('state', '=', 'failed')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_maintenance_service_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_maintenance_service_form_domain_finished">
<field name="name">Finished</field>
<field name="sequence" eval="40"/>
<field name="domain"
eval="[('state', '=', 'finished')]"
pyson="1"/>
<field name="count" eval="True"/>
<field name="act_window" ref="act_maintenance_service_form"/>
</record>
<record model="ir.action.act_window.domain" id="act_maintenance_service_form_domain_all">
<field name="name">All</field>
<field name="sequence" eval="9999"/>
<field name="domain"></field>
<field name="act_window" ref="act_maintenance_service_form"/>
</record>
<record model="ir.ui.view" id="maintenance_line_view_form">
<field name="model">optical_equipment.maintenance.line</field>
<field name="type">form</field>
<field name="name">maintenance_line_form</field>
</record>
<record model="ir.ui.view" id="maintenance_line_view_tree">
<field name="model">optical_equipment.maintenance.line</field>
<field name="type">tree</field>
<field name="name">maintenance_line_tree</field>
</record>
<record model="ir.ui.view" id="maintenance_calibration_view_form">
<field name="model">optical_equipment.maintenance.calibration_sample</field>
<field name="type">form</field>
<field name="name">maintenance_sample_form</field>
</record>
<record model="ir.ui.view" id="maintenance_calibration_view_tree">
<field name="model">optical_equipment.maintenance.calibration_sample</field>
<field name="type">tree</field>
<field name="priority" eval="10"/>
<field name="name">maintenance_calibration_tree</field>
</record>
<record model="ir.ui.view" id="calibration_total_view_tree">
<field name="model">optical_equipment.maintenance.calibration</field>
<field name="type">tree</field>
<field name="name">calibration_total_tree</field>
</record>
<record model="ir.ui.view" id="calibration_total_view_form">
<field name="model">optical_equipment.maintenance.calibration</field>
<field name="type">form</field>
<field name="name">calibration_total_form</field>
</record>
<record model="ir.ui.view" id="assing_agended_view_form">
<field name="model">optical_equipment_maintenance.agended</field>
<field name="type">form</field>
<field name="name">assing_agended_form</field>
</record>
<record model="ir.action.wizard" id="act_assing_agended">
<field name="name">Assing Agended</field>
<field name="wiz_name">optical_equipment_maintenance.assing_agended</field>
</record>
<record model="ir.ui.view" id="reassing_agended_view_form">
<field name="model">optical_equipment_maintenance.reagended</field>
<field name="type">form</field>
<field name="name">reassing_agended_form</field>
</record>
<record model="ir.action.wizard" id="act_reassing_agended">
<field name="name">ReAssing Agended</field>
<field name="wiz_name">optical_equipment_maintenance.reassing_agended</field>
</record>
<record model="ir.ui.view" id="create_contract_view_form">
<field name="model">optical_equipment_create.contract</field>
<field name="type">form</field>
<field name="name">create_contract_form</field>
</record>
<record model="ir.action.wizard" id="maintenance_create_contract">
<field name="name">Create Contract</field>
<field name="wiz_name">optical_equipment.maintenance.contract</field>
<field name="model">optical_equipment_maintenance.service</field>
</record>
<record model="ir.action.keyword" id="maintenance_create_contract_keyword">
<field name="keyword">form_action</field>
<field name="model">optical_equipment_maintenance.service,-1</field>
<field name="action" ref="maintenance_create_contract"/>
</record>
<record model="ir.action.report" id="report_calibration">
<field name="name">Calibration</field>
<field name="model">optical_equipment.maintenance</field>
<field name="report_name">optical_equipment.maintenance</field>
<field name="report">optical_equipment/report/Calibration.fodt</field>
<field name="single" eval="True"/>
</record>
<record model="ir.action.keyword" id="report_calibration_keyword">
<field name="keyword">form_print</field>
<field name="model">optical_equipment.maintenance,-1</field>
<field name="action" ref="report_calibration"/>
</record>
<record model="ir.action.report" id="report_maintenance_service">
<field name="name">Maintenance Service</field>
<field name="model">optical_equipment.maintenance</field>
<field name="report_name">optical_equipment.maintenance</field>
<field name="report">optical_equipment/report/Maintenance_Service.fodt</field>
<field name="single" eval="True"/>
</record>
<record model="ir.action.keyword" id="report_maintenance_service_keyword">
<field name="keyword">form_print</field>
<field name="model">optical_equipment.maintenance,-1</field>
<field name="action" ref="report_maintenance_service"/>
</record>
<record model="ir.action.report" id="report_maintenance_timeline">
<field name="name">Time Line Maintenance Service</field>
<field name="model">optical_equipment_maintenance.service</field>
<field name="report_name">optical_equipment_maintenance.service</field>
<field name="report">optical_equipment/report/Maintenance_Timeline.fodt</field>
<field name="single" eval="True"/>
</record>
<record model="ir.action.keyword" id="report_maintenance_timeline_keyword">
<field name="keyword">form_print</field>
<field name="model">optical_equipment_maintenance.service,-1</field>
<field name="action" ref="report_maintenance_timeline"/>
</record>
<record model="ir.action.wizard" id="equipment_change_propietary_maintenance">
<field name="name">Change Propietary Maintenance</field>
<field name="wiz_name">optical_equipment.change_propietary_maintenance</field>
<field name="model">optical_equipment_maintenance.service</field>
</record>
<record model="ir.action.keyword" id="equipment_change_propietary_maintenance_keyword">
<field name="keyword">form_action</field>
<field name="model">optical_equipment_maintenance.service,-1</field>
<field name="action" ref="equipment_change_propietary_maintenance"/>
</record>
<menuitem parent="menu_equipment"
action="act_maintenance_service_form"
sequence="20"
id="menu_maintenance_service_form"/>
<menuitem parent="menu_maintenance_service_form"
action="act_maintenance_form"
sequence="30"
id="menu_maintenance_form"/>
<menuitem parent="menu_diary"
action="act_assing_agended"
sequence="30"
id="menu_assing_agended_form"/>
<menuitem parent="menu_diary"
action="act_reassing_agended"
sequence="40"
id="menu_reassing_agended_form"/>
</data>
</tryton>

View File

@@ -1,21 +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.model import fields
from trytond.pool import PoolMeta
class Measurements(metaclass=PoolMeta):
__name__ = 'product.template'
temperature = fields.Float("Temperature")
temperature_uom = fields.Many2One('product.uom', "Temperature UOM")
frequency = fields.Float("Frequency")
frequency_uom = fields.Many2One('product.uom', "Frequency UOM")
wet = fields.Float("Wet")
wet_uom = fields.Many2One('product.uom', "Wet UOM")
voltageAC = fields.Float("Voltage AC")
voltageAC_uom = fields.Many2One('product.uom', "Voltage AC UOM")
voltageDC = fields.Float("Voltage DC")
voltageDC_uom = fields.Many2One('product.uom', "Voltage DC UOM")

View File

@@ -1,9 +0,0 @@
<?xml version="1.0"?>
<!--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>
<record model="ir.ui.view" id="template_view_form">
<field name="model">product.template</field>
<field name="inherit" ref="product.template_view_form"/>
<field name="name">template_form</field>
</record>
</tryton>

16
message.xml Normal file
View File

@@ -0,0 +1,16 @@
<?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="msg_invalid_number_purchases">
<field name="text">Please, select only one purchase.</field>
</record>
<record model="ir.message" id="msg_serial_unique">
<field name="text">The serial number of equipment, should be unique.</field>
</record>
<record model="ir.message" id="msg_not_sequence_equipment">
<field name="text">You do not have a sequence assigned for equipments</field>
</record>
</data>
</tryton>

254
move.py Normal file
View File

@@ -0,0 +1,254 @@
from trytond.model import fields, ModelSQL, ModelView, Workflow, dualmethod
from trytond.modules.company import CompanyReport
from trytond.modules.company.model import employee_field, set_employee
from trytond.pool import Pool, PoolMeta
from trytond.pyson import Eval, If
from trytond.exceptions import UserError
from itertools import groupby
from trytond.transaction import Transaction
class Move(metaclass=PoolMeta):
"Stock Move"
__name__ = "stock.move"
equipment = fields.Many2One('optical_equipment.equipment', "Equipment",
domain=[('state', '=', 'registred'),
('product','=', Eval('product'))
],
states={'invisible': If(~Eval('product_equipment'), True),
'readonly': (Eval('state').in_(['cancelled', 'done'])),},
depends=['product_equipment'])
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')
@fields.depends('product')
def get_product_equipment(self, product):
if self.product.equipment:
return True
else:
return False
@fields.depends('equipment')
def get_equipment_serial(self, equipment):
if self.equipment:
return self.equipment.serial
else:
return None
@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
self.equipment_serial = self.get_equipment_serial(self.equipment)
else:
self.equipment_serial = None
class ShipmentOut(metaclass=PoolMeta):
"Customer Shipment"
__name__ = 'stock.shipment.out'
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({
'maintenance_initial': {
'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', {
'invisible': False,
}),]
@classmethod
@ModelView.button
@Workflow.transition('done')
@set_employee('done_by')
def done(cls, shipments):
pool = Pool()
Move = pool.get('stock.move')
Date = pool.get('ir.date')
Equipments = pool.get('optical_equipment.equipment')
for shipment in shipments:
for move in shipment.inventory_moves:
count = 0
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.state="uncontrated"
equipment.shipment_destination = shipment
equipment.sale_destination = shipment.outgoing_moves[count].origin
equipment.propietarys += (shipment.customer,)
equipment.maintenance_frequency = "6" if shipment.customer.client_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'])
Move.do([m for s in shipments for m in s.outgoing_moves])
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], {
'effective_date': today,
})
@classmethod
@ModelView.button
def maintenance_initial(cls, shipments):
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:
sale_origin = shipment.outgoing_moves[0].origin.sale.id
saleLine = SaleLine(
type='line',
quantity=1,
unit_price=0,
sale=sale_origin)
saleLine.save()
maintenanceService = MaintenanceService(
sale_date=shipment.outgoing_moves[0].origin.sale.sale_date,
sale_origin=saleLine,
maintenance_type='initial',
propietary=shipment.customer.id,
propietary_address=shipment.delivery_address.id,
state='draft')
maintenanceService.save()
serial = False
for move in shipment.inventory_moves:
if move.product_equipment and move.equipment:
serial = True
elif not move.product_equipment:
serial = True
else:
serial = False
if serial == True:
for move in shipment.inventory_moves:
if move.product_equipment and move.equipment:
maintenance = Maintenance(
service_maintenance=maintenanceService.id,
maintenance_type='initial',
propietary=shipment.customer.id,
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 = 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)
maintenance.save()
shipment.service_maintenance_initial = True
shipment.save()
else:
raise UserError(str('Por favor Primero debe Asignar un serial a todos los Equipos.'))
class ShipmentInternal(metaclass=PoolMeta):
'Shipment Interncal'
__name__ = 'stock.shipment.internal'
@classmethod
@ModelView.button
@Workflow.transition('done')
@set_employee('done_by')
def done(cls, shipments):
pool = Pool()
Move = pool.get('stock.move')
Date = pool.get('ir.date')
for shipment in shipments:
for move in shipment.moves:
if move.equipment:
move.equipment.location = shipment.to_location
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(),})
class ShipmentOutReturn(metaclass=PoolMeta):
"Customer Shipment Return"
__name__ = 'stock.shipment.out.return'
service_maintenance_initial = fields.Boolean('Maintenance Initial', states={'readonly': True})
sale_type = fields.Char('Type sale origin')
class PickingListDeliveryReport(CompanyReport):
__name__ = 'stock.shipment.out.picking_list1'
@classmethod
def execute(cls, ids, data):
with Transaction().set_context(address_with_party=True):
return super(PickingListDeliveryReport, cls).execute(ids, data)
@classmethod
def get_context(cls, records, header, data):
pool = Pool()
Date = pool.get('ir.date')
context = super().get_context(records, header, data)
context['today'] = Date.today()
return context
class CapacitationReport(CompanyReport):
__name__ = 'stock.shipment.out.capacitation_note'
@classmethod
def execute(cls, ids, data):
with Transaction().set_context(address_with_party=True):
return super(CapacitationReport, cls).execute(ids, data)
@classmethod
def get_context(cls, records, header, data):
pool = Pool()
Date = pool.get('ir.date')
context = super().get_context(records, header, data)
context['today'] = Date.today()
return context

42
move.xml Normal file
View File

@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<!--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>
<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"/>
<field name="name">move_list_shipment</field>
</record>
<record model="ir.ui.view" id="move_view_form">
<field name="model">stock.move</field>
<field name="inherit" ref="stock.move_view_form"/>
<field name="name">move_form</field>
</record>
<record model="ir.model.button" id="maintenance_initial_button">
<field name="name">maintenance_initial</field>
<field name="string">Maintenance Initial</field>
<field name="model" search="[('model', '=', 'stock.shipment.out')]"/>
</record>
<record model="ir.action.report" id="report_shipment_out_picking_list1">
<field name="name">Acta Entrega</field>
<field name="model">stock.shipment.out</field>
<field name="report_name">stock.shipment.out.picking_list1</field>
<field name="report">optical_equipment/report/Delivery_Certificated.fodt</field>
</record>
<record model="ir.action.keyword" id="report_shipment_out_picking_list1_keyword">
<field name="keyword">form_print</field>
<field name="model">stock.shipment.out,-1</field>
<field name="action" ref="report_shipment_out_picking_list1"/>
</record>
<record model="ir.action.report" id="report_capacitation">
<field name="name">Capacitation</field>
<field name="model">stock.shipment.out</field>
<field name="report_name">stock.shipment.out.picking_list1</field>
<field name="report">optical_equipment/report/Capacitation.fodt</field>
</record>
<record model="ir.action.keyword" id="report_capacitation_keyword">
<field name="keyword">form_print</field>
<field name="model">stock.shipment.out,-1</field>
<field name="action" ref="report_capacitation"/>
</record>
</tryton>

View File

@@ -3,7 +3,8 @@ from trytond.model import ModelSQL, ModelView, fields
from . import equipment from . import equipment
_CLIENT_TYPE = [('ips', 'IPS'), _CLIENT_TYPE = [('ips', 'IPS'),
('optica', 'Optica')] ('optica', 'Optica'),
('otro', 'Otro')]
class Party(metaclass=PoolMeta): class Party(metaclass=PoolMeta):
__name__ = 'party.party' __name__ = 'party.party'

View File

@@ -1,76 +1,306 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of #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 repository contains the full copyright notices and license terms
from sql import Literal
from sql.operators import Equal
from trytond.pool import Pool, PoolMeta from trytond.pool import Pool, PoolMeta
from trytond.model import ( from trytond.model import (
ModelView, ModelSQL, fields, Exclude) ModelView, ModelSQL, fields, Exclude)
from trytond.pyson import If, Eval from trytond.pyson import Bool, If, Eval, Id
from trytond.exceptions import UserError
_RISK = [('n/a', "No aplíca"),
('I', 'I'),
('IIA', 'IIA'),
('IIB', 'IIB')]
_USE = [('', ""),
_RISK = [('uno', 'I'), ('medico', 'Médico'),
('dosA', 'IIA'),
('dosB', 'IIB')]
_USE = [('medico', 'Médico'),
('basico', 'Basico'), ('basico', 'Basico'),
('apoyo', 'Apoyo')] ('apoyo', 'Apoyo')]
_BIOMEDICAL_CLASS = [('diagnostico', 'Diagnóstico'), _BIOMEDICAL_CLASS = [
('n/a', "No aplíca"),
('diagnostico', 'Diagnóstico'),
('rehabilitación', 'Rehabilitación')] ('rehabilitación', 'Rehabilitación')]
_MAIN_TECNOLOGY = [('mecanico', 'Mecánico'), _MAIN_TECNOLOGY = [
('', ""),
('mecanico', 'Mecánico'),
('electrico', 'Electrico'), ('electrico', 'Electrico'),
('electronico', 'Electrónico'), ('electronico', 'Electrónico'),
('hidraulico', 'Hidraulico'), ('hidraulico', 'Hidraulico'),
('neumatico', 'Neumatico')] ('neumatico', 'Neumatico')]
_EQUIPMENT_TYPE = [('mobiliario_optico', 'Mobiliario óptico'), _EQUIPMENT_TYPE = [
('', ""),
('mobiliario_optico', 'Mobiliario óptico'),
('refraccion', 'Refracción'), ('refraccion', 'Refracción'),
('medico', 'Medicion'), ('medicion', 'Medicion'),
('accesorios', 'Accesorios')] ('accesorios', 'Accesorios')]
NON_MEASURABLE = ['service']
class Template(metaclass=PoolMeta): class Template(metaclass=PoolMeta):
'Template' 'Template'
__name__ = 'product.template' __name__ = 'product.template'
equipment = fields.Boolean('It is equipment') product = fields.Many2One('optical_equipment.maintenance', "Maintenance Activity",
equipment_type = fields.Selection(_EQUIPMENT_TYPE, 'Equipment type') ondelete='CASCADE', select=True)
equipment = fields.Boolean('It is equipment',
states={'invisible': Eval('type', 'goods') != 'goods',
},depends=['type']
)
maintenance_activity = fields.Boolean('Maintenance Activity',
states={'invisible': Eval('type', 'service') != 'service',
'readonly': If(Eval('equipment',True), True)
| If(Eval('replacement',True), True)
},depends=['type']
)
replacement = fields.Boolean('Replacement',
states={'invisible': Eval('type', 'goods') != 'goods',
'readonly': If(Eval('equipment',True), True)
| If(Eval('maintenance_activity',True), True)
},depends=['type']
)
equipment_type = fields.Selection(_EQUIPMENT_TYPE, 'Equipment type',
states={'required': Eval('equipment', False)},
depends=['equipment']
)
risk = fields.Selection(_RISK, 'Type risk') risk = fields.Selection(_RISK, 'Type risk')
use = fields.Selection(_USE, 'Use') use = fields.Selection(_USE, 'Use',
biomedical_class = fields.Selection(_BIOMEDICAL_CLASS, states={'required': Eval('equipment', False)},
'Biomedical Class') depends=['equipment']
main_tecnology = fields.Selection(_MAIN_TECNOLOGY, )
'Main tecnology') biomedical_class = fields.Selection(_BIOMEDICAL_CLASS,'Biomedical Class',
states={'required': Eval('equipment', False)},
depends=['equipment']
)
main_tecnology = fields.Selection(_MAIN_TECNOLOGY,'Main tecnology',
states={'required': Eval('equipment', False)},
depends=['equipment']
)
calibration = fields.Boolean("Apply calibration") calibration = fields.Boolean("Apply calibration")
observation = fields.Text('Observation') observation = fields.Text('Observation')
mark_category = fields.Many2One('product.category', 'Mark') mark_category = fields.Many2One('product.category', 'Mark',
model_category = fields.Many2One('product.category', "Model") domain=[('parent', '=', None),
reference = fields.Char("Reference", size=None) ('accounting', '=', False)],
states={'required': Eval('equipment', False)},
depends=['equipment']
)
model_category = fields.Many2One('product.category', "Model",
domain=[('parent', '=', Eval('mark_category')),
('accounting', '=', False)],
states={'required': Eval('equipment', False)},
depends=['equipment']
)
reference_category = fields.Many2One('product.category', "Reference",
domain=[('parent', '=', Eval('model_category'))],
)
origin_country = fields.Many2One('country.country',"Origin Country") origin_country = fields.Many2One('country.country',"Origin Country")
software_version = fields.Char(
"Software version", size=None)
useful_life = fields.Char(
"Useful life", size=None)
warranty = fields.Char(
"Warranty", size=None)
serial = fields.Char(
"Serial", size=None)
health_register = fields.Char(
"Health_Register", size=None)
refurbish = fields.Boolean('Refurbish') refurbish = fields.Boolean('Refurbish')
software_required = fields.Boolean("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',
domain=[('category', '=', Id('optical_equipment', "uom_cat_temperature"))],
states={'invisible' : If(Eval('temperature_min') == None, True)},
depends=['itemperature_min']
)
frequency = fields.Float("Frequency")
frequency_uom = fields.Many2One('product.uom', "Frequency UOM",
domain=[('category', '=', Id('optical_equipment', 'uom_cat_frequency'))],
states={'invisible' : If(Eval('frequency') == None, True)},
depends=['frequency']
)
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'))],
states={'invisible' : If(Eval('moisture_min') == None, True)},
depends=['moisture_min']
)
electrical_equipment = fields.Boolean("Electrical Equipment")
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' : If(Eval('frequency') == None, True) |
~Eval('electrical_equipment', True)},
depends=['frequency']
)
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' : If(Eval('voltageAC') == None, True) |
~Eval('electrical_equipment', True)},
depends=['voltageAC']
)
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' : If(Eval('voltageDC') == None, True) |
~Eval('electrical_equipment', True)},
depends=['voltageDC'])
useful_life = fields.Integer("Useful life")
warranty = fields.Integer("Warranty")
#### calibration parameters
use_pattern = fields.Selection([
('', ""),
('ojo_esquematico', "Ojo esquematico"),
('lente_prueba', "Lente de Prueba"),
('pesas_calibration', "Pesas de Calibración"),
('esferas_calibration', "Esferas de Calibración")], "Patrón Utilizado", states={'required': Eval('calibration', True)})
measuring_range = fields.Selection([
('No Aplíca', ""),
('dioptria', "Dioptria"),
('mmhg', "mmHg")], "Rango de Medición", states={'required': Eval('calibration', True)})
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)},
depends=['calibration'])
d_resolution = fields.Float("Resolution d",
states={'invisible': If(Eval('resolution_type') != 'digital', True)},
depends=['resolution_type'])
analog_resolution = fields.Float("Analog resolution",
states={'invisible': If(Eval('resolution_type') != 'analoga', True),},
depends=['resolution_type'])
a_factor_resolution = fields.Float("(a) Resolution",
states={'invisible': If(Eval('resolution_type') != 'analoga', True)},
depends=['resolution_type'])
Usubi = fields.Integer("Usub i",states={'required': Eval('calibration', False)},)
#maintenance activities
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")
clean_eyes = fields.Boolean("Limpieza de lentes y espejos")
optical = fields.Boolean("Optical")
check_calibration = fields.Boolean("Verificar Calibración")
@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')},)
]
@classmethod
@fields.depends('measuring_range')
def default_measuring_range(self):
return 'dioptria'
@classmethod
@fields.depends('temperature_min')
def default_temperature_min(self):
return 0
@classmethod
@fields.depends('temperature_max')
def default_temperature_max(self):
return 0
@classmethod
@fields.depends('temperature')
def default_temperature_uom(self):
pool = Pool()
measurement = None
Measurements = pool.get('product.uom')
if Measurements.search(['name', '=', 'Celsius']) != []:
measurement = Measurements.search(['name', '=', 'Celsius'])[0].id
return measurement
@staticmethod @staticmethod
def default_equipment(): def default_frequency_uom():
return False pool = Pool()
measurement = None
Measurements = pool.get('product.uom')
if Measurements.search(['name', '=', 'Hertz']) != []:
measurement = Measurements.search(['name', '=', 'Hertz'])[0].id
return measurement
@staticmethod
def default_frequency():
return 0
@staticmethod
def default_frequency_uom():
pool = Pool()
Measurements = pool.get('product.uom')
measurement = Measurements.search(['name', '=', 'Hertz'])[0].id
return measurement
@staticmethod
def default_moisture_min():
return 0
@staticmethod
def default_moisture_max():
return 0
@staticmethod
def default_voltageAC_uom():
pool = Pool()
measurement = None
Measurements = pool.get('product.uom')
if Measurements.search(['name', '=', 'Volt']) != []:
measurement = Measurements.search(['name', '=', 'Volt'])[0].id
return measurement
@staticmethod
def default_voltageAC():
return 0
@staticmethod
def default_voltageAC_uom():
pool = Pool()
Measurements = pool.get('product.uom')
measurement = Measurements.search(['name', '=', 'Volt'])[0].id
return measurement
@staticmethod
def default_voltageDC():
return 0
@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
self.voltageDC_uom = measurement
@staticmethod @staticmethod
def default_risk(): def default_risk():
return None return 'n/a'
@staticmethod @staticmethod
def default_use(): def default_use():
@@ -78,7 +308,7 @@ class Template(metaclass=PoolMeta):
@staticmethod @staticmethod
def default_biomedical_class(): def default_biomedical_class():
return None return 'n/a'
@staticmethod @staticmethod
def default_main_tecnology(): def default_main_tecnology():
@@ -88,21 +318,99 @@ class Template(metaclass=PoolMeta):
def default_calibration(): def default_calibration():
return False return False
@staticmethod
def default_use_pattern():
return ''
@staticmethod @staticmethod
def default_refurbish(): def default_refurbish():
return False return False
@fields.depends('mark_category', 'model_category')
@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')
def on_change_resolution_type(self):
self.d_resolution = None
self.analog_resolution = None
self.a_factor_resolution = None
@fields.depends('equipment', 'replacement')
def on_change_equipment(self):
if self.equipment:
self.replacement=False
self.maintenance_activity=False
self.calibration=False
@fields.depends('mark_category', 'model_category', 'reference_category')
def on_change_mark_category(self): def on_change_mark_category(self):
if self.mark_category: if not self.mark_category:
self.model_category = None self.model_category = None
self.reference_category = None
@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')
def on_change_electrical_equipment(self):
if self.electrical_equipment:
self.voltageAC = 0
self.voltageDC = 0
self.frequency = 0
@classmethod @classmethod
def view_attributes(cls): def copy(cls, templates, default=None):
return super(Template, cls).view_attributes() + [ if default is None:
('//page[@id="features"]', 'states', { default = {}
'invisible': ~Eval('equipment'), else:
})] default = default.copy()
default.setdefault('code', None)
default.setdefault('images', None)
return super().copy(templates, default=default)
class Product(metaclass=PoolMeta): class Product(metaclass=PoolMeta):
__name__ = 'product.product' __name__ = 'product.product'
@classmethod
def copy(cls, products, default=None):
if default is None:
default = {}
else:
default = default.copy()
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'
@classmethod
def copy(cls, images, default=None):
if default is None:
default = {}
else:
default = default.copy()
default.setdefault('template', None)
default.setdefault('product', None)
return super().copy(images, default=default)
class Pattern(ModelSQL, ModelView):
"Pattern K of equipment"
__name__ = 'optical_equipment.product_pattern'
_rec_name = 'pattern'
product = fields.Many2One('product.template', "Template", ondelete='CASCADE')
pattern = fields.Float("Value Pattern")

View File

@@ -13,5 +13,15 @@
<field name="inherit" ref="product.template_view_tree"/> <field name="inherit" ref="product.template_view_tree"/>
<field name="name">template_tree</field> <field name="name">template_tree</field>
</record> </record>
<record model="ir.ui.view" id="pattern_view_form">
<field name="model">optical_equipment.product_pattern</field>
<field name="type">form</field>
<field name="name">pattern_form</field>
</record>
<record model="ir.ui.view" id="pattern_view_tree">
<field name="model">optical_equipment.product_pattern</field>
<field name="type">tree</field>
<field name="name">pattern_tree</field>
</record>
</data> </data>
</tryton> </tryton>

View File

@@ -1,72 +1,195 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of #This file is part of Tryton. The COPYRIGHT file at the top level of
#txhis repository contains the full copyright notices and license terms #txhis repository contains the full copyright notices and license terms
from trytond.pool import Pool, PoolMeta from trytond.pool import Pool, PoolMeta
from trytond.model import ModelView, ModelSQL, fields 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.exceptions import UserError
from trytond.i18n import gettext
from .exceptions import (
InvalidNumberPurchases)
from trytond.transaction import Transaction
class Purchase(metaclass=PoolMeta): class Purchase(metaclass=PoolMeta):
__name__ = 'purchase.purchase' __name__ = 'purchase.purchase'
equipment_create = fields.Boolean("Equipments Creates", readonly=True)
@classmethod
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'],}
})
@classmethod
def copy(cls, purchases, default=None):
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('purchase_date', None)
default.setdefault('quoted_by')
default.setdefault('confirmed_by')
default.setdefault('equipment_create', None)
return super(Purchase, cls).copy(purchases, default=default)
@classmethod @classmethod
@ModelView.button @ModelView.button
def process(cls, purchases): def create_equipments(cls, purchases):
if len(purchases) == 1:
pool = Pool() pool = Pool()
Equipment = pool.get('optical_equipment.equipment') Equipment = pool.get('optical_equipment.equipment')
#raise UserError(str(type(Equipment))) Config = pool.get('optical_equipment.configuration')
Line = pool.get('purchase.line') config = Config(1)
lines = []
process, done = [], [] purchase = purchases[0]
cls.lock(purchases)
for purchase in purchases:
"""if purchase.state not in {'confirmed', 'processing', 'done'}:
continue
purchase.create_invoice()
purchase.set_invoice_state()
purchase.create_move('in')
return_moves = purchase.create_move('return')
if return_moves:
purchase.create_return_shipment(return_moves)
purchase.set_shipment_state()
"""
#raise UserError(str(dir(purchase)))
#equipment = Equipment()
for line in purchase.lines: for line in purchase.lines:
#raise UserError(str(dir(line))) if line.product.equipment:
for i in range(0,int(line.quantity)):
equipment = Equipment( equipment = Equipment(
company=line.company, company=line.company,
location=line.to_location,
equipment_type=line.product.equipment_type, equipment_type=line.product.equipment_type,
party_address=line.address_equipment, propietary=line.company.party,
propietary_address=line.address_equipment,
product=line.product, product=line.product,
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,
risk=line.product.risk, risk=line.product.risk,
origin_country=line.product.origin_country,
use=line.product.use, use=line.product.use,
biomedical_class=line.product.biomedical_class, biomedical_class=line.product.biomedical_class,
calibration=line.product.calibration,
refurbish=line.refurbish, refurbish=line.refurbish,
serial=line.serial_equipment, serial=None if line.quantity > 1 else line.serial_equipment,
software_version=line.product.software_version, health_register=line.health_register,
software_version=line.product.software_version if line.product.software_required else "No Aplica",
maintenance_frequency="none",
purchase_origin=line,
) )
equipment.save() equipment.save()
#raise UserError(str([equipment.serial, equipment.software_version])) else:
""" line.set_actual_quantity() continue
lines.append(line) purchase.equipment_create = True
cls.save(purchases)
else:
raise InvalidNumberPurchases(
gettext('purchase.msg_invalid_number_purchases'))
if purchase.is_done():
if purchase.state != 'done':
if purchase.state == 'confirmed':
process.append(purchase)
done.append(purchase)
elif purchase.state != 'processing':
process.append(purchase)
Line.save(lines)
if process:
cls.proceed(process)
if done:
cls.do(done)"""
class Line(metaclass=PoolMeta): class Line(metaclass=PoolMeta):
__name__ = 'purchase.line' __name__ = 'purchase.line'
address_equipment = fields.Many2One('party.address', "Direccion") origin_country = origin_country = fields.Many2One('country.country',"Origin Country")
serial_equipment = fields.Char("Serial", size=None, required=True) address_equipment = fields.Many2One('party.address', "Direccion", required=True)
serial_equipment = fields.Char("Serial", size=None,
states={'invisible': If(Eval('quantity') > 1, True),
},depends=['quantity'])
refurbish = fields.Boolean("Refurbish") refurbish = fields.Boolean("Refurbish")
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)})
@classmethod
def default_address_equipment(cls):
pool = Pool()
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'])
def on_change_quantity(self):
Product = Pool().get('product.product')
if self.quantity > 1 or self.quantity < 1:
self.serial_equipment = None
if not self.product:
self.serial_equipment = None
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]
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'])
def on_change_product(self):
if not self.product:
self.product_equipment = False
self.address_equipment = None
self.serial_equipment = None
self.software_version = None
self.health_register = None
self.refurbish = None
self.quantity = None
self.unit_price = None
self.unit = None
return
party = None
if self.purchase:
party = self.purchase.invoice_party or self.purchase.party
# Set taxes before unit_price to have taxes in context of purchase
# price
self.taxes = self.compute_taxes(party)
category = self.product.purchase_uom.category
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()))
if len(product_suppliers) == 1:
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.amount = self.on_change_with_amount()
if self.product.equipment:
self.product_equipment = True
self.address_equipment = self.default_address_equipment()
if self.product.software_required:
self.software_version = self.product.software_version
@classmethod
def view_attributes(cls):
return super(Line, cls).view_attributes() + [
('//page[@id="equipment"]', 'states', {
'invisible': ~Eval('product_equipment', True),
})]

View File

@@ -8,5 +8,37 @@ this repository contains the full copyright notices and license terms. -->
<field name="inherit" ref="purchase.purchase_line_view_form"/> <field name="inherit" ref="purchase.purchase_line_view_form"/>
<field name="name">purchase_line_form</field> <field name="name">purchase_line_form</field>
</record> </record>
<record model="ir.ui.view" id="purchase_view_form">
<field name="model">purchase.purchase</field>
<field name="inherit" ref="purchase.purchase_view_form"/>
<field name="name">purchase_form</field>
</record>
<record model="ir.ui.view" id="product_view_list_purchase_line">
<field name="model">product.product</field>
<field name="inherit" ref="purchase.product_view_list_purchase_line"/>
<field name="name">product_list_purchase_line</field>
</record>
<record model="ir.ui.view" id="purchase_configuration_view_form">
<field name="model">purchase.configuration</field>
<field name="inherit" ref="purchase.purchase_configuration_view_form"/>
<field name="name">configuration_form</field>
</record>
<record model="ir.model.button" id="purchase_create_equipments">
<field name="name">create_equipments</field>
<field name="string">Create Equipments</field>
<field name="model" search="[('model', '=', 'purchase.purchase')]"/>
</record>
<record model="ir.action.report" id="report_purchase">
<field name="name">Purchase</field>
<field name="model">purchase.purchase</field>
<field name="report_name">purchase.purchase</field>
<field name="report">optical_equipment/report/Purchase.fodt</field>
<field name="single" eval="True"/>
</record>
<record model="ir.action.keyword" id="report_purchase_keyword">
<field name="keyword">form_print</field>
<field name="model">purchase.purchase,-1</field>
<field name="action" ref="report_purchase"/>
</record>
</data> </data>
</tryton> </tryton>

1606
report/CV_Equipment.fodt Normal file

File diff suppressed because it is too large Load Diff

1944
report/Calibration.fodt Normal file

File diff suppressed because it is too large Load Diff

1170
report/Capacitation.fodt Normal file

File diff suppressed because it is too large Load Diff

4943
report/Contract.fodt Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

BIN
report/Payment.fodt Normal file

Binary file not shown.

1313
report/Prorrogation.fodt Normal file

File diff suppressed because it is too large Load Diff

1531
report/Purchase.fodt Normal file

File diff suppressed because it is too large Load Diff

5205
report/Sale.fodt Normal file

File diff suppressed because it is too large Load Diff

5680
report/Sale_Internal.fodt Normal file

File diff suppressed because it is too large Load Diff

345
sale.py
View File

@@ -1,21 +1,346 @@
from trytond.pool import Pool, PoolMeta from trytond.pool import Pool, PoolMeta
from trytond.model import ModelView, ModelSQL, fields 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 (
employee_field, set_employee, reset_employee)
from trytond.exceptions import UserError
from trytond.wizard import (
Button, StateAction, StateTransition, StateView, Wizard)
class Sale(metaclass=PoolMeta):
'Sale'
__name__ = 'sale.sale'
quote_number = fields.Char("Quote Number", readonly=True)
sale_type = fields.Selection([('maintenance', 'Maintenance'),
('equipments', 'Equipments'),
('replaces', 'Replaces')], "Sale Type", required=True,
states={'readonly': Eval('state') != 'draft'})
maintenance_type = fields.Selection([('', ""),
('preventive', 'Preventive'),
('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=[('party', '=', Eval('party')),
('state', '=', 'closed')],
states={'invisible': (Eval('sale_type') != 'maintenance')},
search_context={
'related_party': Eval('party'),
},)
agended = fields.Boolean("Scheduling",states={
'invisible': (Eval('sale_type') != 'maintenance'),
'readonly': True})
@classmethod
def __setup__(cls):
super(Sale, cls).__setup__()
cls.contact.states['required']=True
cls.description.states['required']=True
cls.sale_date.states['required']=True
cls.payment_term.states['required']=True
cls._buttons.update({
'draft': {
'invisible': (Eval('state').in_(
['cancelled', 'draft'])) | (Eval('shipment_state') == 'sent')}})
cls._transitions |= set((
('draft', 'quotation'),
('quotation', 'confirmed'),
('confirmed', 'processing'),
('confirmed', 'draft'),
('processing', 'processing'),
('processing', 'done'),
('done', 'processing'),
('draft', 'cancelled'),
('quotation', 'cancelled'),
('quotation', 'draft'),
('cancelled', 'draft'),
('processing', 'draft')
))
@fields.depends('lines', 'sale_type', 'agended')
def on_chage_sale_type(self):
self.lines= []
if self.sale_type != "maintenance":
self.agended = False
@classmethod
def default_agended(self):
return False
@classmethod
def _get_origin_contract(cls):
'Return list of Model names for origin Reference'
pool = Pool()
Contract = pool.get('optical_equipment.contract')
return [Contract.__name__]
@classmethod
def get_origin_contract(cls):
Model = Pool().get('ir.model')
get_name = Model.get_name
models = cls._get_origin_contract()
return [(None, '')] + [(m, get_name(m)) for m in models]
def _get_shipment_sale(self, Shipment, key):
values = {
'customer': self.shipment_party or self.party,
'delivery_address': self.shipment_address,
'company': self.company,
'sale_type': self.sale_type,
'service_maintenance_initial': True if self.sale_type != 'equipments' else False,
}
values.update(dict(key))
return Shipment(**values)
@classmethod
def set_quote_number(cls, sales):
'''
Fill the number field with the sale sequence
'''
pool = Pool()
Config = pool.get('optical_equipment.configuration')
config = Config(1)
for sale in sales:
if config.equipment_sequence != None:
if not sale.quote_number:
try:
sale.quote_number = config.sale_quote_number.get()
cls.save(sales)
except UserError:
raise UserError(str('Validation Error'))
else:
raise UserError(gettext('optical_equipment.msg_not_sequence_quote'))
@classmethod
def copy(cls, sales, default=None):
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('quoted_by')
default.setdefault('confirmed_by')
return super(Sale, cls).copy(sales, default=default)
@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)
@classmethod
@ModelView.button
@Workflow.transition('confirmed')
@set_employee('confirmed_by')
def confirm(cls, sales):
pool = Pool()
Configuration = pool.get('sale.configuration')
transaction = Transaction()
context = transaction.context
cls.set_sale_date(sales)
cls.store_cache(sales)
config = Configuration(1)
MaintenanceService = pool.get('optical_equipment_maintenance.service')
for sale in sales:
if sale.sale_type == 'maintenance':
for line in sale.lines:
maintenanceService = MaintenanceService(
description=sale.description,
maintenance_type=sale.maintenance_type,
state_agended='no_agenda',
propietary=sale.party,
propietary_address=sale.shipment_address,
contract_origin=sale.contract_ref if sale.contract_ref else None,
sale_origin=line,
sale_date=sale.sale_date,
state="draft"
)
maintenanceService.save()
sale.agended = True
sale.save()
cls.set_number(sales)
with transaction.set_context(
queue_scheduled_at=config.sale_process_after,
queue_batch=context.get('queue_batch', True)):
cls.__queue__.process(sales)
class SaleLine(metaclass=PoolMeta): class SaleLine(metaclass=PoolMeta):
'SaleLine' 'SaleLine'
__name__ = 'sale.line' __name__ = 'sale.line'
address_equipment = fields.Many2One('party.address', "Direccion") product_equipment = fields.Boolean("Product Equipment")
equipment = fields.Many2One('optical_equipment.equipment', "Equipment",
domain=[('state', '=', 'registred'),
('product','=', Eval('product'))
],
states={'invisible': If(~Eval('product_equipment'), True)},)
unit_digits = fields.Function(fields.Integer('Unit Digits'),
'on_change_with_unit_digits')
@classmethod @classmethod
@ModelView.button def __setup__(cls):
def process(cls, sales): super(SaleLine, cls).__setup__()
states = {'confirmed', 'processing', 'done'} cls.product.domain.append(
sales = [s for s in sales if s.state in states] If(Eval('_parent_sale.sale_type') == 'maintenance',
cls.lock(sales) [('type', '=', 'service'),
cls._process_invoice(sales) ('maintenance_activity', '=', True)], []))
cls._process_shipment(sales) cls.product.domain.append(If(Eval('_parent_sale.sale_type') == 'replaces',
cls._process_invoice_shipment_states(sales) [('replacement', '=', True)], []))
cls._process_state(sales)
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:
self.product_equipment = False
self.unit = None
self.quantity = None
return
else:
party = None
if self.sale.sale_type == 'equipments':
self.quantity = 1
if self.sale and self.sale.party:
self.product_equipment = False
party = self.sale.party
# 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:
if party and party.customer_tax_rule:
tax_ids = party.customer_tax_rule.apply(tax, pattern)
if tax_ids:
taxes.extend(tax_ids)
continue
taxes.append(tax.id)
if party and party.customer_tax_rule:
tax_ids = party.customer_tax_rule.apply(None, pattern)
if tax_ids:
taxes.extend(tax_ids)
self.taxes = taxes
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
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]
if self.unit_price:
self.unit_price = self.unit_price.quantize(
Decimal(1) / 10 ** self.__class__.unit_price.digits[1])
self.type = 'line'
self.amount = self.on_change_with_amount()
if self.product.equipment:
self.product_equipment = True
def get_move(self, shipment_type):
'''
Return moves for the sale line according to shipment_type
'''
pool = Pool()
Move = pool.get('stock.move')
if self.type != 'line':
return
if not self.product:
return
if self.product.type not in Move.get_product_types():
return
if (shipment_type == 'out') != (self.quantity >= 0):
return
quantity = (self._get_move_quantity(shipment_type)
- self._get_shipped_quantity(shipment_type))
quantity = self.unit.round(quantity)
if quantity <= 0:
return
if not self.sale.party.customer_location:
raise PartyLocationError(
gettext('sale.msg_sale_customer_location_required',
sale=self.sale.rec_name,
party=self.sale.party.rec_name))
move = Move()
move.quantity = quantity
move.uom = self.unit
move.product = self.product
move.from_location = self.from_location
move.to_location = self.to_location
move.state = 'draft'
move.company = self.sale.company
if move.on_change_with_unit_price_required():
move.unit_price = self.unit_price
move.currency = self.sale.currency
move.planned_date = self.planned_shipping_date
move.invoice_lines = self._get_move_invoice_lines(shipment_type)
move.origin = self
return move

View File

@@ -1,9 +1,47 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!--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. --> <!--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> <tryton>
<record model="ir.ui.view" id="sale_line_view_form"> <record model="ir.ui.view" id="sale_view_tree">
<field name="model">sale.line</field> <field name="model">sale.sale</field>
<field name="inherit" ref="sale.sale_line_view_form"/> <field name="inherit" ref="sale.sale_view_tree"/>
<field name="name">sale_line_form</field> <field name="name">sale_tree</field>
</record>
<record model="ir.ui.view" id="sale_view_form">
<field name="model">sale.sale</field>
<field name="inherit" ref="sale.sale_view_form"/>
<field name="name">sale_form</field>
</record>
<record model="ir.ui.view" id="product_view_list_sale_line">
<field name="model">product.product</field>
<field name="inherit" ref="sale.product_view_list_sale_line"/>
<field name="name">product_list_sale_line</field>
</record>
<record model="ir.sequence" id="sequence_quote_sale">
<field name="name">Sale Quote</field>
<field name="sequence_type" ref="sale.sequence_type_sale"/>
</record>
<record model="ir.action.report" id="report_sale">
<field name="name">Sale Equipments</field>
<field name="model">sale.sale</field>
<field name="report_name">sale.sale</field>
<field name="report">optical_equipment/report/Sale_Internal.fodt</field>
<field name="single" eval="True"/>
</record>
<record model="ir.action.keyword" id="report_sale_keyword">
<field name="keyword">form_print</field>
<field name="model">sale.sale,-1</field>
<field name="action" ref="report_sale"/>
</record>
<record model="ir.action.report" id="report_sale_internal">
<field name="name">Sale Equipments Internal</field>
<field name="model">sale.sale</field>
<field name="report_name">sale.sale</field>
<field name="report">optical_equipment/report/Sale.fodt</field>
<field name="single" eval="True"/>
</record>
<record model="ir.action.keyword" id="report_sale_internal_keyword">
<field name="keyword">form_print</field>
<field name="model">sale.sale,-1</field>
<field name="action" ref="report_sale_internal"/>
</record> </record>
</tryton> </tryton>

10
shipment.xml Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!--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>
<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>
</tryton>

View File

@@ -1,14 +0,0 @@
from trytond.pool import PoolMeta
from trytond.model import ModelSQL, ModelView, fields
class Subscription(metaclass=PoolMeta):
__name__ = 'sale.subscription'
equipments = fields.Many2Many('sale.subscription-optical_equipment.equipment', 'subscription', 'equipment', "Equipments")
class SubscriptionEquipment(ModelSQL):
'Optical Equipment - Subscription'
__name__ = 'sale.subscription-optical_equipment.equipment'
subscription = fields.Many2One('sale.subscription', 'Subscription', select=True)
equipment = fields.Many2One('optical_equipment.equipment', 'Equipment', select=True)

View File

@@ -1,9 +0,0 @@
<?xml version="1.0"?>
<!--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>
<record model="ir.ui.view" id="subscription_view_form">
<field name="model">sale.subscription</field>
<field name="inherit" ref="sale_subscription.subscription_view_form"/>
<field name="name">subscription_form</field>
</record>
</tryton>

View File

@@ -1,22 +1,35 @@
[tryton] [tryton]
version=6.0 version=6.2
depends: depends:
ir ir
party party
company company
account_co_co
account_co_pyme
account_invoice
account_stock_continental
product product
product_measurements product_measurements
purchase purchase
sale sale
stock stock
country country
sale_subscription sale_history
sale_advance_payment
sale_amendment
xml: xml:
address.xml
party.xml party.xml
account.xml
product.xml product.xml
measurements.xml
equipment.xml equipment.xml
contract.xml
configuration_equipment.xml
sale.xml sale.xml
purchase.xml purchase.xml
uom.xml uom.xml
subscription.xml move.xml
message.xml
diary.xml
maintenance.xml
shipment.xml

46
uom.xml
View File

@@ -27,13 +27,55 @@ this repository contains the full copyright notices and license terms. -->
<field name="rounding" eval="1."/> <field name="rounding" eval="1."/>
<field name="digits" eval="0"/> <field name="digits" eval="0"/>
</record> </record>
<record model="product.uom.category" id="uom_cat_frecuency"> <record model="product.uom.category" id="uom_cat_frequency">
<field name="name">Frequency</field> <field name="name">Frequency</field>
</record> </record>
<record model="product.uom" id="uom_electrical2"> <record model="product.uom" id="uom_electrical2">
<field name="name">Hertz</field> <field name="name">Hertz</field>
<field name="symbol">Hrz</field> <field name="symbol">Hrz</field>
<field name="category" ref="uom_cat_frecuency"/> <field name="category" ref="uom_cat_frequency"/>
<field name="rate" eval="1."/>
<field name="factor" eval="1."/>
<field name="rounding" eval="1."/>
<field name="digits" eval="0"/>
</record>
<record model="product.uom.category" id="uom_cat_temperature">
<field name="name">Temperature</field>
</record>
<record model="product.uom" id="uom_celsius">
<field name="name">Celsius</field>
<field name="symbol">°C</field>
<field name="category" ref="uom_cat_temperature"/>
<field name="rate" eval="1."/>
<field name="factor" eval="1."/>
<field name="rounding" eval="1."/>
<field name="digits" eval="0"/>
</record>
<record model="product.uom" id="uom_fahrenheit">
<field name="name">Fahrenheit</field>
<field name="symbol">°F</field>
<field name="category" ref="uom_cat_temperature"/>
<field name="rate" eval="1."/>
<field name="factor" eval="1."/>
<field name="rounding" eval="1."/>
<field name="digits" eval="0"/>
</record>
<record model="product.uom" id="uom_kelvin">
<field name="name">Kelvin</field>
<field name="symbol">°K</field>
<field name="category" ref="uom_cat_temperature"/>
<field name="rate" eval="1."/>
<field name="factor" eval="1."/>
<field name="rounding" eval="1."/>
<field name="digits" eval="0"/>
</record>
<record model="product.uom.category" id="uom_cat_relative_humedity">
<field name="name">Relative Humedity</field>
</record>
<record model="product.uom" id="uom_relative_humedity">
<field name="name">Relative Humedity</field>
<field name="symbol">%HR</field>
<field name="category" ref="uom_cat_relative_humedity"/>
<field name="rate" eval="1."/> <field name="rate" eval="1."/>
<field name="factor" eval="1."/> <field name="factor" eval="1."/>
<field name="rounding" eval="1."/> <field name="rounding" eval="1."/>

14
view/address_form.xml Normal file
View File

@@ -0,0 +1,14 @@
<?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="/form/field[@name='party_name']" position="after">
<newline/>
<label name="party_related"/>
<field name="party_related"/>
</xpath>
<xpath expr="/form/group[@id='checkboxes']/field[@name='delivery']" position="after">
<label name="campus"/>
<field name="campus"/>
</xpath>
</data>

8
view/address_tree.xml Normal file
View File

@@ -0,0 +1,8 @@
<?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="street" expand="1"/>
</xpath>
</data>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level
this repository contains the full copyright notices and license terms. -->
<form>
<label name="maintenance_service"/>
<field name="maintenance_service" colspan="3"/>
<newline/>
<label name="estimated_agended"/>
<field name="estimated_agended" colspan="3" widget="date"/>
<newline/>
<label name="estimated_agended" string="Hora:"/>
<field name="estimated_agended" colspan="3" widget="time"/>
<newline/>
<label name="technical"/>
<field name="technical" colspan="3"/>
</form>

View File

@@ -0,0 +1,35 @@
<?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>

View File

@@ -0,0 +1,19 @@
<?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. -->
<tree>
<field name="diopter" expand="1"/>
<field name="dev_std" expand="1"/>
<field name="uncertain_type_A" expand="1"/>
<field name="uncertain_pattern" expand="1"/>
<field name="k_c_calibration" expand="1"/>
<field name="uncertain_U_b1" expand="1"/>
<field name="d_resolution" expand="1"/>
<field name="uncertain_U_b2_dig" expand="1"/>
<field name="uncertain_U_b2_ana" expand="1"/>
<field name="uncertain_combinated" expand="1"/>
<field name="uncertain_eff" expand="1"/>
<field name="t_student" expand="1"/>
<field name="uncertain_expanded" expand="1"/>
<field name="state" expand="1"/>
</tree>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level
this repository contains the full copyright notices and license terms. -->
<form>
<label name="old_propietary"/>
<field name="old_propietary"/>
<newline/>
<field name="equipments" colspan="3"/>
<newline/>
<label name="new_propietary"/>
<field name="new_propietary" colspan="3"/>
<label name="new_address"/>
<field name="new_address" colspan="3"/>
<label name="change_date"/>
<field name="change_date" colspan="3"/>
</form>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level
this repository contains the full copyright notices and license terms. -->
<form>
<label name="old_propietary"/>
<field name="old_propietary"/>
<newline/>
<field name="maintenance_service" colspan="3"/>
<newline/>
<label name="new_propietary"/>
<field name="new_propietary" colspan="3"/>
<label name="new_address"/>
<field name="new_address" colspan="3"/>
<label name="change_date"/>
<field name="change_date" colspan="3"/>
</form>

47
view/contract_form.xml Normal file
View File

@@ -0,0 +1,47 @@
<?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 col="6">
<label name="party"/>
<field name="party"/>
<label name="invoice_address"/>
<field name="invoice_address"/>
<label name="number"/>
<field name="number"/>
<newline/>
<label name="contact"/>
<field name="contact"/>
<newline/>
<label name="description"/>
<field name="description" colspan="3"/>
<label name="reference"/>
<field name="reference"/>
<newline/>
<separator id="validity" string="Validity" colspan="6"/>
<label name="start_date"/>
<field name="start_date"/>
<label name="end_date"/>
<field name="end_date"/>
<notebook colspan="6">
<page string="Contracts and Prorogues" id="contracts">
<field name="maintenance_services"/>
</page>
<page string="Equipments" id="equipments">
<field name="equipments"/>
</page>
<page string="Other Info" id="other">
<label name="company"/>
<field name="company"/>
</page>
</notebook>
<label name="price_contract"/>
<field name="price_contract"/>
<newline/>
<label name="state"/>
<field name="state"/>
<group col="2" colspan="2" id="button">
<button name="draft"/>
<button name="cancelled"/>
<button name="running"/>
</group>
</form>

12
view/contract_list.xml Normal file
View File

@@ -0,0 +1,12 @@
<?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. -->
<tree>
<field name="number"/>
<field name="party"/>
<field name="reference"/>
<field name="description"/>
<field name="start_date"/>
<field name="end_date"/>
<field name="state"/>
</tree>

9
view/contract_tree.xml Normal file
View File

@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<!--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. -->
<tree>
<field name="number"/>
<field name="reference"/>
<field name="party"/>
<field name="start_date"/>
<field name="end_date"/>
</tree>

View File

@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level
this repository contains the full copyright notices and license terms. -->
<form>
<group id="create_contract">
<label name="party"/>
<field name="party"/>
<label name="contact"/>
<field name="contact"/>
<label name="invoice_address"/>
<field name="invoice_address"/>
<label name="start_date"/>
<field name="start_date"/>
<label name="end_date"/>
<field name="end_date"/>
</group>
</form>

View File

@@ -0,0 +1,10 @@
<?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 col="2">
<image name="tryton-question" xexpand="0" xfill="0"/>
<group col="2" xexpand="1" id="create_date">
<label string="Create Subscription Invoices for date" id="create"/>
<field name="date"/>
</group>
</form>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level
this repository contains the full copyright notices and license terms. -->
<form>
<group id="create_prorogue">
<label name="party"/>
<field name="party"/>
<label name="contact"/>
<field name="contact"/>
<newline/>
<label name="initial_contract"/>
<field name="initial_contract" colspan="3"/>
<label name="invoice_address"/>
<field name="invoice_address"/>
<label name="payment_term"/>
<field name="payment_term"/>
<newline/>
<label name="invoice_recurrence"/>
<field name="invoice_recurrence"/>
<newline/>
<label name="start_date"/>
<field name="start_date"/>
<label name="end_date"/>
<field name="end_date"/>
<label name="invoice_start_date"/>
<field name="invoice_start_date"/>
<label name="service"/>
<field name="service"/>
<label name="quantity"/>
<field name="quantity"/>
<label name="unit_price"/>
<field name="unit_price"/>
</group>
<newline/>
<field name="equipments"/>
</form>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level
this repository contains the full copyright notices and license terms. -->
<form>
<group id="create_subscription">
<label name="party"/>
<field name="party"/>
<label name="contact"/>
<field name="contact"/>
<label name="invoice_address"/>
<field name="invoice_address"/>
<label name="invoice_recurrence"/>
<field name="invoice_recurrence"/>
<label name="start_date"/>
<field name="start_date"/>
<label name="end_date"/>
<field name="end_date"/>
<label name="invoice_start_date"/>
<field name="invoice_start_date"/>
<label name="service"/>
<field name="service"/>
<label name="quantity"/>
<field name="quantity"/>
<label name="unit_price"/>
<field name="unit_price"/>
<label name="payment_term"/>
<field name="payment_term"/>
</group>
<newline/>
<field name="equipments"/>
</form>

24
view/diary_form.xml Normal file
View File

@@ -0,0 +1,24 @@
<?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 col="6">
<label name="maintenance_service"/>
<field name="maintenance_service"/>
<label name="code"/>
<field name="code"/>
<newline/>
<notebook colspan="6">
<page string="Dates" id="dates_agended">
<label name="date_expected"/>
<field name="date_expected"/>
<label name="date_estimated"/>
<field name="date_estimated"/>
<label name="date_end"/>
<field name="date_end"/>
</page>
</notebook>
<label name="technical"/>
<field name="technical"/>
<label name="state"/>
<field name="state"/>
</form>

12
view/diary_tree.xml Normal file
View File

@@ -0,0 +1,12 @@
<?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. -->
<tree>
<field name="code"/>
<field name="date_expected" widget="date"/>
<field name="date_expected" string="time" widget="time"/>
<field name="date_estimated" widget="date"/>
<field name="date_end" widget="date"/>
<field name="maintenance_service"/>
<field name="technical"/>
</tree>

View File

@@ -0,0 +1,7 @@
<?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="product"/>
<field name="product"/>
</form>

View File

@@ -0,0 +1,6 @@
<?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. -->
<tree>
<field name="product"/>
</tree>

View File

@@ -0,0 +1,7 @@
<?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. -->
<calendar
dtstart="date_expected"
dtend="date_expected">
</calendar>

View File

@@ -0,0 +1,5 @@
<?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>
</data>

View File

@@ -0,0 +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.-->
<tree>
<field name="value_patterns" expand="1"/>
<field name="value_equipment" expand="1"/>
<field name="mistake" expand="1"/>
<field name="mistake_rate" expand="1"/>
</tree>

View File

@@ -0,0 +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. -->
<data>
<xpath expr="/form/field[@name='maintenance_type']" position="after">
<label name="equipment"/>
<field name="equipment"/>
</xpath>
</data>

84
view/maintenance_form.xml Normal file
View File

@@ -0,0 +1,84 @@
<?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="company"/>
<field name="company"/>
<label name="code"/>
<field name="code"/>
<label name="propietary"/>
<field name="propietary"/>
<label name="propietary_address"/>
<field name="propietary_address"/>
<label name="maintenance_type"/>
<field name="maintenance_type"/>
<label name="equipment"/>
<field name="equipment"/>
<label name="service_maintenance"/>
<field name="service_maintenance"/>
<label name="equipment_calibrate"/>
<field name="equipment_calibrate" invisible="1"/>
<newline/>
<label name="description_activity"/>
<field name="description_activity" colspan="3"/>
<notebook colspan="6">
<page string="Preventive" id="preventive">
<label name="initial_operation"/>
<field name="initial_operation"/>
<label name="check_equipment"/>
<field name="check_equipment"/>
<label name="check_electric_system"/>
<field name="check_electric_system"/>
<label name="clean_int_ext"/>
<field name="clean_int_ext"/>
<label name="clean_eyes"/>
<field name="clean_eyes"/>
<label name="check_calibration"/>
<field name="check_calibration"/>
</page>
<page string="Corrective" id="corrective">
<field name="maintenance_lines"/>
</page>
<page string="Enviromental Conditions" id="enviromental_conditions_calibration">
<group col="4" colspan="4" id="conditions">
<label name="temperature_min"/>
<field name="temperature_min"/>
<newline/>
<label name="temperature_max"/>
<field name="temperature_max"/>
<label name="temperature_uom"/>
<field name="temperature_uom"/>
<newline/>
<label name="moisture_min"/>
<field name="moisture_min"/>
<newline/>
<label name="moisture_max"/>
<field name="moisture_max"/>
<label name="moisture_uom"/>
<field name="moisture_uom"/>
</group>
</page>
<page string="Calibration" id="calibration">
<label name="patterns_equipments"/>
<field name="patterns_equipments"/>
<newline/>
<group colspan="6" yexpand="1" id="lines_calibration">
<field name="lines_calibration"/>
<newline/>
<field name="calibration_total"/>
</group>
</page>
<page string="Graph" id="graph">
<field name="graph_calibration"/>
</page>
</notebook>
<newline/>
<label name="state"/>
<field name="state"/>
<group id="button">
<button name="in_progress"/>
<button name="finished"/>
<button name="samples"/>
<button name="calibrate"/>
</group>
</form>

View File

@@ -0,0 +1,22 @@
<?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 col="6">
<label name="line_replace"/>
<field name="line_replace"/>
<label name="line_maintenance_activity"/>
<field name="line_maintenance_activity"/>
<label name="maintenance"/>
<field name="maintenance"/>
<label name="replacement"/>
<field name="replacement"/>
<newline/>
<label name="maintenance_activity"/>
<field name="maintenance_activity"/>
<newline/>
<label name="unit"/>
<field name="unit"/>
<newline/>
<label name="quantity"/>
<field name="quantity"/>
</form>

View File

@@ -0,0 +1,10 @@
<?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.-->
<tree>
<field name="line_replace" expand="1"/>
<field name="line_maintenance_activity" expand="1"/>
<field name="replacement" expand="1"/>
<field name="maintenance_activity" expand="1"/>
<field name="quantity"/>
</tree>

View File

@@ -0,0 +1,20 @@
<?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="number_sample"/>
<field name="number_sample"/>
<newline/>
<label name="value_patterns"/>
<field name="value_patterns"/>
<label name="value_equipment"/>
<field name="value_equipment"/>
<label name="mistake"/>
<field name="mistake"/>
<label name="mistake_rate"/>
<field name="mistake_rate"/>
<label name="product"/>
<field name="product" invisible="1"/>
<label name="maintenance" />
<field name="maintenance"/>
</form>

View File

@@ -0,0 +1,68 @@
<?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 col="6">
<label name="propietary"/>
<field name="propietary"/>
<label name="propietary_address"/>
<field name="propietary_address"/>
<label name="code"/>
<field name="code"/>
<label name="description"/>
<field name="description" colspan="3"/>
<label name="reference"/>
<field name="reference"/>
<label name="sale_origin"/>
<field name="sale_origin"/>
<label name="sale_date"/>
<field name="sale_date"/>
<label name="contract_origin"/>
<field name="contract_origin"/>
<label name="maintenance_type"/>
<field name="maintenance_type"/>
<newline/>
<label name="temperature_min"/>
<field name="temperature_min"/>
<label name="temperature_max"/>
<field name="temperature_max"/>
<label name="temperature_uom"/>
<field name="temperature_uom"/>
<label name="moisture_min"/>
<field name="moisture_min"/>
<label name="moisture_max"/>
<field name="moisture_max"/>
<label name="moisture_uom"/>
<field name="moisture_uom"/>
<notebook colspan="6">
<page string="General" id="general">
<label name="state_agended"/>
<field name="state_agended"/>
<label name="technical"/>
<field name="technical"/>
<label name="estimated_agended"/>
<field name="estimated_agended"/>
</page>
<page string="Lines Of Mantenaince" id="lines_maintenance">
<field name="lines"/>
</page>
<page string="Agendes" id="agendes">
<group col="-1" id="current_agended">
<label name="current_agended"/>
<field name="current_agended"/>
</group>
<newline/>
<field name="history_agended"/>
</page>
<page string="Other Info" id="other_info">
<label name="company"/>
<field name="company"/>
</page>
</notebook>
<newline/>
<label name="state"/>
<field name="state"/>
<group id="button">
<button name="in_progress"/>
<button name="finished"/>
</group>
</form>

View File

@@ -0,0 +1,13 @@
<?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.-->
<tree>
<field name="code"/>
<field name="maintenance_type"/>
<field name="propietary"/>
<field name="propietary_address"/>
<field name="sale_origin"/>
<field name="sale_date"/>
<field name="technical"/>
<field name="lines" string="# Equipments"/>
</tree>

13
view/maintenance_tree.xml Normal file
View File

@@ -0,0 +1,13 @@
<?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.-->
<tree>
<field name="code"/>
<field name="maintenance_type" expand="0"/>
<field name="service_maintenance" expand="1"/>
<field name="propietary"/>
<field name="propietary_address"/>
<field name="equipment"/>
<field name="state"/>
<button name="finished"/>
</tree>

12
view/move_form.xml Normal file
View File

@@ -0,0 +1,12 @@
<?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="/form/field[@name='product']" position="after">
<newline/>
<label name="equipment"/>
<field name="equipment"/>
<label name="equipment_serial"/>
<field name="equipment_serial"/>
</xpath>
</data>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<!--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. -->
<data>
<xpath
expr="//field[@name='product']" position="after">
<field name="equipment"/>
<field name="equipment_serial"/>
</xpath>
</data>

View File

@@ -0,0 +1,41 @@
<?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>
<separator id="sequences" string="Sequences" colspan="4"/>
<label name="equipment_sequence"/>
<field name="equipment_sequence"/>
<newline/>
<label name="maintenance_sequence"/>
<field name="maintenance_sequence"/>
<newline/>
<label name="agended_sequence"/>
<field name="agended_sequence"/>
<newline/>
<label name="contract_sequence"/>
<field name="contract_sequence"/>
<newline/>
<label name="sale_quote_number"/>
<field name="sale_quote_number"/>
<newline/>
<separator id="environmental_conditions" string="Environmental Conditions" colspan="4"/>
<label name="temperature_min"/>
<field name="temperature_min"/>
<newline/>
<label name="temperature_max"/>
<field name="temperature_max"/>
<newline/>
<label name="temperature_uom"/>
<field name="temperature_uom"/>
<newline/>
<label name="moisture_min"/>
<field name="moisture_min"/>
<newline/>
<label name="moisture_max"/>
<field name="moisture_max"/>
<newline/>
<label name="moisture_uom"/>
<field name="moisture_uom"/>
<newline/>
</form>

View File

@@ -1,16 +1,22 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of <!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. --> this repository contains the full copyright notices and license terms. -->
<form> <form col="6">
<field name="subscription_history"/> <label name="code"/>
<field name="code"/>
<label name="company"/> <label name="company"/>
<field name="company"/> <field name="company"/>
<label name="active"/>
<field name="active"/>
<newline/>
<label name="propietary"/>
<field name="propietary"/>
<label name="propietary_address"/>
<field name="propietary_address"/>
<notebook colspan="6">
<page string="General" id="general_equipment">
<label name="location"/> <label name="location"/>
<field name="location"/> <field name="location"/>
<label name="party"/>
<field name="party"/>
<label name="party_address"/>
<field name="party_address"/>
<label name="product"/> <label name="product"/>
<field name="product"/> <field name="product"/>
<label name="equipment_type"/> <label name="equipment_type"/>
@@ -21,10 +27,13 @@
<field name="biomedical_class"/> <field name="biomedical_class"/>
<label name="calibration"/> <label name="calibration"/>
<field name="calibration"/> <field name="calibration"/>
<newline/>
<label name="mark_category"/> <label name="mark_category"/>
<field name="mark_category"/> <field name="mark_category"/>
<label name="model_category"/> <label name="model_category"/>
<field name="model_category"/> <field name="model_category"/>
<label name="reference_category"/>
<field name="reference_category"/>
<label name="refurbish"/> <label name="refurbish"/>
<field name="refurbish"/> <field name="refurbish"/>
<label name="software_version"/> <label name="software_version"/>
@@ -33,10 +42,39 @@
<field name="useful_life"/> <field name="useful_life"/>
<label name="warranty"/> <label name="warranty"/>
<field name="warranty"/> <field name="warranty"/>
<newline/>
<label name="maintenance_frequency"/>
<field name="maintenance_frequency"/>
<label name="serial"/> <label name="serial"/>
<field name="serial"/> <field name="serial"/>
<label name="health_register"/> <label name="health_register"/>
<field name="health_register"/> <field name="health_register"/>
<label name="origin_country"/> <label name="origin_country"/>
<field name="origin_country"/> <field name="origin_country"/>
</page>
<page string="Contracts" id="contract_equipment">
<field name="contract_history"/>
</page>
<page string="Maintenances" id="maintenances_equipment">
<field name="maintenance_history"/>
</page>
<page string="Propietarys" id="propietarys_equipment">
<field name="propietarys"/>
</page>
<page string="Origins" id="origins_equipment">
<separator id="purchase_origin" string="Purchase Origin" colspan="4"/>
<field name="purchase_origin"/>
<newline/>
<separator id="sale_destination" string="Sale Destination" colspan="4"/>
<field name="sale_destination"/>
<separator id="shipment_destination" string="Shipment Destination" colspan="4"/>
<field name="shipment_destination"/>
</page>
</notebook>
<group col="2" colspan="2" id="button">
<button name="draft"/>
<button name="registred"/>
</group>
<label name="state"/>
<field name="state"/>
</form> </form>

View File

@@ -0,0 +1,11 @@
<?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.-->
<tree editable="1">
<field name="code"/>
<field name="purchase_origin"/>
<field name="propietary"/>
<field name="product"/>
<field name="serial" expand="1"/>
<button name="registred"/>
</tree>

View File

@@ -2,22 +2,12 @@
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of <!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms.--> this repository contains the full copyright notices and license terms.-->
<tree> <tree>
<field name="company"/> <field name="code"/>
<field name="location"/> <field name="location"/>
<field name="party"/> <field name="propietary"/>
<field name="party_address"/> <field name="propietary_address"/>
<field name="product"/> <field name="product" expand="1"/>
<field name="equipment_type"/>
<field name="use"/>
<field name="biomedical_class"/>
<field name="calibration"/>
<field name="mark_category"/> <field name="mark_category"/>
<field name="model_category"/> <field name="model_category"/>
<field name="refurbish"/>
<field name="software_version"/>
<field name="useful_life"/>
<field name="warranty"/>
<field name="serial"/> <field name="serial"/>
<field name="health_register"/>
<field name="origin_country"/>
</tree> </tree>

7
view/pattern_form.xml Normal file
View File

@@ -0,0 +1,7 @@
<?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="pattern"/>
<field name="pattern"/>
</form>

6
view/pattern_tree.xml Normal file
View File

@@ -0,0 +1,6 @@
<?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. -->
<tree>
<field name="pattern"/>
</tree>

View File

@@ -0,0 +1,8 @@
<?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>

View File

@@ -0,0 +1,8 @@
<?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>

12
view/purchase_form.xml Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!--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. -->
<data>
<xpath
expr="/form/field[@name='invoice_address']" position="after">
<label name="equipment_create"/>
<field name="equipment_create"/>
</xpath>
<xpath expr="//button[@name='process']" position="after">
<button name="create_equipments"/>
</xpath>
</data>

View File

@@ -4,10 +4,25 @@
<xpath <xpath
expr="/form/notebook/page[@id='notes']" position="before"> expr="/form/notebook/page[@id='notes']" position="before">
<page string="Equipment" id="equipment"> <page string="Equipment" id="equipment">
<label name="address_equipment"/>
<field name="address_equipment"/>
<newline/>
<label name="serial_equipment"/> <label name="serial_equipment"/>
<field name="serial_equipment"/> <field name="serial_equipment"/>
<newline/>
<label name="software_version"/>
<field name="software_version"/>
<newline/>
<label name="health_register"/>
<field name="health_register"/>
<newline/>
<label name="refurbish"/> <label name="refurbish"/>
<field name="refurbish"/> <field name="refurbish"/>
</page> </page>
</xpath> </xpath>
<xpath
expr="/form/notebook/page[@id='general']/field[@name='product']" position="after">
<label name="product_equipment"/>
<field name="product_equipment"/>
</xpath>
</data> </data>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level
this repository contains the full copyright notices and license terms. -->
<form>
<label name="maintenance_service"/>
<field name="maintenance_service"/>
<newline/>
<label name="estimated_agended"/>
<field name="estimated_agended" colspan="3" widget="date"/>
<newline/>
<label name="estimated_agended" string="Hora:"/>
<field name="estimated_agended" colspan="3" widget="time"/>
<newline/>
<label name="technical"/>
<field name="technical"/>
</form>

20
view/sale_form.xml Normal file
View File

@@ -0,0 +1,20 @@
<?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="//label[@name='number']" position="before">
<label name="quote_number"/>
<field name="quote_number"/>
</xpath>
<xpath expr="//field[@name='reference']" position="after">
<newline/>
<label name="sale_type"/>
<field name="sale_type"/>
<label name="maintenance_type"/>
<field name="maintenance_type"/>
<label name="agended"/>
<field name="agended"/>
<label name="contract_ref"/>
<field name="contract_ref"/>
</xpath>
</data>

View File

@@ -1,11 +1,22 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!--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. --> <!--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. -->
<data> <data>
<!--
<xpath <xpath
expr="/form/notebook/page[@id='notes']" position="before"> expr="/form/notebook/page[@id='notes']" position="before">
<page string="Equipment" id="equipment"> <page string="Equipment" id="equipment">
<label name="address_equipment"/>
<field name="address_equipment"/>
</page> </page>
</xpath> </xpath>
<xpath
expr="/form/notebook/page[@id='general']/label[@name='product']" position="before">
<label name="product_equipment"/>
<field name="product_equipment"/>
</xpath>
<xpath
expr="/form/notebook/page[@id='general']/field[@name='product']" position="after">
<label name="equipment"/>
<field name="equipment"/>
<label name="equipment_serial"/>
<field name="equipment_serial"/>
</xpath>-->
</data> </data>

6
view/sale_line_tree.xml Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<data>
<xpath expr="//field[@name='summary']" position="replace">
<field name="equipment"/>
</xpath>
</data>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<data>
<xpath expr="//field[@name='summary']" position="replace">
<field name="equipment_serial"/>
</xpath>
</data>

11
view/sale_tree.xml Normal file
View File

@@ -0,0 +1,11 @@
<?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='number']" position="before">
<field name="quote_number"/>
</xpath>
<xpath expr="//field[@name='number']" position="replace">
<field name="number"/>
</xpath>
</data>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!--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. -->
<data>
<xpath
expr="//field[@name='warehouse']" position="after">
<newline/>
<label name="service_maintenance_initial"/>
<field name="service_maintenance_initial"/>
</xpath>
<xpath
expr="//button[@name='wait']" position="after">
<button name="maintenance_initial"/>
</xpath>
</data>

View File

@@ -1,6 +1,12 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!--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. --> <!--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. -->
<data> <data>
<xpath
expr="//label[@name='party']" position="before">
<label name="type"/>
<field name="type"/>
<newline/>
</xpath>
<xpath <xpath
expr="/form/notebook/page[@id='subscription']" position="after"> expr="/form/notebook/page[@id='subscription']" position="after">
<page string="Equipments" id="equipments_subscription"> <page string="Equipments" id="equipments_subscription">

View File

@@ -5,17 +5,20 @@ this repository contains the full copyright notices and license terms. -->
<xpath expr="/form/notebook/page[@id='general']/group[@id='checkboxes']" position="inside"> <xpath expr="/form/notebook/page[@id='general']/group[@id='checkboxes']" position="inside">
<label name="equipment"/> <label name="equipment"/>
<field name="equipment"/> <field name="equipment"/>
<label name="replacement"/>
<field name="replacement"/>
<label name="maintenance_activity"/>
<field name="maintenance_activity"/>
</xpath> </xpath>
<xpath expr="/form/notebook/page[@id='general']" position="after"> <xpath expr="/form/notebook/page[@id='general']" position="after">
<page string="Features" id="features"> <page string="Features" id="features">
<newline/>
<label name="mark_category"/> <label name="mark_category"/>
<field name="mark_category"/> <field name="mark_category"/>
<label name="model_category"/> <label name="model_category"/>
<field name="model_category"/> <field name="model_category"/>
<label name="serial"/> <label name="reference_category"/>
<field name="serial"/> <field name="reference_category"/>
<label name="health_register"/>
<field name="health_register"/>
<label name="equipment_type"/> <label name="equipment_type"/>
<field name="equipment_type"/> <field name="equipment_type"/>
<label name="calibration"/> <label name="calibration"/>
@@ -30,35 +33,102 @@ this repository contains the full copyright notices and license terms. -->
<field name="origin_country"/> <field name="origin_country"/>
<label name="main_tecnology"/> <label name="main_tecnology"/>
<field name="main_tecnology"/> <field name="main_tecnology"/>
<label name="software_required"/>
<field name="software_required"/>
<label name="software_version"/> <label name="software_version"/>
<field name="software_version"/> <field name="software_version"/>
<label name="useful_life"/> <label name="useful_life"/>
<field name="useful_life"/> <field name="useful_life"/>
<label name="warranty"/> <label name="warranty"/>
<field name="warranty"/> <field name="warranty"/>
<newline/>
<label name="observation"/> <label name="observation"/>
<field name="observation"/> <field name="observation"/>
</page> </page>
</xpath> </xpath>
<xpath expr="/form/notebook/page[@id='measurements']" position="inside"> <xpath expr="/form/notebook/page[@id='features']" position="after">
<page string="Calibration" id="calibration">
<newline/>
<label name="calibration"/>
<field name="calibration"/>
<newline/>
<label name="uncertainy_pattern"/>
<field name="uncertainy_pattern"/>
<newline/>
<label name="use_pattern"/>
<field name="use_pattern"/>
<label name="k_pattern"/>
<field name="k_pattern"/>
<newline/>
<label name="k_pattern_list"/>
<field name="k_pattern_list"/>
<newline/>
<label name="measuring_range"/>
<field name="measuring_range"/>
<newline/>
<label name="MEP"/>
<field name="MEP"/>
<newline/>
<label name="resolution_type"/>
<field name="resolution_type"/>
<newline/>
<label name="d_resolution"/>
<field name="d_resolution"/>
<newline/>
<label name="a_factor_resolution"/>
<field name="a_factor_resolution"/>
<newline/>
<label name="analog_resolution"/>
<field name="analog_resolution"/>
<newline/>
<label name="Usubi"/>
<field name="Usubi"/>
</page>
<page string="Maintenance Activities" id="maintenance_activities">
<label name="initial_operation"/>
<field name="initial_operation"/>
<label name="check_equipment"/>
<field name="check_equipment"/>
<label name="check_electric_system"/>
<field name="check_electric_system"/>
<label name="clean_int_ext"/>
<field name="clean_int_ext"/>
<label name="clean_eyes"/>
<field name="clean_eyes"/>
<label name="check_calibration"/>
<field name="check_calibration"/>
</page>
</xpath>
<xpath expr="/form/notebook/page[@id='measurements']/label[@name='length']" position="before">
<separator id="measurements_equipment" string="Measurements of Equipment" colspan="4"/>
</xpath>
<xpath
expr="/form/notebook/page[@id='measurements']" position="inside">
<separator id="enviromental_working_conditions" string="Enviromental Working Conditions" colspan="4"/>
<separator id="enviromental_conditions" string="Enviromental Conditions" colspan="4"/> <label name="temperature_min"/>
<field name="temperature_min"/>
<label name="temperature"/> <newline/>
<field name="temperature"/> <label name="temperature_max"/>
<field name="temperature_max"/>
<field name="temperature_uom"/> <field name="temperature_uom"/>
<newline/>
<label name="wet"/> <label name="moisture_min"/>
<field name="wet"/> <field name="moisture_min"/>
<field name="wet_uom"/> <newline/>
<label name="moisture_max"/>
<field name="moisture_max"/>
<field name="moisture_uom"/>
<separator id="electrical_conditions" string="Electrical Conditions" colspan="4"/> <separator id="electrical_conditions" string="Electrical Conditions" colspan="4"/>
<label name="electrical_equipment"/>
<field name="electrical_equipment"/>
<newline/>
<label name="frequency"/> <label name="frequency"/>
<field name="frequency"/> <field name="frequency"/>
<field name="frequency_uom"/> <field name="frequency_uom"/>
<label name="voltageAC"/> <label name="voltageAC"/>
<field name="voltageAC"/> <field name="voltageAC"/>
<field name="voltageAC_uom"/> <field name="voltageAC_uom"/>