profile: form is now my settings page, removed (Page, profile-settings)

This commit is contained in:
Rushabh Mehta 2012-11-28 15:21:04 +05:30
commit 40d73ed9db
4 changed files with 53 additions and 11 deletions

View File

@ -396,6 +396,11 @@ class DocType(TransactionBase):
msgprint("Please enter Item Code at line no : %s to update stock for POS or remove check from Update Stock in Basic Info Tab." % (d.idx))
raise Exception
def validate_delivery_note(self):
for d in self.doclist.get({"parentfield": "entries"}):
if d.delivery_note:
msgprint("""POS can not be made against Delivery Note""", raise_exception=1)
def validate_write_off_account(self):
if flt(self.doc.write_off_amount) and not self.doc.write_off_account:
@ -447,6 +452,7 @@ class DocType(TransactionBase):
sl.validate_serial_no(self, 'packing_details')
self.validate_item_code()
self.update_current_stock()
self.validate_delivery_note()
self.set_in_words()
if not self.doc.is_opening:
self.doc.is_opening = 'No'
@ -505,7 +511,9 @@ class DocType(TransactionBase):
self.doclist = self.doc.clear_table(self.doclist, 'packing_details')
webnotes.conn.set(self.doc,'paid_amount',0)
webnotes.conn.set(self.doc,'outstanding_amount',flt(self.doc.grand_total) - flt(self.doc.total_advance) - flt(self.doc.paid_amount) - flt(self.doc.write_off_amount))
webnotes.conn.set(self.doc, 'outstanding_amount',
flt(self.doc.grand_total) - flt(self.doc.total_advance) -
flt(self.doc.paid_amount) - flt(self.doc.write_off_amount))
def check_prev_docstatus(self):
@ -604,13 +612,13 @@ class DocType(TransactionBase):
self.update_stock_ledger(update_stock=1)
else:
self.check_prev_docstatus()
get_obj("Sales Common").update_prevdoc_detail(1,self)
# Check for Approving Authority
if not self.doc.recurring_id:
get_obj('Authorization Control').validate_approving_authority(self.doc.doctype, self.doc.company, self.doc.grand_total, self)
self.check_prev_docstatus()
get_obj("Sales Common").update_prevdoc_detail(1,self)
# this sequence because outstanding may get -ve
self.make_gl_entries()
@ -628,7 +636,7 @@ class DocType(TransactionBase):
sl.update_serial_record(self, 'packing_details', is_submit = 0, is_incoming = 0)
self.update_stock_ledger(update_stock = -1)
else:
sales_com_obj = get_obj(dt = 'Sales Common')
sales_com_obj.check_stop_sales_order(self)
self.check_next_docstatus()

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 distinct 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,6 +691,10 @@ 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',
},
{
'patch_module': 'patches.november_2012',
'patch_file': 'add_theme_to_profile',

View File

@ -830,6 +830,21 @@ class StatusUpdater:
'keyword' :'Billed'
})
if cint(self.obj.doc.is_pos) == 1:
self.update_qty({
'target_field' :'delivered_qty',
'target_dt' :'Sales Order Item',
'target_parent_dt' :'Sales Order',
'target_parent_field' :'per_delivered',
'target_ref_field' :'qty',
'source_dt' :'Sales Invoice Item',
'source_field' :'qty',
'join_field' :'so_detail',
'percent_join_field' :'sales_order',
'status_field' :'delivery_status',
'keyword' :'Delivered'
})
if self.obj.doc.doctype=='Installation Note':
self.update_qty({
'target_field' :'installed_qty',