pass branch_id to get the right number of GI
parent
464470f2af
commit
b9f8fbdd46
|
@ -14,8 +14,8 @@
|
|||
<field name="account_products" nolabel="1">
|
||||
<list>
|
||||
<field name="patient_type_id"/>
|
||||
<field name="ar_debit_id"/>
|
||||
<field name="ar_credit_id"/>
|
||||
<field name="ar_debit_id" domain='[["type","!=","view"]]'/>
|
||||
<field name="ar_credit_id" domain='[["type","!=","view"]]'/>
|
||||
<field name="type"/>
|
||||
</list>
|
||||
</field>
|
||||
|
|
|
@ -7,5 +7,6 @@
|
|||
#from . import restore_picking
|
||||
#from . import rename_dbl_hdcase_number
|
||||
#from . import reset_hdcase_number
|
||||
from . import remove_dbl_contact
|
||||
from . import update_invoice
|
||||
#from . import remove_dbl_contact
|
||||
#from . import update_invoice
|
||||
from . import update_pick_out_number
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
from netforce.model import get_model
|
||||
from netforce import migration
|
||||
from netforce.access import set_active_user, set_active_company
|
||||
from netforce.database import get_connection
|
||||
|
||||
class Migration(migration.Migration):
|
||||
_name="clinic.update.pick.out.number"
|
||||
_version="2.12.5"
|
||||
|
||||
def migrate(self):
|
||||
set_active_company(1)
|
||||
set_active_user(1)
|
||||
db=get_connection()
|
||||
count=0
|
||||
for pick in get_model('stock.picking').search_browse([]):
|
||||
journal=pick.journal_id
|
||||
sequence=journal.sequence_id
|
||||
branch=sequence.branch_id
|
||||
prefix=sequence.prefix
|
||||
if prefix not in pick.number:
|
||||
new_number=pick.number.replace(pick.number[0:6],prefix)
|
||||
pick.write({
|
||||
'number': new_number,
|
||||
})
|
||||
count+=1
|
||||
print("update %s to %s"%(pick.number, new_number))
|
||||
print("total ", count)
|
||||
|
||||
Migration.register()
|
|
@ -866,7 +866,8 @@ class HDCase(Model):
|
|||
context={
|
||||
'pick_type': 'out',
|
||||
'journal_id': pick_vals['journal_id'],
|
||||
'date': obj.date
|
||||
'date': obj.date,
|
||||
'branch_id': obj.branch_id.id,
|
||||
}
|
||||
pick_id=picking_obj.create(pick_vals,context=context)
|
||||
pick=picking_obj.browse(pick_id)
|
||||
|
|
Loading…
Reference in New Issue