def get_extra_query(self, states): query = PurchaseOrderView.status == PurchaseOrder.ORDER_CONFIRMED # Dont let the user receive purchases from other branches when working # in synchronized mode if (api.sysparam.get_bool('SYNCHRONIZED_MODE') and not api.can_see_all_branches()): branch = api.get_current_branch(self.store) query = And(query, PurchaseOrderView.branch_id == branch.id) return query
def get_extra_query(self, states): query = And(Eq(PurchaseReceivingView.purchase_group, None), Eq(PurchaseReceivingView.receiving_invoice, None)) # Dont let the user receive purchases from other branches when working # in synchronized mode if (api.sysparam.get_bool('SYNCHRONIZED_MODE') and not api.can_see_all_branches()): branch = api.get_current_branch(self.store) query = And(query, PurchaseReceivingView.branch_id == branch.id) return query
def _fill_branch_combo(self): branches = Branch.get_active_branches(self.store) self.branch.prefill(api.for_person_combo(branches)) self.branch.set_sensitive(api.can_see_all_branches())