patch: update % delievered and % billed in SO if pos made against that so

This commit is contained in:
Nabin Hait 2012-11-28 12:40:52 +05:30
parent ef71940d58
commit d9eb526b27
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,15 @@
def execute():
import webnotes
from webnotes.model.code import get_obj
sc_obj = get_obj("Sales Common")
si = webnotes.conn.sql("""select si.name
from `tabSales Invoice` si, `tabSales Invoice Item` si_item
where si_item.parent = si.name
and si.docstatus = 1
and ifnull(si.is_pos, 0) = 1
and ifnull(si_item.sales_order, '') != ''
""")
for d in si:
sc_obj.update_prevdoc_detail(1, get_obj("Sales Invoice", d[0], with_children=1))

View File

@ -691,4 +691,8 @@ patch_list = [
'patch_module': 'patches.november_2012',
'patch_file': 'communication_sender_and_recipient',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'update_delivered_billed_percentage_for_pos',
},
]