Fall 4608: Change Requests - Workshop vom 09.01.2018, US03 umgesetzt.
							parent
							
								
									b661b49867
								
							
						
					
					
						commit
						0768e4ec7a
					
				| 
						 | 
				
			
			@ -67,3 +67,24 @@ class AccountInvoice(models.Model):
 | 
			
		|||
                if line.uom_id == self.env.ref('product.product_uom_unit'): # wenn die Mengeneinheit Stk. ist
 | 
			
		||||
                    num_items += line.quantity
 | 
			
		||||
            record.num_items = num_items
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class AccountInvoiceReport(models.Model):
 | 
			
		||||
    _inherit = "account.invoice.report"
 | 
			
		||||
 | 
			
		||||
    commission_user_id = fields.Many2one('res.users', string='Provisionsempfänger', readonly=True)
 | 
			
		||||
 | 
			
		||||
    def _select(self):
 | 
			
		||||
        res = super(AccountInvoiceReport, self)._select()
 | 
			
		||||
        res += ', sub.commission_user_id as commission_user_id'
 | 
			
		||||
        return res
 | 
			
		||||
 | 
			
		||||
    def _sub_select(self):
 | 
			
		||||
        res = super(AccountInvoiceReport, self)._sub_select()
 | 
			
		||||
        res += ', partner.commission_user_id'
 | 
			
		||||
        return res
 | 
			
		||||
 | 
			
		||||
    def _group_by(self):
 | 
			
		||||
        res = super(AccountInvoiceReport, self)._group_by()
 | 
			
		||||
        res += ', partner.commission_user_id'
 | 
			
		||||
        return res
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -62,12 +62,18 @@ class Partner(models.Model):
 | 
			
		|||
    date_vat_check = fields.Date(string='Datum der letzten UID-Prüfung')
 | 
			
		||||
    collective_bill = fields.Boolean(string='Sammelrechnung', default=True)
 | 
			
		||||
    country_id = fields.Many2one('res.country', string='Country', ondelete='restrict', default=_default_country_id)
 | 
			
		||||
    commission_user_id = fields.Many2one('res.users', string='Provisionsempfänger')
 | 
			
		||||
 | 
			
		||||
    _sql_constraints = [
 | 
			
		||||
        ('ref_uniq', 'unique(ref)', 'Die Interne Referenz muss eindeutig sein'),
 | 
			
		||||
        ('portal_id_uniq', 'unique(portal_id)', 'Die Portal-ID muss eindeutig sein')
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
    @api.model
 | 
			
		||||
    def _commercial_fields(self):
 | 
			
		||||
        res = super(Partner, self)._commercial_fields()
 | 
			
		||||
        return res + ['commission_user_id']
 | 
			
		||||
 | 
			
		||||
    @api.one
 | 
			
		||||
    @api.constrains('is_company', 'vat')
 | 
			
		||||
    def _check_unique_vat(self):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -58,6 +58,9 @@
 | 
			
		|||
            <xpath expr="//field[@name='property_payment_term_id']" position="before">
 | 
			
		||||
                <field name="collective_bill"/>
 | 
			
		||||
            </xpath>
 | 
			
		||||
            <field name="user_id" position="after">
 | 
			
		||||
                <field name="commission_user_id"/>
 | 
			
		||||
            </field>
 | 
			
		||||
        </field>
 | 
			
		||||
    </record>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue