-:WIP:-Part A
1
Get List of Machines from mdc_mach table on postgresql
select name from
mdc_machines where type = 1 Store each machine type in a sep List inside a Dictionary
{
'Ex':[MDC Excavator 1, .....],
'WL':[],
'Trucks':[]....
}2
Check returned list in Access Db for new Machines
select mach.name, owner from
mdc_machines as mm where mach.name not in (RETURNED LIST) This has to be done for each mach_type as the tables in access are separate for each.The new Machines should be appended into a List
[['0981','GA-09-0981','Owner'],['WL223','', 'Owner'],...] And a second List with only Owner NamesCheck if all owners are present: [What about change in owners?]Query Postgresql to see if all the names are presentselect name from
res_partner where lower(name) in (lower('AsUstek')) Count of the rows should be equal to that of the owner listIf less then then some owners are not present in openerp
Compare list to query result and find the missing owner add to owner_exlistFor each Owner in the exlist get - Name, Address, Phone details and create a Partner in Openerp Now that all Owners are in the system Start Import of machines
Insert New Machines into mdc_machines directly and assoc with the site in mdc_site_machines
4
Check all Machines in access are assoc with the same site in Postgres
select mach.name from
mdc_site_machines as msm
inner join
mdc_machines as mach
on msm.mach_id = mach.id
where msm.site_id = 15
Check returned list in Access Db - The Result should be 0
In the previous steps all machines in the access db were updated in Postgres. If a machine is returned here then that mach exists in the Openerp but is assoc with another site.
This has to be rectified manually as the reason for this move needs to be obtained select mach.name, owner from
mdc_machines as mm where mach.name not in (RETURNED LIST)
IF STEP 5 returns 0 then Proceed or Terminate Here
Part B
B-1
Check if the Dist Codes are in the SystemB-2 ====>not a good idea - add manually -awareness
Import New Dist Codes
B-3
Check if the Ore Types are in the system
B-4 ====>not a good idea - add manually -awareness
Import New Ore Types
site pits?
operator?
supervisor?
Part
-1
Check for New MDLs1
Get List of MDL + Date + Machine Names in Postgresql db select mdl.date, mach.name from mdc_mdl as mdl inner join mdc_machines
as mach on mdl.mach_id = mach.id where mdl.site_id = 1
2
Compare the Returned list with the access db *select mdl.date, mach.name from mdc_mdl as mdl inner join mdc_machines
as mach on mdl.mach_id = mach.id where mdl.site_id = 1 and date not in (RETURNED LIST - DATE VAUES)
3
Store List of MDL Date- Machines that need to be imported from Access4
For each (One Transaction if Possible):
Get the MDL and Trips for the New MDL
Ex/WL
PV
WtankerInsert the New MDL+Trips directly into MDL/Trips/Log Hours on Postgresql
1
Get List of Machines from mdc_mach table on postgresql
select name from
mdc_machines where type = 1 Store each machine type in a sep List inside a Dictionary
{
'Ex':[MDC Excavator 1, .....],
'WL':[],
'Trucks':[]....
}2
Check returned list in Access Db for new Machines
select mach.name, owner from
mdc_machines as mm where mach.name not in (RETURNED LIST) This has to be done for each mach_type as the tables in access are separate for each.The new Machines should be appended into a List
[['0981','GA-09-0981','Owner'],['WL223','', 'Owner'],...] And a second List with only Owner NamesCheck if all owners are present: [What about change in owners?]Query Postgresql to see if all the names are presentselect name from
res_partner where lower(name) in (lower('AsUstek')) Count of the rows should be equal to that of the owner listIf less then then some owners are not present in openerp
Compare list to query result and find the missing owner add to owner_exlistFor each Owner in the exlist get - Name, Address, Phone details and create a Partner in Openerp Now that all Owners are in the system Start Import of machines
Insert New Machines into mdc_machines directly and assoc with the site in mdc_site_machines
4
Check all Machines in access are assoc with the same site in Postgres
select mach.name from
mdc_site_machines as msm
inner join
mdc_machines as mach
on msm.mach_id = mach.id
where msm.site_id = 15
Check returned list in Access Db - The Result should be 0
In the previous steps all machines in the access db were updated in Postgres. If a machine is returned here then that mach exists in the Openerp but is assoc with another site.
This has to be rectified manually as the reason for this move needs to be obtained select mach.name, owner from
mdc_machines as mm where mach.name not in (RETURNED LIST)
IF STEP 5 returns 0 then Proceed or Terminate Here
Part B
B-1
Check if the Dist Codes are in the SystemB-2 ====>not a good idea - add manually -awareness
Import New Dist Codes
B-3
Check if the Ore Types are in the system
B-4 ====>not a good idea - add manually -awareness
Import New Ore Types
site pits?
operator?
supervisor?
Part
-1
Check for New MDLs1
Get List of MDL + Date + Machine Names in Postgresql db select mdl.date, mach.name from mdc_mdl as mdl inner join mdc_machines
as mach on mdl.mach_id = mach.id where mdl.site_id = 1
2
Compare the Returned list with the access db *select mdl.date, mach.name from mdc_mdl as mdl inner join mdc_machines
as mach on mdl.mach_id = mach.id where mdl.site_id = 1 and date not in (RETURNED LIST - DATE VAUES)
3
Store List of MDL Date- Machines that need to be imported from Access4
For each (One Transaction if Possible):
Get the MDL and Trips for the New MDL
Ex/WL
PV
WtankerInsert the New MDL+Trips directly into MDL/Trips/Log Hours on Postgresql
