Fall 5557: Änderungswünsche vom Workshop Termin am 12.04.2018
							parent
							
								
									2411057beb
								
							
						
					
					
						commit
						4b9629d9b0
					
				|  | @ -393,12 +393,28 @@ class SaleOrderLine(models.Model): | ||||||
|     from_designbox = fields.Boolean(string='I', readonly=True, help='Import von externem System') |     from_designbox = fields.Boolean(string='I', readonly=True, help='Import von externem System') | ||||||
|     product_id = fields.Many2one(domain=[('sale_ok', '=', True), ('can_be_sold_unconfigured', '=', True)]) |     product_id = fields.Many2one(domain=[('sale_ok', '=', True), ('can_be_sold_unconfigured', '=', True)]) | ||||||
|     weight = fields.Float(string='Gewicht', compute='_compute_weight') |     weight = fields.Float(string='Gewicht', compute='_compute_weight') | ||||||
|     intrastat_id = fields.Many2one(comodel_name='report.intrastat.code', string='Intrastat Code', |     intrastat_id = fields.Many2one(comodel_name='report.intrastat.code', string='Intrastat Code') | ||||||
|                                    compute="_compute_intrastat_id") | 
 | ||||||
|  |     @api.model | ||||||
|  |     def create(self, vals): | ||||||
|  |         if vals.get('intrastat_id', None) is None: | ||||||
|  |             if vals.get('lot_id', False): | ||||||
|  |                 vals.update(intrastat_id=self.env['stock.production.lot'].browse(vals['lot_id']).intrastat_id.id) | ||||||
|  |             elif vals.get('product_id', False): | ||||||
|  |                 vals.update(intrastat_id=self.env['product.template'].browse(vals['product_id']).intrastat_id.id) | ||||||
|  |         return super(SaleOrderLine, self).create(vals) | ||||||
| 
 | 
 | ||||||
|     @api.multi |     @api.multi | ||||||
|     def write(self, vals): |     def write(self, vals): | ||||||
|         for record in self: |         for record in self: | ||||||
|  |             lot_id = record.lot_id if 'lot_id' not in vals else vals.get('lot_id', False) | ||||||
|  |             if vals.get('intrastat_id', False) and lot_id: | ||||||
|  |                 self.env['stock.production.lot'].browse([vals.get('lot_id', False)]).write({ | ||||||
|  |                     'intrastat_id': vals.get('intrastat_id') | ||||||
|  |                 }) | ||||||
|  |             elif vals.get('intrastat_id', False) and not lot_id: | ||||||
|  |                 raise UserError(_('Der Intrastrat Code kann nur gesetzt werden wenn ein Lot angegeben wurde.')) | ||||||
|  | 
 | ||||||
|             if record.from_designbox and set(vals.keys()).intersection( |             if record.from_designbox and set(vals.keys()).intersection( | ||||||
|                     ['product_uom_qty', 'product_uom', 'price_unit']): |                     ['product_uom_qty', 'product_uom', 'price_unit']): | ||||||
|                 raise ValidationError(_("Menge und Preis können von Produkten aus der Designbox nicht geändert werden")) |                 raise ValidationError(_("Menge und Preis können von Produkten aus der Designbox nicht geändert werden")) | ||||||
|  | @ -430,11 +446,6 @@ class SaleOrderLine(models.Model): | ||||||
|         for record in self: |         for record in self: | ||||||
|             record.weight = record.lot_id.weight or record.product_id.weight |             record.weight = record.lot_id.weight or record.product_id.weight | ||||||
| 
 | 
 | ||||||
|     @api.multi |  | ||||||
|     def _compute_intrastat_id(self): |  | ||||||
|         for record in self: |  | ||||||
|             record.intrastat_id = record.lot_id.intrastat_id.id or record.product_id.intrastat_id.id |  | ||||||
| 
 |  | ||||||
|     @api.multi |     @api.multi | ||||||
|     def _prepare_invoice_line(self, qty): |     def _prepare_invoice_line(self, qty): | ||||||
|         self.ensure_one() |         self.ensure_one() | ||||||
|  |  | ||||||
|  | @ -25,10 +25,16 @@ | ||||||
|                     <field name="assembly_notes"/> |                     <field name="assembly_notes"/> | ||||||
|                 </group> |                 </group> | ||||||
|             </field> |             </field> | ||||||
|  |             <xpath expr="//field[@name='order_line']/form//field[@name='name']" position="after"> | ||||||
|  |                 <field name="intrastat_id"/> | ||||||
|  |             </xpath> | ||||||
|             <xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="after"> |             <xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="after"> | ||||||
|                 <field name="lot_id"/> |                 <field name="lot_id"/> | ||||||
|                 <field name="from_designbox"/> |                 <field name="from_designbox"/> | ||||||
|             </xpath> |             </xpath> | ||||||
|  |             <xpath expr="//field[@name='order_line']/tree//field[@name='name']" position="after"> | ||||||
|  |                 <field name="intrastat_id"/> | ||||||
|  |             </xpath> | ||||||
|             <xpath expr="//field[@name='order_line']/tree//field[@name='product_id']" position="after"> |             <xpath expr="//field[@name='order_line']/tree//field[@name='product_id']" position="after"> | ||||||
|                 <field name="lot_id" options="{'no_open': True}"/> |                 <field name="lot_id" options="{'no_open': True}"/> | ||||||
|                 <button name="action_show_lot" string="Lot" type="object" icon="fa-list" |                 <button name="action_show_lot" string="Lot" type="object" icon="fa-list" | ||||||
|  | @ -131,6 +137,7 @@ | ||||||
|             <filter name="customer" position="after"> |             <filter name="customer" position="after"> | ||||||
|                 <filter string="PG Status" domain="[]" context="{'group_by':'assembly_state'}"/> |                 <filter string="PG Status" domain="[]" context="{'group_by':'assembly_state'}"/> | ||||||
|                 <filter string="Rechnungsadresse" domain="[]" context="{'group_by':'partner_invoice_id'}"/> |                 <filter string="Rechnungsadresse" domain="[]" context="{'group_by':'partner_invoice_id'}"/> | ||||||
|  |                 <filter string="Auftragsart" domain="[]" context="{'group_by':'order_type'}"/> | ||||||
|             </filter> |             </filter> | ||||||
|         </field> |         </field> | ||||||
|     </record> |     </record> | ||||||
|  |  | ||||||
|  | @ -138,11 +138,15 @@ | ||||||
|                                             <span t-esc="pos_nr"/> |                                             <span t-esc="pos_nr"/> | ||||||
|                                         </td> |                                         </td> | ||||||
|                                         <td class="text-right"> |                                         <td class="text-right"> | ||||||
|                                             <span t-esc="o._formatLang(invoice_line.quantity, False).strip('0').strip(',')"/> |                                             <t t-if="invoice_line.quantity"> | ||||||
|  |                                                 <span t-esc="o._formatLang(invoice_line.quantity, False).strip('0').strip(',').strip('.')"/> | ||||||
|  |                                             </t> | ||||||
|                                         </td> |                                         </td> | ||||||
|                                         <td class="text-right"> |                                         <td class="text-right"> | ||||||
|                                             <span t-field="invoice_line.weight"/> |                                             <t t-if="invoice_line.weight"> | ||||||
|                                             kg |                                                 <span t-field="invoice_line.weight"/> | ||||||
|  |                                                 kg | ||||||
|  |                                             </t> | ||||||
|                                         </td> |                                         </td> | ||||||
|                                         <td class="text-right"/> |                                         <td class="text-right"/> | ||||||
|                                         <td class="text-left"> |                                         <td class="text-left"> | ||||||
|  |  | ||||||
|  | @ -127,11 +127,15 @@ | ||||||
|                                     <span t-esc="pos_nr"/> |                                     <span t-esc="pos_nr"/> | ||||||
|                                 </td> |                                 </td> | ||||||
|                                 <td class="text-right"> |                                 <td class="text-right"> | ||||||
|                                     <span t-esc="o._formatLang(order_line.product_uom_qty, False).strip('0').strip(',')"/> |                                     <t t-if="order_line.product_uom_qty"> | ||||||
|  |                                         <span t-esc="o._formatLang(order_line.product_uom_qty, False).strip('0').strip(',').strip('.')"/> | ||||||
|  |                                     </t> | ||||||
|                                 </td> |                                 </td> | ||||||
|                                 <td class="text-right"> |                                 <td class="text-right"> | ||||||
|                                     <span t-field="order_line.weight"/> |                                     <t t-if="order_line.weight"> | ||||||
|                                     kg |                                         <span t-field="order_line.weight"/> | ||||||
|  |                                         kg | ||||||
|  |                                     </t> | ||||||
|                                 </td> |                                 </td> | ||||||
|                                 <td class="text-right"> |                                 <td class="text-right"> | ||||||
|                                 </td> |                                 </td> | ||||||
|  | @ -232,7 +236,7 @@ | ||||||
|                         <span t-esc="o.incoterm.name"/> |                         <span t-esc="o.incoterm.name"/> | ||||||
|                         <br/> |                         <br/> | ||||||
|                     </p> |                     </p> | ||||||
|                     <p class="col-xs-12" t-if="o.payment_term_id"> |                     <p class="col-xs-12" t-if="o.payment_term_id and not o.partner_invoice_id.is_retailer"> | ||||||
|                         Zahlungskonditionen: |                         Zahlungskonditionen: | ||||||
|                         <span t-esc="o.payment_term_id.name"/> |                         <span t-esc="o.payment_term_id.name"/> | ||||||
|                         <br/> |                         <br/> | ||||||
|  |  | ||||||
|  | @ -87,7 +87,7 @@ class AccountInvoiceLine(models.Model): | ||||||
|                                 compute='_compute_price_reduce', required=True, store=True, |                                 compute='_compute_price_reduce', required=True, store=True, | ||||||
|                                 help='Rabattierter Einzelpreis, inkludiert bereits den Rabatt und ist auf 2 Stellen ' |                                 help='Rabattierter Einzelpreis, inkludiert bereits den Rabatt und ist auf 2 Stellen ' | ||||||
|                                      'kaufmännisch gerundet.') |                                      'kaufmännisch gerundet.') | ||||||
|     hide_discount = fields.Boolean(string='Rabatt verstecken') |     hide_discount = fields.Boolean(string='RV') | ||||||
| 
 | 
 | ||||||
|     @api.multi |     @api.multi | ||||||
|     @api.depends('price_unit', 'discount') |     @api.depends('price_unit', 'discount') | ||||||
|  |  | ||||||
|  | @ -25,7 +25,7 @@ from odoo.tools import float_round | ||||||
| class SaleOrderLine(models.Model): | class SaleOrderLine(models.Model): | ||||||
|     _inherit = 'sale.order.line' |     _inherit = 'sale.order.line' | ||||||
| 
 | 
 | ||||||
|     hide_discount = fields.Boolean(string='Rabatt verstecken') |     hide_discount = fields.Boolean(string='RV') | ||||||
| 
 | 
 | ||||||
|     @api.multi |     @api.multi | ||||||
|     @api.depends('product_uom_qty', 'discount', 'price_unit', 'tax_id') |     @api.depends('product_uom_qty', 'discount', 'price_unit', 'tax_id') | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue