From 2cbc9dafbb00a4647719d414b17f70031672e7bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20-=20Le=20Filament?= <remi@le-filament.com> Date: Wed, 16 Feb 2022 11:05:09 +0100 Subject: [PATCH] [IMP] pre-commit --- LICENSE | 0 README.rst | 0 __init__.py | 3 +- __manifest__.py | 52 ++++++++++---------- models/account_move.py | 7 ++- models/product.py | 2 +- models/res_company.py | 16 +++--- models/res_config_settings.py | 9 ++-- models/sale_order.py | 18 +++---- models/stock_move.py | 2 +- models/stock_picking.py | 19 ++++--- models/stock_production_lot.py | 40 +++++++++------ models/stock_quant.py | 14 +++--- report/product_pricelist_report.py | 10 ++-- report/report_deliveryslip.xml | 60 ++++++++++++++++------- report/report_invoice.xml | 30 ++++++++---- report/report_pricelist.xml | 9 ++-- report/report_saleorder.xml | 53 +++++++++++++++----- report/report_stockpicking_operations.xml | 17 ++++--- views/product_views.xml | 12 ++--- views/res_config_settings.xml | 15 +++--- views/sale_order.xml | 29 ++++++----- views/stock_picking.xml | 20 +++++--- views/stock_quant.xml | 24 +++++---- 24 files changed, 279 insertions(+), 182 deletions(-) mode change 100755 => 100644 LICENSE mode change 100755 => 100644 README.rst mode change 100755 => 100644 __manifest__.py mode change 100755 => 100644 models/res_company.py mode change 100755 => 100644 models/res_config_settings.py mode change 100755 => 100644 views/res_config_settings.xml diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.rst b/README.rst old mode 100755 new mode 100644 diff --git a/__init__.py b/__init__.py index 35eec7b..b9e21ba 100644 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1,4 @@ # Copyright 2021 Le Filament (<http://www.le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from . import models -from . import report +from . import models, report diff --git a/__manifest__.py b/__manifest__.py old mode 100755 new mode 100644 index 475febb..d510d86 --- a/__manifest__.py +++ b/__manifest__.py @@ -1,38 +1,36 @@ { - 'name': "FUMAISON OCC - Ventes", - 'summary': "Ventes", - 'author': "Le Filament", - 'website': "https://www.le-filament.com", - 'version': '14.0.1.0.1', - 'license': "AGPL-3", - 'depends': [ - 'product', - 'product_expiry', - 'sale_stock', - 'fumoc_partner', - 'stock_picking_invoice_link', + "name": "FUMAISON OCC - Ventes", + "summary": "Ventes", + "author": "Le Filament", + "website": "https://www.le-filament.com", + "version": "14.0.1.0.1", + "license": "AGPL-3", + "depends": [ + "fumoc_partner", + "product_expiry", + "stock_picking_invoice_link", ], - 'data': [ + "data": [ # datas # views - 'views/product_views.xml', - 'views/res_config_settings.xml', - 'views/sale_order.xml', - 'views/stock_move_line.xml', - 'views/stock_picking.xml', - 'views/stock_quant.xml', + "views/product_views.xml", + "views/res_config_settings.xml", + "views/sale_order.xml", + "views/stock_move_line.xml", + "views/stock_picking.xml", + "views/stock_quant.xml", # reports - 'report/report_deliveryslip.xml', - 'report/report_invoice.xml', - 'report/report_pricelist.xml', - 'report/report_saleorder.xml', - 'report/report_stockpicking_operations.xml', + "report/report_deliveryslip.xml", + "report/report_invoice.xml", + "report/report_pricelist.xml", + "report/report_saleorder.xml", + "report/report_stockpicking_operations.xml", # views menu # wizard ], - 'qweb': [ + "qweb": [ # "static/src/xml/*.xml", ], - 'installable': True, - 'auto_install': False, + "installable": True, + "auto_install": False, } diff --git a/models/account_move.py b/models/account_move.py index 5f640ef..86bf59e 100644 --- a/models/account_move.py +++ b/models/account_move.py @@ -5,7 +5,7 @@ from odoo import models class FumocAccountMove(models.Model): - _inherit = 'account.move' + _inherit = "account.move" def _get_invoiced_lot_values(self): """ @@ -13,7 +13,6 @@ class FumocAccountMove(models.Model): """ result = super(FumocAccountMove, self)._get_invoiced_lot_values() for lot_values in result: - lot_id = self.env['stock.production.lot'].\ - browse(lot_values.get('lot_id')) - lot_values['expiration_date'] = lot_id.expiration_date + lot_id = self.env["stock.production.lot"].browse(lot_values.get("lot_id")) + lot_values["expiration_date"] = lot_id.expiration_date return result diff --git a/models/product.py b/models/product.py index 2ec2101..4227dc1 100644 --- a/models/product.py +++ b/models/product.py @@ -5,7 +5,7 @@ from odoo import fields, models class ProductTemplate(models.Model): - _inherit = 'product.template' + _inherit = "product.template" # ------------------------------------------------------ # Fields declaration diff --git a/models/res_company.py b/models/res_company.py old mode 100755 new mode 100644 index c480e74..6d9d1bf --- a/models/res_company.py +++ b/models/res_company.py @@ -1,20 +1,22 @@ # © 2021 Le Filament (<http://www.le-filament.com>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import fields, models, api +from odoo import _, api, fields, models from odoo.exceptions import ValidationError class FumocCompany(models.Model): - _inherit = 'res.company' + _inherit = "res.company" - year_reference_lot = fields.Integer( - string='Année de référence lot') + year_reference_lot = fields.Integer(string="Année de référence lot") - @api.constrains('year_reference_lot') + @api.constrains("year_reference_lot") def _check_year_reference_lot(self): for r in self: if not 2000 < r.year_reference_lot < 2050: raise ValidationError( - "L'année de référence renseignée (%s) ne semble pas " - "cohérente" % r.year_reference_lot) + _( + "L'année de référence renseignée (%s) ne semble pas " + "cohérente" % r.year_reference_lot + ) + ) diff --git a/models/res_config_settings.py b/models/res_config_settings.py old mode 100755 new mode 100644 index 45871f7..79c538f --- a/models/res_config_settings.py +++ b/models/res_config_settings.py @@ -5,9 +5,10 @@ from odoo import fields, models class FumocConfigSettings(models.TransientModel): - _inherit = 'res.config.settings' + _inherit = "res.config.settings" year_reference_lot = fields.Integer( - string='Année de référence lot', - related='company_id.year_reference_lot', - readonly=False) + string="Année de référence lot", + related="company_id.year_reference_lot", + readonly=False, + ) diff --git a/models/sale_order.py b/models/sale_order.py index e5a041c..829d0d1 100644 --- a/models/sale_order.py +++ b/models/sale_order.py @@ -5,17 +5,17 @@ from odoo import fields, models class FumocSaleOrder(models.Model): - _inherit = 'sale.order' + _inherit = "sale.order" departure_day_ids = fields.Many2many( - string="Jours de départ", - related='partner_id.departure_day_ids') + string="Jours de départ", related="partner_id.departure_day_ids" + ) res_transporter_id = fields.Many2one( - string='Transporteur', - related='partner_id.res_transporter_id') + string="Transporteur", related="partner_id.res_transporter_id" + ) packaging_id = fields.Many2one( - string="Emballage", - related='partner_id.packaging_id') + string="Emballage", related="partner_id.packaging_id" + ) billing_type_id = fields.Many2one( - string="Type de facturation", - related='partner_id.billing_type_id') + string="Type de facturation", related="partner_id.billing_type_id" + ) diff --git a/models/stock_move.py b/models/stock_move.py index e809f5a..80f49c0 100644 --- a/models/stock_move.py +++ b/models/stock_move.py @@ -5,7 +5,7 @@ from odoo import models class StockMove(models.Model): - _inherit = 'stock.move' + _inherit = "stock.move" def _prepare_move_line_vals(self, quantity=None, reserved_quant=None): vals = super()._prepare_move_line_vals(quantity, reserved_quant) diff --git a/models/stock_picking.py b/models/stock_picking.py index 7bb2791..62daee7 100644 --- a/models/stock_picking.py +++ b/models/stock_picking.py @@ -5,22 +5,21 @@ from odoo import fields, models class FumocStockPicking(models.Model): - _inherit = 'stock.picking' + _inherit = "stock.picking" # ------------------------------------------------------ # Fields declaration # ------------------------------------------------------ res_transporter_id = fields.Many2one( - string='Transporteur', - related='sale_id.res_transporter_id') - packaging_id = fields.Many2one( - string="Emballage", - related='sale_id.packaging_id') + string="Transporteur", related="sale_id.res_transporter_id" + ) + packaging_id = fields.Many2one(string="Emballage", related="sale_id.packaging_id") partner_contact_id = fields.Many2one( - comodel_name='res.partner', - string='Contact associé', - compute='_compute_partner_contact_id') + comodel_name="res.partner", + string="Contact associé", + compute="_compute_partner_contact_id", + ) # ------------------------------------------------------ # Compute @@ -30,7 +29,7 @@ class FumocStockPicking(models.Model): partner = r.partner_id is_contact = False while not is_contact: - if partner.type != 'contact': + if partner.type != "contact": if partner.parent_id: partner = partner.parent_id else: diff --git a/models/stock_production_lot.py b/models/stock_production_lot.py index 6c497ef..180ab7c 100644 --- a/models/stock_production_lot.py +++ b/models/stock_production_lot.py @@ -4,12 +4,12 @@ import datetime import re -from odoo import models, fields, api +from odoo import _, api, fields, models from odoo.exceptions import UserError class FumocStockProductionLot(models.Model): - _inherit = 'stock.production.lot' + _inherit = "stock.production.lot" # ------------------------------------------------------ # Business method @@ -17,27 +17,29 @@ class FumocStockProductionLot(models.Model): def _get_dates(self, product_id=None, lotname=None): """Replaces existing method.""" mapped_fields = { - 'expiration_date': 'expiration_time', - 'use_date': 'use_time', - 'removal_date': 'removal_time', - 'alert_date': 'alert_time' + "expiration_date": "expiration_time", + "use_date": "use_time", + "removal_date": "removal_time", + "alert_date": "alert_time", } res = dict.fromkeys(mapped_fields, False) - product = self.env['product.product'].browse(product_id) or self.product_id + product = self.env["product.product"].browse(product_id) or self.product_id lot_name = lotname or self.name if product and lot_name: if not self.env.user.company_id.year_reference_lot: - raise UserError('L\'année de référence pour les lots n\'a pas été ' - 'configurée !') - suffix = re.findall('([\d]+)\D*', lot_name)[-1] + raise UserError( + _("L'année de référence pour les lots n'a pas été " "configurée !") + ) + suffix = re.findall(r"([\d]+)\D*", lot_name)[-1] if len(suffix) >= 4: readable_suffix = suffix[-4:] year_ref = self.env.user.company_id.year_reference_lot year_index = int(readable_suffix[:1]) year = year_ref + year_index quantieme = int(readable_suffix[1:]) - production_date = datetime.datetime(year, 1, 1) + \ - datetime.timedelta(days=quantieme-1) + production_date = datetime.datetime(year, 1, 1) + datetime.timedelta( + days=quantieme - 1 + ) for field in mapped_fields: duration = getattr(product, mapped_fields[field]) if duration: @@ -49,13 +51,16 @@ class FumocStockProductionLot(models.Model): @api.model_create_multi def create(self, vals_list): for vals in vals_list: - dates = self._get_dates(vals.get('product_id') or self.env.context.get('default_product_id'), vals.get('name') or self.env.context.get('default_name')) + dates = self._get_dates( + vals.get("product_id") or self.env.context.get("default_product_id"), + vals.get("name") or self.env.context.get("default_name"), + ) for d in dates: if not vals.get(d): vals[d] = dates[d] return super().create(vals_list) - @api.onchange('name') + @api.onchange("name") def _onchange_name(self): dates_dict = self._get_dates() for field, value in dates_dict.items(): @@ -67,6 +72,11 @@ class FumocStockProductionLot(models.Model): res = super().name_get() if self.env.context.get("show_qty"): res = self.browse([r[0] for r in res]).mapped( - lambda r: (r.id, r.name and (r.name + " (en stock : %.0f)" % r.product_qty) or r.name) + lambda r: ( + r.id, + r.name + and (r.name + " (en stock : %.0f)" % r.product_qty) + or r.name, + ) ) return res diff --git a/models/stock_quant.py b/models/stock_quant.py index 51f5b54..c3aed5b 100644 --- a/models/stock_quant.py +++ b/models/stock_quant.py @@ -5,17 +5,15 @@ from odoo import fields, models class FumocStockQuant(models.Model): - _inherit = 'stock.quant' + _inherit = "stock.quant" # ------------------------------------------------------ # Fields declaration # ------------------------------------------------------ expiration_date = fields.Datetime( - string="DLC", - related='lot_id.expiration_date', store=True) - use_date = fields.Datetime( - string="DDM", - related='lot_id.use_date', store=True) + string="DLC", related="lot_id.expiration_date", store=True + ) + use_date = fields.Datetime(string="DDM", related="lot_id.use_date", store=True) alert_date = fields.Datetime( - string="Alerte", - related='lot_id.alert_date', store=True) + string="Alerte", related="lot_id.alert_date", store=True + ) diff --git a/report/product_pricelist_report.py b/report/product_pricelist_report.py index b33344f..4402ecd 100644 --- a/report/product_pricelist_report.py +++ b/report/product_pricelist_report.py @@ -4,10 +4,12 @@ from odoo import models -class report_product_pricelist(models.AbstractModel): - _inherit = 'report.product.report_pricelist' +class ReportProductPricelist(models.AbstractModel): + _inherit = "report.product.report_pricelist" def _get_product_data(self, is_product_tmpl, product, pricelist, quantities): - data = super()._get_product_data(is_product_tmpl, product, pricelist, quantities) - data['barcode'] = product.barcode + data = super()._get_product_data( + is_product_tmpl, product, pricelist, quantities + ) + data["barcode"] = product.barcode return data diff --git a/report/report_deliveryslip.xml b/report/report_deliveryslip.xml index 9350108..8a8e112 100644 --- a/report/report_deliveryslip.xml +++ b/report/report_deliveryslip.xml @@ -1,61 +1,81 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> <!-- Inheritance from stock --> - <template id="fumoc_sale_stock_report_delivery_document" - inherit_id="stock.report_delivery_document"> + <template + id="fumoc_sale_stock_report_delivery_document" + inherit_id="stock.report_delivery_document" + > <xpath expr="//t[@name='partner_header']" position="replace"> <t t-if="partner" name="partner_header"> <t t-set="address"> - <div t-esc="partner" t-options="{"widget": "contact", "fields": ["address", "name"], "no_marker": True}"/> + <div + t-esc="partner" + t-options="{"widget": "contact", "fields": ["address", "name"], "no_marker": True}" + /> </t> </t> </xpath> <xpath expr="//div[@name='div_origin']" position="replace"> <div t-if="o.origin" class="col-auto" name="div_origin"> <strong>Commande :</strong> - <p t-field="o.origin"/> + <p t-field="o.origin" /> </div> </xpath> <xpath expr="//div[@name='div_sched_date']" position="replace"> <div class="col-auto" name="div_sched_date"> <strong>Date :</strong> - <p t-field="o.scheduled_date" t-options="{"widget": "date"}"/> + <p + t-field="o.scheduled_date" + t-options="{"widget": "date"}" + /> </div> <div class="col-auto"> - <div t-if="o.res_transporter_id" class="col-auto" name="div_transporter"> + <div + t-if="o.res_transporter_id" + class="col-auto" + name="div_transporter" + > <strong>Transporteur :</strong> - <p t-field="o.res_transporter_id"/> + <p t-field="o.res_transporter_id" /> </div> </div> <div class="col-auto"> <t t-if="o.partner_contact_id"> - <div t-if="o.partner_contact_id.delivery_note" class="col-auto" name="div_delivery_note"> + <div + t-if="o.partner_contact_id.delivery_note" + class="col-auto" + name="div_delivery_note" + > <strong>Note :</strong> - <p t-field="o.partner_contact_id.delivery_note"/> + <p t-field="o.partner_contact_id.delivery_note" /> </div> </t> </div> </xpath> </template> - <template id="fumoc_sale_stock_report_delivery_barcode" - inherit_id="stock.stock_report_delivery_has_serial_move_line"> + <template + id="fumoc_sale_stock_report_delivery_barcode" + inherit_id="stock.stock_report_delivery_has_serial_move_line" + > <xpath expr="/t/td/p" position="after"> <p t-if="move_line.product_id.barcode"> - <p>Code-Barre : <span t-esc="move_line.product_id.barcode"/></p> + <p>Code-Barre : <span t-esc="move_line.product_id.barcode" /></p> </p> </xpath> </template> <!-- Inheritance from product_expiry --> - <template id="fumoc_sale_stock_report_delivery_document2" - inherit_id="product_expiry.stock_report_delivery_document_inherit_product_expiry"> + <template + id="fumoc_sale_stock_report_delivery_document2" + inherit_id="product_expiry.stock_report_delivery_document_inherit_product_expiry" + > <xpath expr="//t[@name='expiry_date']/th" position="replace"> <th class="text-center">DLC</th> @@ -64,10 +84,16 @@ </template> <!-- Inheritance from product_expiry --> - <template id="fumoc_sale_stock_report_delivery_has_serial_move_line_inherit_product_expiry" inherit_id="product_expiry.stock_report_delivery_has_serial_move_line_inherit_product_expiry"> + <template + id="fumoc_sale_stock_report_delivery_has_serial_move_line_inherit_product_expiry" + inherit_id="product_expiry.stock_report_delivery_has_serial_move_line_inherit_product_expiry" + > <xpath expr="//t[@t-if='has_expiry_date']" position="replace"> <t t-if="has_expiry_date"> - <td><span t-field="move_line.expiration_date" t-options='{"widget": "date"}'/></td> + <td><span + t-field="move_line.expiration_date" + t-options='{"widget": "date"}' + /></td> </t> </xpath> </template> diff --git a/report/report_invoice.xml b/report/report_invoice.xml index 45a3e71..41e5ccb 100644 --- a/report/report_invoice.xml +++ b/report/report_invoice.xml @@ -1,18 +1,25 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <template id="fumoc_sale_stock_report_invoice_document" inherit_id="sale_stock.sale_stock_report_invoice_document"> + <template + id="fumoc_sale_stock_report_invoice_document" + inherit_id="sale_stock.sale_stock_report_invoice_document" + > <xpath expr="//div[@name='origin']" position="replace"> - <div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_origin" name="origin"> + <div + class="col-auto col-3 mw-100 mb-2" + t-if="o.invoice_origin" + name="origin" + > <strong>Commande :</strong> - <p class="m-0" t-field="o.invoice_origin"/> + <p class="m-0" t-field="o.invoice_origin" /> </div> <div class="col-auto col-3 mw-100 mb-2" t-if="o.picking_ids" name="origin"> <strong>Livraison(s) :</strong> - <p t-esc="'%s' % ', '.join(o.picking_ids.mapped('name'))"/> + <p t-esc="'%s' % ', '.join(o.picking_ids.mapped('name'))" /> </div> </xpath> @@ -23,10 +30,13 @@ </th> </xpath> - <xpath expr="//table//tbody//t[@name='account_invoice_line_accountable']//td[hasclass('o_price_total')]" position="replace"> + <xpath + expr="//table//tbody//t[@name='account_invoice_line_accountable']//td[hasclass('o_price_total')]" + position="replace" + > <td class="text-right o_price_total"> - <span class="text-nowrap" t-field="line.price_subtotal"/> - <span class="text-nowrap" t-field="line.price_total"/> + <span class="text-nowrap" t-field="line.price_subtotal" /> + <span class="text-nowrap" t-field="line.price_total" /> </td> </xpath> @@ -40,7 +50,7 @@ <xpath expr="//table[@name='invoice_snln_table']/tbody//tr" position="inside"> <td class="text-right" width="100px"> - <t t-esc="snln_line['expiration_date'].strftime('%d-%m-%Y')"/> + <t t-esc="snln_line['expiration_date'].strftime('%d-%m-%Y')" /> </td> </xpath> @@ -48,7 +58,7 @@ <div class="row" t-if="o.partner_id.billing_note" name="billing_note"> <div class="col-12 mb-3"> <strong>Note :</strong> - <p class="m-0" t-field="o.partner_id.billing_note"/> + <p class="m-0" t-field="o.partner_id.billing_note" /> </div> </div> </xpath> diff --git a/report/report_pricelist.xml b/report/report_pricelist.xml index b6b6abe..f00b30d 100644 --- a/report/report_pricelist.xml +++ b/report/report_pricelist.xml @@ -1,16 +1,19 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <template id="fumoc_sale_report_pricelist_page" inherit_id="product.report_pricelist_page"> + <template + id="fumoc_sale_report_pricelist_page" + inherit_id="product.report_pricelist_page" + > <xpath expr="//table/thead/tr/th[1]" position="after"> <th>Codes-Barre</th> </xpath> <xpath expr="//table/tbody/t/tr/td[1]" position="after"> <td> - <t t-esc="product['barcode']"/> + <t t-esc="product['barcode']" /> </td> </xpath> diff --git a/report/report_saleorder.xml b/report/report_saleorder.xml index 5afcf3d..9eb528c 100644 --- a/report/report_saleorder.xml +++ b/report/report_saleorder.xml @@ -1,35 +1,64 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <template id="fumoc_sale_report_saleorder_document" inherit_id="sale_stock.report_saleorder_document_inherit_sale_stock"> + <template + id="fumoc_sale_report_saleorder_document" + inherit_id="sale_stock.report_saleorder_document_inherit_sale_stock" + > <xpath expr="//div[@id='informations']" position="replace"> <div class="row mt32 mb32" id="informations"> <div t-if="doc.client_order_ref" class="col-auto col-3 mw-100 mb-2"> <strong>Référence :</strong> - <p class="m-0" t-field="doc.client_order_ref"/> + <p class="m-0" t-field="doc.client_order_ref" /> </div> - <div t-if="doc.date_order and doc.state not in ['draft','sent']" class="col-auto col-3 mw-100 mb-2"> + <div + t-if="doc.date_order and doc.state not in ['draft','sent']" + class="col-auto col-3 mw-100 mb-2" + > <strong>Date de la commande :</strong> - <p class="m-0" t-field="doc.date_order" t-options="{"widget": "date"}"/> + <p + class="m-0" + t-field="doc.date_order" + t-options="{"widget": "date"}" + /> </div> - <div t-if="doc.date_order and doc.state in ['draft','sent']" class="col-auto col-3 mw-100 mb-2"> + <div + t-if="doc.date_order and doc.state in ['draft','sent']" + class="col-auto col-3 mw-100 mb-2" + > <strong>Date du devis :</strong> - <p class="m-0" t-field="doc.date_order" t-options="{"widget": "date"}"/> + <p + class="m-0" + t-field="doc.date_order" + t-options="{"widget": "date"}" + /> </div> - <div t-if="doc.validity_date and doc.state in ['draft', 'sent']" class="col-auto col-3 mw-100 mb-2" name="expiration_date"> + <div + t-if="doc.validity_date and doc.state in ['draft', 'sent']" + class="col-auto col-3 mw-100 mb-2" + name="expiration_date" + > <strong>Expiration :</strong> - <p class="m-0" t-field="doc.validity_date" t-options="{"widget": "date"}"/> + <p + class="m-0" + t-field="doc.validity_date" + t-options="{"widget": "date"}" + /> </div> - <div class="col-3" t-if="doc.incoterm" groups="sale_stock.group_display_incoterm"> + <div + class="col-3" + t-if="doc.incoterm" + groups="sale_stock.group_display_incoterm" + > <strong>Incoterm :</strong> - <p t-field="doc.incoterm.code"/> + <p t-field="doc.incoterm.code" /> </div> <div t-if="doc.user_id.name" class="col-auto col-3 mw-100 mb-2"> <strong>Commercial :</strong> - <p class="m-0" t-field="doc.user_id"/> + <p class="m-0" t-field="doc.user_id" /> </div> </div> </xpath> diff --git a/report/report_stockpicking_operations.xml b/report/report_stockpicking_operations.xml index 6cb7997..46f4feb 100644 --- a/report/report_stockpicking_operations.xml +++ b/report/report_stockpicking_operations.xml @@ -1,28 +1,31 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> - <template id="fumoc_sale_stock_report_picking" - inherit_id="stock.report_picking"> + <template id="fumoc_sale_stock_report_picking" inherit_id="stock.report_picking"> <xpath expr="//div[@name='div_sched_date']" position="after"> <div class="col-auto" name="div_transporter"> <strong>Transporteur :</strong> - <p t-field="o.res_transporter_id"/> + <p t-field="o.res_transporter_id" /> </div> <div class="col-auto" name="div_packaging"> <strong>Emballage :</strong> - <p t-field="o.packaging_id"/> + <p t-field="o.packaging_id" /> </div> </xpath> <xpath expr="//table[1]" position="before"> <div class="row mt48 mb32"> <t t-if="o.partner_contact_id"> - <div t-if="o.partner_contact_id.delivery_note" class="col-auto" name="div_delivery_note"> + <div + t-if="o.partner_contact_id.delivery_note" + class="col-auto" + name="div_delivery_note" + > <strong>Note :</strong> - <p t-field="o.partner_contact_id.delivery_note"/> + <p t-field="o.partner_contact_id.delivery_note" /> </div> </t> </div> diff --git a/views/product_views.xml b/views/product_views.xml index 269c359..28f56b6 100644 --- a/views/product_views.xml +++ b/views/product_views.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> @@ -7,15 +7,15 @@ <record id="product_template_only_form_view" model="ir.ui.view"> <field name="name">fumoc.product.template.product.form</field> <field name="model">product.template</field> - <field name="inherit_id" ref="product.product_template_only_form_view"/> + <field name="inherit_id" ref="product.product_template_only_form_view" /> <field name="arch" type="xml"> <field name="barcode" position="after"> - <field name="ean7"/> + <field name="ean7" /> </field> </field> </record> - - + + </data> -</odoo> \ No newline at end of file +</odoo> diff --git a/views/res_config_settings.xml b/views/res_config_settings.xml old mode 100755 new mode 100644 index 7f06a29..d739823 --- a/views/res_config_settings.xml +++ b/views/res_config_settings.xml @@ -1,25 +1,28 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="UTF-8" ?> <odoo> <data> <record id="fumoc_sale_res_config_settings_view_form" model="ir.ui.view"> <field name="name">fumoc.sale.res.config.settings.view.form</field> <field name="model">res.config.settings</field> - <field name="inherit_id" ref="stock.res_config_settings_view_form"/> + <field name="inherit_id" ref="stock.res_config_settings_view_form" /> <field name="arch" type="xml"> <xpath expr="//div[@data-key='stock']" position="inside"> <h2>Numéros de lots</h2> <div class="row mt16 o_settings_container" name="lot_name"> <div class="col-12 col-lg-6 o_setting_box"> - <div class="o_setting_left_pane"/> + <div class="o_setting_left_pane" /> <div class="o_setting_right_pane"> - <label for="year_reference_lot"/> + <label for="year_reference_lot" /> <div class="text-muted"> Année 0. Exemple : le lot FE561103 correspond à l'année 2021 si l'année référence est 2020. </div> <div class="content-group"> <div class="mt16"> - <field name="year_reference_lot" class="oe_inline"/> + <field + name="year_reference_lot" + class="oe_inline" + /> </div> </div> </div> @@ -30,4 +33,4 @@ </record> </data> -</odoo> \ No newline at end of file +</odoo> diff --git a/views/sale_order.xml b/views/sale_order.xml index 7951ef4..b92a931 100644 --- a/views/sale_order.xml +++ b/views/sale_order.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> @@ -7,14 +7,17 @@ <record id="fumoc_sale_order_form_inherit" model="ir.ui.view"> <field name="name">fumoc_sale.sale.order.form</field> <field name="model">sale.order</field> - <field name="inherit_id" ref="sale_stock.view_order_form_inherit_sale_stock"/> - <field name="priority" eval="8"/> + <field + name="inherit_id" + ref="sale_stock.view_order_form_inherit_sale_stock" + /> + <field name="priority" eval="8" /> <field name="arch" type="xml"> <xpath expr="//field[@name='picking_policy']" position="before"> - <field name="departure_day_ids" widget="many2many_tags"/> - <field name="res_transporter_id"/> - <field name="packaging_id"/> - <field name="billing_type_id"/> + <field name="departure_day_ids" widget="many2many_tags" /> + <field name="res_transporter_id" /> + <field name="packaging_id" /> + <field name="billing_type_id" /> </xpath> </field> </record> @@ -22,11 +25,11 @@ <record id="fumoc_sale_order_tree_inherit" model="ir.ui.view"> <field name="name">fumoc_sale.sale.order.tree</field> <field name="model">sale.order</field> - <field name="inherit_id" ref="sale.view_order_tree"/> - <field name="priority" eval="8"/> + <field name="inherit_id" ref="sale.view_order_tree" /> + <field name="priority" eval="8" /> <field name="arch" type="xml"> <xpath expr="//field[@name='partner_id']" position="after"> - <field name="billing_type_id" optional="show"/> + <field name="billing_type_id" optional="show" /> </xpath> </field> </record> @@ -34,11 +37,11 @@ <record id="fumoc_sale_quotation_tree_inherit" model="ir.ui.view"> <field name="name">fumoc_sale.sale.quotation.tree</field> <field name="model">sale.order</field> - <field name="inherit_id" ref="sale.view_quotation_tree"/> - <field name="priority" eval="8"/> + <field name="inherit_id" ref="sale.view_quotation_tree" /> + <field name="priority" eval="8" /> <field name="arch" type="xml"> <xpath expr="//field[@name='partner_id']" position="after"> - <field name="billing_type_id" optional="show"/> + <field name="billing_type_id" optional="show" /> </xpath> </field> </record> diff --git a/views/stock_picking.xml b/views/stock_picking.xml index c660eb2..734be2a 100644 --- a/views/stock_picking.xml +++ b/views/stock_picking.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> @@ -7,18 +7,24 @@ <record id="fumoc_stock_picking_form_inherit" model="ir.ui.view"> <field name="name">fumoc_sale.stock.picking.form</field> <field name="model">stock.picking</field> - <field name="inherit_id" ref="stock.view_picking_form"/> - <field name="priority" eval="8"/> + <field name="inherit_id" ref="stock.view_picking_form" /> + <field name="priority" eval="8" /> <field name="arch" type="xml"> - <xpath expr="//page[@name='extra']//group[@name='other_infos']" position="after"> + <xpath + expr="//page[@name='extra']//group[@name='other_infos']" + position="after" + > <group string="Infos Livraison" name="delivery_infos"> - <field name="res_transporter_id"/> - <field name="packaging_id"/> + <field name="res_transporter_id" /> + <field name="packaging_id" /> </group> </xpath> - <xpath expr="//field[@name='move_line_ids_without_package']" position="attributes"> + <xpath + expr="//field[@name='move_line_ids_without_package']" + position="attributes" + > <attribute name="context">{ 'tree_view_ref': 'fumoc_sale.fumoc_stock_move_line_detailed_operation_tree_inherit', 'default_picking_id': id, diff --git a/views/stock_quant.xml b/views/stock_quant.xml index 23d56a5..1676ede 100644 --- a/views/stock_quant.xml +++ b/views/stock_quant.xml @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="utf-8" ?> <!-- Copyright 2021 Le Filament License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> <odoo> @@ -7,12 +7,15 @@ <record id="fumoc_stock_quant_tree_inherit" model="ir.ui.view"> <field name="name">fumoc_sale.stock.quant.tree</field> <field name="model">stock.quant</field> - <field name="inherit_id" ref="product_expiry.view_stock_quant_tree_expiry"/> + <field + name="inherit_id" + ref="product_expiry.view_stock_quant_tree_expiry" + /> <field name="arch" type="xml"> <xpath expr="//field[@name='removal_date']" position="before"> - <field name="use_date" optional="hide"/> - <field name="expiration_date" optional="show"/> - <field name="alert_date" optional="hide"/> + <field name="use_date" optional="hide" /> + <field name="expiration_date" optional="show" /> + <field name="alert_date" optional="hide" /> </xpath> </field> </record> @@ -20,12 +23,15 @@ <record id="fumoc_stock_quant_tree_editable_inherit" model="ir.ui.view"> <field name="name">fumoc_sale.stock.quant.tree.editable</field> <field name="model">stock.quant</field> - <field name="inherit_id" ref="product_expiry.view_stock_quant_tree_editable_expiry"/> + <field + name="inherit_id" + ref="product_expiry.view_stock_quant_tree_editable_expiry" + /> <field name="arch" type="xml"> <xpath expr="//field[@name='removal_date']" position="before"> - <field name="use_date" optional="hide"/> - <field name="expiration_date" optional="show"/> - <field name="alert_date" optional="hide"/> + <field name="use_date" optional="hide" /> + <field name="expiration_date" optional="show" /> + <field name="alert_date" optional="hide" /> </xpath> </field> </record> -- GitLab