Skip to content
Extraits de code Groupes Projets
Valider 9a29ebbc rédigé par Rémi - Le Filament's avatar Rémi - Le Filament
Parcourir les fichiers

Fix according to coding rules

parent 6195e9c7
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import models from . import models
\ No newline at end of file
# -*- coding: utf-8 -*-
{ {
'name': 'Le Filament - Sales', 'name': 'Le Filament - Sales',
...@@ -6,17 +7,15 @@ ...@@ -6,17 +7,15 @@
'version': '10.0.1.0', 'version': '10.0.1.0',
'license': 'AGPL-3', 'license': 'AGPL-3',
'description': """ 'description': """
Module Sales Le Filament Module Sales Le Filament
This module depends upon *sale* module. This module depends upon *sale* module.
This module provides: This module provides updated tree views :
- Updated quotation tree view to display untaxed amount instead of taxed amount - quotation to display untaxed amount instead of taxed amount
- Updated sale order tree view to display untaxed amount instead of taxed amount - sale order to display untaxed amount instead of taxed amount
- Updated sale order tree view to display amount that remains to be invoiced - sale order to display amount that remains to be invoiced
""", """,
'author': 'LE FILAMENT', 'author': 'LE FILAMENT',
'category': 'Sales', 'category': 'Sales',
'depends': ['sale'], 'depends': ['sale'],
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sale from . import sale
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
# © 2018 Le Filament (<http://www.le-filament.com>) # © 2018 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models, _ from odoo import api, fields, models
class SaleOrder(models.Model): class SaleOrder(models.Model):
_name = "sale.order" _name = "sale.order"
...@@ -14,15 +15,18 @@ class SaleOrder(models.Model): ...@@ -14,15 +15,18 @@ class SaleOrder(models.Model):
@api.depends('order_line.invoice_status') @api.depends('order_line.invoice_status')
def _remain_to_invoice(self): def _remain_to_invoice(self):
""" """
Compute the amount (untaxed) that remains to be invoiced from sale order Compute the amount (untaxed) that remains to be invoiced
from sale order
""" """
for order in self: for order in self:
if order.invoice_status == ('to invoice'): if order.invoice_status == ('to invoice'):
line_to_invoice = [line for line in order.order_line if line.invoice_status != 'no'] line_to_invoice = [line for line in order.order_line
if line.invoice_status != 'no']
untaxed_amount_to_invoice = order.amount_untaxed untaxed_amount_to_invoice = order.amount_untaxed
for line in line_to_invoice: for line in line_to_invoice:
untaxed_amount_to_invoice -= line.qty_invoiced * line.price_unit untaxed_amount_to_invoice -= (line.qty_invoiced
* line.price_unit)
else: else:
untaxed_amount_to_invoice = 0.0 untaxed_amount_to_invoice = 0.0
...@@ -30,5 +34,9 @@ class SaleOrder(models.Model): ...@@ -30,5 +34,9 @@ class SaleOrder(models.Model):
'untaxed_amount_to_invoice': untaxed_amount_to_invoice 'untaxed_amount_to_invoice': untaxed_amount_to_invoice
}) })
untaxed_amount_to_invoice = fields.Monetary(string='Remains to invoice (untaxed)', compute='_remain_to_invoice', store=True, readonly=True, track_visibility='always') untaxed_amount_to_invoice = fields.Monetary(
string='Remains to invoice (untaxed)',
compute='_remain_to_invoice',
store=True,
readonly=True,
track_visibility='always')
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<record id="lf_view_sale_order_calendar" model="ir.ui.view"> <record id="lf_view_sale_order_calendar" model="ir.ui.view">
<field name="inherit_id" ref="sale.view_sale_order_calendar"/> <field name="inherit_id" ref="sale.view_sale_order_calendar"/>
<field name="name">sale.order.calendar</field> <field name="name">sale.order.calendar</field>
...@@ -83,29 +82,4 @@ ...@@ -83,29 +82,4 @@
</xpath> </xpath>
</field> </field>
</record> </record>
<!--
<record id="action_quotations" model="ir.actions.act_window">
<field name="name">Quotations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_quotation_tree"/>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph</field>
<field name="search_view_id" ref="sale_order_view_search_inherit_quotation"/>
<field name="context">{'hide_sale': True}</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Create a Quotation, the first step of a new sale.
</p><p>
Your next actions should flow efficiently: confirm the Quotation
to a Sale Order, then create the Invoice and collect the Payment.
</p><p>
Note that once a Quotation becomes a Sale Order, it will be moved
from the Quotations list to the Sales Order list.
</p>
</field>
</record>
-->
</odoo> </odoo>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter