Remove permission error when changing a supplier invoice to draft

This commit is contained in:
Carlos G?lvez 2019-10-10 14:57:21 +02:00
parent bc742fd7fc
commit 849cc20113
2 changed files with 26 additions and 1 deletions

25
038993.diff Normal file
View File

@ -0,0 +1,25 @@
OK: All Patches removed
[sale]
diff -r 5fae8484652f invoice.py
--- a/trytond/trytond/modules/sale/invoice.py Sat Nov 24 23:54:47 2018 +0100
+++ b/trytond/trytond/modules/sale/invoice.py Thu Oct 10 08:38:20 2019 +0200
@@ -108,12 +108,9 @@
@classmethod
@Workflow.transition('draft')
def draft(cls, invoices):
- Sale = Pool().get('sale.sale')
- sales = Sale.search([
- ('invoices', 'in', [i.id for i in invoices]),
- ])
- if sales and any(i.state == 'cancel' for i in invoices):
- cls.raise_user_error('reset_invoice_sale')
+ for invoice in invoices:
+ if invoice.sales and invoice.state == 'cancel':
+ cls.raise_user_error('reset_invoice_sale')
return super(Invoice, cls).draft(invoices)
Git diff not implented
OK: All Patches Applied

2
series
View File

@ -81,5 +81,5 @@ issue8058.diff # [stock_supply_production] Can't create productions from request
#issue7334.diff # [trytond] read history that created_date is before the requested create_date
issue8038.diff # [sale_supply_drop_shipment] Crash when process a purchase from purchase request created from a sale
change_key_tax.diff # Change the key tax use to not separrete refunds and invoiceds on the same invocie, as in v5.2 do
038993.diff # [sale] Remove permission error when changing a supplier invoice to draft