diff --git a/agreement_stock/__manifest__.py b/agreement_stock/__manifest__.py index 6101ef520..8c2adce52 100644 --- a/agreement_stock/__manifest__.py +++ b/agreement_stock/__manifest__.py @@ -2,26 +2,25 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - 'name': 'Agreement - Stock', - 'summary': 'Link picking to an agreement', - 'version': '12.0.1.0.1', - 'category': 'Contract', - 'author': 'Open Source Integrators, ' - 'Odoo Community Association (OCA)', - 'website': 'https://github.com/OCA/contract', - 'depends': [ - 'agreement_serviceprofile', - 'stock', + "name": "Agreement - Stock", + "summary": "Link picking to an agreement", + "version": "14.0.1.0.0", + "category": "Contract", + "author": "Open Source Integrators, " "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/contract", + "depends": [ + "agreement_serviceprofile", + "stock", ], - 'data': [ - 'views/agreement_view.xml', - 'views/stock_view.xml', + "data": [ + "views/agreement_view.xml", + "views/stock_view.xml", ], - 'installable': True, - 'license': 'AGPL-3', - 'development_status': 'Beta', - 'maintainers': [ - 'smangukiya', - 'max3903', + "installable": True, + "license": "AGPL-3", + "development_status": "Beta", + "maintainers": [ + "smangukiya", + "max3903", ], } diff --git a/agreement_stock/models/agreement.py b/agreement_stock/models/agreement.py index ab5578684..6c8f37d12 100644 --- a/agreement_stock/models/agreement.py +++ b/agreement_stock/models/agreement.py @@ -7,25 +7,27 @@ from odoo import api, fields, models class Agreement(models.Model): _inherit = "agreement" - picking_count = fields.Integer('# Pickings', - compute='_compute_picking_count') - move_count = fields.Integer('# Moves', compute='_compute_move_count') - lot_count = fields.Integer('# Lots/Serials', compute='_compute_lot_count') + picking_count = fields.Integer("# Pickings", compute="_compute_picking_count") + move_count = fields.Integer("# Moves", compute="_compute_move_count") + lot_count = fields.Integer("# Lots/Serials", compute="_compute_lot_count") @api.multi def _compute_picking_count(self): for ag_rec in self: - ag_rec.picking_count = self.env['stock.picking'].search_count( - [('agreement_id', 'in', ag_rec.ids)]) + ag_rec.picking_count = self.env["stock.picking"].search_count( + [("agreement_id", "in", ag_rec.ids)] + ) @api.multi def _compute_move_count(self): for ag_rec in self: - ag_rec.move_count = self.env['stock.move'].search_count( - [('agreement_id', 'in', ag_rec.ids)]) + ag_rec.move_count = self.env["stock.move"].search_count( + [("agreement_id", "in", ag_rec.ids)] + ) @api.multi def _compute_lot_count(self): for ag_rec in self: - ag_rec.lot_count = self.env['stock.production.lot'].search_count( - [('agreement_id', 'in', ag_rec.ids)]) + ag_rec.lot_count = self.env["stock.production.lot"].search_count( + [("agreement_id", "in", ag_rec.ids)] + ) diff --git a/agreement_stock/models/stock.py b/agreement_stock/models/stock.py index f0c7122f5..29ccb4b6c 100644 --- a/agreement_stock/models/stock.py +++ b/agreement_stock/models/stock.py @@ -7,21 +7,19 @@ from odoo import fields, models class StockPicking(models.Model): _inherit = "stock.picking" - agreement_id = fields.Many2one('agreement', 'Agreement') + agreement_id = fields.Many2one("agreement", "Agreement") class StockMove(models.Model): _inherit = "stock.move" - agreement_id = fields.Many2one('agreement', - related='picking_id.agreement_id', - string='Agreement', - store=True) + agreement_id = fields.Many2one( + "agreement", related="picking_id.agreement_id", string="Agreement", store=True + ) class StockProductionLot(models.Model): _inherit = "stock.production.lot" - agreement_id = fields.Many2one('agreement', 'Agreement') - serviceprofile_id = fields.Many2one('agreement.serviceprofile', - 'Service Profile') + agreement_id = fields.Many2one("agreement", "Agreement") + serviceprofile_id = fields.Many2one("agreement.serviceprofile", "Service Profile") diff --git a/agreement_stock/views/agreement_view.xml b/agreement_stock/views/agreement_view.xml index ae3d70564..eee1c7e8b 100644 --- a/agreement_stock/views/agreement_view.xml +++ b/agreement_stock/views/agreement_view.xml @@ -1,8 +1,7 @@ - + - + Pickings ir.actions.act_window stock.picking @@ -16,8 +15,7 @@

- + Moves ir.actions.act_window stock.move @@ -31,8 +29,10 @@

- + Lots/Serials ir.actions.act_window stock.production.lot @@ -50,39 +50,44 @@ agreement.form.stock agreement - + - - -