addons portados en el repo de ecocentral
This commit is contained in:
parent
f2194c5367
commit
65818b0155
72 changed files with 2474 additions and 3 deletions
|
|
@ -0,0 +1,5 @@
|
|||
from . import product_template
|
||||
from . import res_config_settings
|
||||
from . import res_partner
|
||||
from . import stock_move
|
||||
from . import stock_move_line
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
# Copyright 2020 Tecnativa - Sergio Teruel
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
from odoo import fields
|
||||
from odoo import models
|
||||
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = "product.template"
|
||||
|
||||
display_undelivered_in_picking = fields.Boolean(default=True)
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
# Copyright 2020 Tecnativa - Sergio Teruel
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
from odoo import fields
|
||||
from odoo import models
|
||||
|
||||
|
||||
class ResConfigSettings(models.TransientModel):
|
||||
_inherit = "res.config.settings"
|
||||
|
||||
undelivered_product_slip_report_method = fields.Selection(
|
||||
related="company_id.undelivered_product_slip_report_method",
|
||||
readonly=False,
|
||||
)
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
_inherit = "res.company"
|
||||
|
||||
undelivered_product_slip_report_method = fields.Selection(
|
||||
[
|
||||
("all", "Display all undelivered product lines"),
|
||||
(
|
||||
"partially_undelivered",
|
||||
"Display only partially undelivered product lines",
|
||||
),
|
||||
(
|
||||
"completely_undelivered",
|
||||
"Display only completely undelivered product lines",
|
||||
),
|
||||
],
|
||||
string="Method to display undelivered product lines in report picking",
|
||||
default="all",
|
||||
)
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
# Copyright 2020 Tecnativa - Sergio Teruel
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
from odoo import fields
|
||||
from odoo import models
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = "res.partner"
|
||||
|
||||
display_undelivered_in_picking = fields.Boolean(default=True)
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
# Copyright 2020 Tecnativa - Sergio Teruel
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
from odoo import fields
|
||||
from odoo import models
|
||||
|
||||
|
||||
class StockMove(models.Model):
|
||||
_inherit = "stock.move"
|
||||
|
||||
splitted_stock_move_orig_id = fields.Many2one(
|
||||
comodel_name="stock.move", string="Splitted from", readonly=True
|
||||
)
|
||||
|
||||
def _prepare_move_split_vals(self, qty):
|
||||
"""Store origin stock move which created the splitted move."""
|
||||
vals = super()._prepare_move_split_vals(qty)
|
||||
vals["splitted_stock_move_orig_id"] = self.id
|
||||
return vals
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
# Copyright 2022 Tecnativa - Sergio Teruel
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
from odoo import models
|
||||
|
||||
|
||||
class StockMoveLine(models.Model):
|
||||
_inherit = "stock.move.line"
|
||||
|
||||
def _get_aggregated_product_quantities(self, **kwargs):
|
||||
"""Odoo displays undelivered products in the main table too.
|
||||
|
||||
Remove them from the aggregated dict so they only show up in the
|
||||
bottom "remaining products" table.
|
||||
"""
|
||||
aggregated_move_lines = super()._get_aggregated_product_quantities(**kwargs)
|
||||
keys_to_remove = {
|
||||
key
|
||||
for key, values in aggregated_move_lines.items()
|
||||
if not values["quantity"]
|
||||
}
|
||||
for key in keys_to_remove:
|
||||
aggregated_move_lines.pop(key, None)
|
||||
return aggregated_move_lines
|
||||
Loading…
Add table
Add a link
Reference in a new issue