Require permission to adjust price
also prevent adjustment for void lines etc.
This commit is contained in:
		
							parent
							
								
									aab3d9498d
								
							
						
					
					
						commit
						7b73438cf9
					
				
					 1 changed files with 16 additions and 3 deletions
				
			
		|  | @ -1080,6 +1080,19 @@ class POSView(WuttaView): | ||||||
|             self.page.update() |             self.page.update() | ||||||
|             return |             return | ||||||
| 
 | 
 | ||||||
|  |         row = self.selected_item.data['row'] | ||||||
|  |         if row.void or row.row_type not in (self.enum.POS_ROW_TYPE_SELL, | ||||||
|  |                                             self.enum.POS_ROW_TYPE_OPEN_RING): | ||||||
|  |             self.show_snackbar("This item cannot be adjusted", bgcolor='yellow') | ||||||
|  |             self.main_input.focus() | ||||||
|  |             self.page.update() | ||||||
|  |             return | ||||||
|  | 
 | ||||||
|  |         self.authorized_action('pos.override_price', self.adjust_price, | ||||||
|  |                                message="Adjust Price") | ||||||
|  | 
 | ||||||
|  |     def adjust_price(self, user): | ||||||
|  | 
 | ||||||
|         def cancel(e): |         def cancel(e): | ||||||
|             dlg.open = False |             dlg.open = False | ||||||
|             self.main_input.focus() |             self.main_input.focus() | ||||||
|  | @ -1292,9 +1305,9 @@ class POSView(WuttaView): | ||||||
|             dlg.open = False |             dlg.open = False | ||||||
|             self.page.update() |             self.page.update() | ||||||
| 
 | 
 | ||||||
|             # # nb. just in case? |             # nb. just in case next step requires a dialog | ||||||
|             # # cf. https://github.com/flet-dev/flet/issues/1670 |             # cf. https://github.com/flet-dev/flet/issues/1670 | ||||||
|             # time.sleep(0.1) |             time.sleep(0.1) | ||||||
| 
 | 
 | ||||||
|             action(user) |             action(user) | ||||||
|             self.reset() |             self.reset() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar