From 4a46164a3357f97e748c95eba0e8228a3799c888 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Sat, 23 Jul 2022 21:05:01 +0300 Subject: [PATCH 01/68] [14.0] [ADD] Add modules for stock accounting date. --- l10n_ro_stock_account_date/README.rst | 106 +++++ l10n_ro_stock_account_date/__init__.py | 1 + l10n_ro_stock_account_date/__manifest__.py | 18 + l10n_ro_stock_account_date/models/__init__.py | 4 + .../models/stock_move.py | 81 ++++ .../models/stock_move_line.py | 15 + .../models/stock_picking.py | 36 ++ .../models/stock_valuation_layer.py | 46 ++ .../readme/CONTRIBUTORS.rst | 7 + .../readme/DESCRIPTION.rst | 1 + l10n_ro_stock_account_date/readme/INSTALL.rst | 7 + .../static/description/icon.png | Bin 0 -> 566 bytes .../static/description/index.html | 444 ++++++++++++++++++ .../static/src/css/report.css | 70 +++ l10n_ro_stock_account_date/tests/__init__.py | 1 + .../tests/test_stock_accounting_date.py | 107 +++++ .../views/stock_picking_views.xml | 43 ++ .../views/stock_valuation_layer_views.xml | 12 + 18 files changed, 999 insertions(+) create mode 100644 l10n_ro_stock_account_date/README.rst create mode 100644 l10n_ro_stock_account_date/__init__.py create mode 100644 l10n_ro_stock_account_date/__manifest__.py create mode 100644 l10n_ro_stock_account_date/models/__init__.py create mode 100644 l10n_ro_stock_account_date/models/stock_move.py create mode 100644 l10n_ro_stock_account_date/models/stock_move_line.py create mode 100644 l10n_ro_stock_account_date/models/stock_picking.py create mode 100644 l10n_ro_stock_account_date/models/stock_valuation_layer.py create mode 100644 l10n_ro_stock_account_date/readme/CONTRIBUTORS.rst create mode 100644 l10n_ro_stock_account_date/readme/DESCRIPTION.rst create mode 100644 l10n_ro_stock_account_date/readme/INSTALL.rst create mode 100644 l10n_ro_stock_account_date/static/description/icon.png create mode 100644 l10n_ro_stock_account_date/static/description/index.html create mode 100644 l10n_ro_stock_account_date/static/src/css/report.css create mode 100644 l10n_ro_stock_account_date/tests/__init__.py create mode 100644 l10n_ro_stock_account_date/tests/test_stock_accounting_date.py create mode 100644 l10n_ro_stock_account_date/views/stock_picking_views.xml create mode 100644 l10n_ro_stock_account_date/views/stock_valuation_layer_views.xml diff --git a/l10n_ro_stock_account_date/README.rst b/l10n_ro_stock_account_date/README.rst new file mode 100644 index 000000000..019be7b4c --- /dev/null +++ b/l10n_ro_stock_account_date/README.rst @@ -0,0 +1,106 @@ +====================== +Romania - Stock Report +====================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report + :alt: OCA/l10n-romania +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_report + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/177/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds a stock report according to Romanian requirements. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +To install this module, you need to: + +* clone the branch 14.0 of the repository https://github.com/OCA/l10n-romania +* add the path to this repository in your configuration (addons-path) +* update the module list +* search for "Romania - Stock Report" in your addons +* install the module + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-romania/issues>`_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_report%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Terrabit +* NextERP Romania + +Contributors +~~~~~~~~~~~~ + +* `Terrabit <https://www.terrabit.ro>`_: + + * Dorin Hongu <dhongu@gmail.com> + +* `NextERP Romania <https://www.nexterp.ro>`_: + + * Fekete Mihai <feketemihai@nexterp.ro> + * Alexandru Teodor <teodoralexandru@nexterp.ro> + * Musat Natanaela <musatnatanaela@nexterp.ro> + +Do not contact contributors directly about support or help with technical issues. + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-dhongu| image:: https://github.com/dhongu.png?size=40px + :target: https://github.com/dhongu + :alt: dhongu +.. |maintainer-feketemihai| image:: https://github.com/feketemihai.png?size=40px + :target: https://github.com/feketemihai + :alt: feketemihai + +Current `maintainers <https://odoo-community.org/page/maintainer-role>`__: + +|maintainer-dhongu| |maintainer-feketemihai| + +This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report>`_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_ro_stock_account_date/__init__.py b/l10n_ro_stock_account_date/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/l10n_ro_stock_account_date/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/l10n_ro_stock_account_date/__manifest__.py b/l10n_ro_stock_account_date/__manifest__.py new file mode 100644 index 000000000..6abeaf5d5 --- /dev/null +++ b/l10n_ro_stock_account_date/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright (C) 2022 NextERP Romania +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Romania - Stock Accounting Date", + "version": "14.0.0.0.1", + "category": "Localization", + "summary": "Romania - Stock Accounting Date", + "author": "NextERP Romania," "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/l10n-romania", + "depends": ["l10n_ro_stock_account"], + "license": "AGPL-3", + "data": [ + "views/stock_picking_views.xml", + "views/stock_valuation_layer_views.xml", + ], + "installable": True, + "maintainers": ["feketemihai"], +} diff --git a/l10n_ro_stock_account_date/models/__init__.py b/l10n_ro_stock_account_date/models/__init__.py new file mode 100644 index 000000000..9c344b9f2 --- /dev/null +++ b/l10n_ro_stock_account_date/models/__init__.py @@ -0,0 +1,4 @@ +from . import stock_move +from . import stock_move_line +from . import stock_picking +from . import stock_valuation_layer diff --git a/l10n_ro_stock_account_date/models/stock_move.py b/l10n_ro_stock_account_date/models/stock_move.py new file mode 100644 index 000000000..e907d3b8f --- /dev/null +++ b/l10n_ro_stock_account_date/models/stock_move.py @@ -0,0 +1,81 @@ +# Copyright (C) 2022 NextERP Romania SRL +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class StockMove(models.Model): + _inherit = "stock.move" + + def get_move_date(self): + self.ensure_one() + new_date = False + if self.picking_id: + if self.picking_id.accounting_date: + new_date = self.picking_id.accounting_date + elif self.inventory_id: + new_date = self.inventory_id.accounting_date + elif "raw_material_production_id" in self._fields: + if self.raw_material_production_id: + new_date = self.raw_material_production_id.date_planned_start + elif self.production_id: + new_date = self.production_id.date_planned_start + if not new_date: + new_date = fields.datetime.now() + return new_date + + def _action_done(self, cancel_backorder=False): + moves_todo = super()._action_done(cancel_backorder=cancel_backorder) + for move in moves_todo: + move.date = move.get_move_date() + return moves_todo + + def _trigger_assign(self): + res = super()._trigger_assign() + for move in self: + move.date = move.get_move_date() + return res + + def _get_price_unit(self): + # Update price unit for purchases in different currencies with the + # reception date. + if self.picking_id.date and self.purchase_line_id: + po_line = self.purchase_line_id + order = po_line.order_id + price_unit = po_line.price_unit + if po_line.taxes_id: + price_unit = po_line.taxes_id.with_context(round=False).compute_all( + price_unit, + currency=order.currency_id, + quantity=1.0, + product=po_line.product_id, + partner=order.partner_id, + )["total_excluded"] + if po_line.product_uom.id != po_line.product_id.uom_id.id: + price_unit *= ( + po_line.product_uom.factor / po_line.product_id.uom_id.factor + ) + if order.currency_id != order.company_id.currency_id: + price_unit = order.currency_id._convert( + price_unit, + order.company_id.currency_id, + self.company_id, + self.picking_id.accounting_date or fields.datetime.now(), + round=False, + ) + self.write( + { + "price_unit": price_unit, + "date": self.picking_id.accounting_date or fields.datetime.now(), + } + ) + return price_unit + return super()._get_price_unit() + + def _account_entry_move(self, qty, description, svl_id, cost): + self.ensure_one() + val_date = self.get_move_date() + self = self.with_context(force_period_date=val_date) + return super(StockMove, self)._account_entry_move( + qty, description, svl_id, cost + ) diff --git a/l10n_ro_stock_account_date/models/stock_move_line.py b/l10n_ro_stock_account_date/models/stock_move_line.py new file mode 100644 index 000000000..15ee789f2 --- /dev/null +++ b/l10n_ro_stock_account_date/models/stock_move_line.py @@ -0,0 +1,15 @@ +# Copyright (C) 2022 NextERP Romania SRL +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models + + +class StockMoveLine(models.Model): + _inherit = "stock.move.line" + + def _action_done(self): + res = super()._action_done() + for move_line in self.exists(): + if move_line.move_id: + move_line.date = move_line.move_id.get_move_date() + return res diff --git a/l10n_ro_stock_account_date/models/stock_picking.py b/l10n_ro_stock_account_date/models/stock_picking.py new file mode 100644 index 000000000..c18641a08 --- /dev/null +++ b/l10n_ro_stock_account_date/models/stock_picking.py @@ -0,0 +1,36 @@ +# Copyright (C) 2022 NextERP Romania SRL +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import _, fields, models +from odoo.exceptions import ValidationError + + +class StockPicking(models.Model): + _inherit = "stock.picking" + + accounting_date = fields.Datetime( + "Accounting Date", + copy=False, + help="If this field is set, the svl and accounting entiries will " + "have this date, If not will have the today date as it should be", + tracking=True, + ) + + def _action_done(self): + """Update date_done from accounting_date field""" + res = super()._action_done() + for picking in self: + if picking.accounting_date: + if picking.accounting_date.date() > fields.date.today(): + raise ValidationError( + _( + "You can not have a Accounting date=%s for picking " + "bigger than today!" % picking.accounting_date.date() + ) + ) + picking.write( + { + "date_done": picking.accounting_date, + } + ) + return res diff --git a/l10n_ro_stock_account_date/models/stock_valuation_layer.py b/l10n_ro_stock_account_date/models/stock_valuation_layer.py new file mode 100644 index 000000000..6df9e152c --- /dev/null +++ b/l10n_ro_stock_account_date/models/stock_valuation_layer.py @@ -0,0 +1,46 @@ +# Copyright (C) 2022 NextERP Romania SRL +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class StockValuationLayer(models.Model): + _inherit = "stock.valuation.layer" + _log_access = False + + create_date = fields.Datetime("Created on", index=True, readonly=True) + create_uid = fields.Many2one("res.users", "Created by", index=True, readonly=True) + write_date = fields.Datetime("Last Updated on", index=True, readonly=True) + write_uid = fields.Many2one( + "res.users", "Last Updated by", index=True, readonly=True + ) + date_done = fields.Datetime( + readonly=True, + help="This is the date when this recod was created. Original create_date is writen" + " at reception by module nexterp_stock_date", + ) + + @api.model_create_multi + def create(self, vals_list): + for values in vals_list: + val_date = fields.datetime.now() + if values.get("stock_move_id"): + move = self.env["stock.move"].browse(values["stock_move_id"]) + val_date = move.get_move_date() + values.update( + { + "create_uid": self._uid, + "create_date": val_date, + "write_uid": self._uid, + "write_date": val_date, + "date_done": fields.datetime.now(), + } + ) + return super().create(vals_list) + + def write(self, vals): + if not vals.get("write_uid"): + vals["write_uid"] = self._uid + if not vals.get("write_date"): + vals["write_date"] = fields.datetime.now() + return super().write(vals) diff --git a/l10n_ro_stock_account_date/readme/CONTRIBUTORS.rst b/l10n_ro_stock_account_date/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..f0dd53f10 --- /dev/null +++ b/l10n_ro_stock_account_date/readme/CONTRIBUTORS.rst @@ -0,0 +1,7 @@ +* `NextERP Romania <https://www.nexterp.ro>`_: + + * Fekete Mihai <feketemihai@nexterp.ro> + * Alexandru Teodor <teodoralexandru@nexterp.ro> + * Cojocaru Marcel <cojocarumarcel@nexterp.ro> + +Do not contact contributors directly about support or help with technical issues. diff --git a/l10n_ro_stock_account_date/readme/DESCRIPTION.rst b/l10n_ro_stock_account_date/readme/DESCRIPTION.rst new file mode 100644 index 000000000..031e25244 --- /dev/null +++ b/l10n_ro_stock_account_date/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows you to select "Accounting Date" for stock operations. diff --git a/l10n_ro_stock_account_date/readme/INSTALL.rst b/l10n_ro_stock_account_date/readme/INSTALL.rst new file mode 100644 index 000000000..35a8e323f --- /dev/null +++ b/l10n_ro_stock_account_date/readme/INSTALL.rst @@ -0,0 +1,7 @@ +To install this module, you need to: + +* clone the branch 14.0 of the repository https://github.com/OCA/l10n-romania +* add the path to this repository in your configuration (addons-path) +* update the module list +* search for "Romania - Stock Account Date" in your addons +* install the module diff --git a/l10n_ro_stock_account_date/static/description/icon.png b/l10n_ro_stock_account_date/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7ba9c1019cd79fba46148ad7c5deb9917b98888f GIT binary patch literal 566 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSY)RhkE<hRxemd{22U45`9+AZi z3<9q~m@#0=iyDw%S%G6ZkZu5DgNKH*7#J9>JY5_^DsH{Kw9(gzQN-aQds|CO;G9FQ zYi=Gg=$yTQ%~blvj2ktH%sTs@%ricy`;G^w845n!G5h?hFxvW&|LL-O_x0}2KmPfj z+2>7V=bZO%j`44wzy9;P4L|QMH8$QHYu!*Psc?>=kgdbmVGiRX9)a`*3+5w3P6+06 zU>K&Cv+tk8x6V~C_7PB2wZt`|BqgyV)hf9t6-Y4{85kPr8kp!B7=;*`SQ#5z8JTJu z7+Dz@te?hFi=rVnKP5A*5>11F1zf}ale*?W4U!-mg7ec#$`gxH8OqDc^)mCai<1)z YQuXqS(r3T3kpel+)78&qol`;+0JR&lX#fBK literal 0 HcmV?d00001 diff --git a/l10n_ro_stock_account_date/static/description/index.html b/l10n_ro_stock_account_date/static/description/index.html new file mode 100644 index 000000000..07787a304 --- /dev/null +++ b/l10n_ro_stock_account_date/static/description/index.html @@ -0,0 +1,444 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" /> +<title>Romania - Stock Report</title> +<style type="text/css"> + +/* +:Author: David Goodger (goodger@python.org) +:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $ +:Copyright: This stylesheet has been placed in the public domain. + +Default cascading style sheet for the HTML output of Docutils. + +See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to +customize this style sheet. +*/ + +/* used to remove borders from tables and images */ +.borderless, table.borderless td, table.borderless th { + border: 0 } + +table.borderless td, table.borderless th { + /* Override padding for "table.docutils td" with "! important". + The right padding separates the table cells. */ + padding: 0 0.5em 0 0 ! important } + +.first { + /* Override more specific margin styles with "! important". */ + margin-top: 0 ! important } + +.last, .with-subtitle { + margin-bottom: 0 ! important } + +.hidden { + display: none } + +.subscript { + vertical-align: sub; + font-size: smaller } + +.superscript { + vertical-align: super; + font-size: smaller } + +a.toc-backref { + text-decoration: none ; + color: black } + +blockquote.epigraph { + margin: 2em 5em ; } + +dl.docutils dd { + margin-bottom: 0.5em } + +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + +/* Uncomment (and remove this text!) to get bold-faced definition list terms +dl.docutils dt { + font-weight: bold } +*/ + +div.abstract { + margin: 2em 5em } + +div.abstract p.topic-title { + font-weight: bold ; + text-align: center } + +div.admonition, div.attention, div.caution, div.danger, div.error, +div.hint, div.important, div.note, div.tip, div.warning { + margin: 2em ; + border: medium outset ; + padding: 1em } + +div.admonition p.admonition-title, div.hint p.admonition-title, +div.important p.admonition-title, div.note p.admonition-title, +div.tip p.admonition-title { + font-weight: bold ; + font-family: sans-serif } + +div.attention p.admonition-title, div.caution p.admonition-title, +div.danger p.admonition-title, div.error p.admonition-title, +div.warning p.admonition-title, .code .error { + color: red ; + font-weight: bold ; + font-family: sans-serif } + +/* Uncomment (and remove this text!) to get reduced vertical space in + compound paragraphs. +div.compound .compound-first, div.compound .compound-middle { + margin-bottom: 0.5em } + +div.compound .compound-last, div.compound .compound-middle { + margin-top: 0.5em } +*/ + +div.dedication { + margin: 2em 5em ; + text-align: center ; + font-style: italic } + +div.dedication p.topic-title { + font-weight: bold ; + font-style: normal } + +div.figure { + margin-left: 2em ; + margin-right: 2em } + +div.footer, div.header { + clear: both; + font-size: smaller } + +div.line-block { + display: block ; + margin-top: 1em ; + margin-bottom: 1em } + +div.line-block div.line-block { + margin-top: 0 ; + margin-bottom: 0 ; + margin-left: 1.5em } + +div.sidebar { + margin: 0 0 0.5em 1em ; + border: medium outset ; + padding: 1em ; + background-color: #ffffee ; + width: 40% ; + float: right ; + clear: right } + +div.sidebar p.rubric { + font-family: sans-serif ; + font-size: medium } + +div.system-messages { + margin: 5em } + +div.system-messages h1 { + color: red } + +div.system-message { + border: medium outset ; + padding: 1em } + +div.system-message p.system-message-title { + color: red ; + font-weight: bold } + +div.topic { + margin: 2em } + +h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, +h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { + margin-top: 0.4em } + +h1.title { + text-align: center } + +h2.subtitle { + text-align: center } + +hr.docutils { + width: 75% } + +img.align-left, .figure.align-left, object.align-left, table.align-left { + clear: left ; + float: left ; + margin-right: 1em } + +img.align-right, .figure.align-right, object.align-right, table.align-right { + clear: right ; + float: right ; + margin-left: 1em } + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left } + +.align-center { + clear: both ; + text-align: center } + +.align-right { + text-align: right } + +/* reset inner alignment in figures */ +div.align-right { + text-align: inherit } + +/* div.align-center * { */ +/* text-align: left } */ + +.align-top { + vertical-align: top } + +.align-middle { + vertical-align: middle } + +.align-bottom { + vertical-align: bottom } + +ol.simple, ul.simple { + margin-bottom: 1em } + +ol.arabic { + list-style: decimal } + +ol.loweralpha { + list-style: lower-alpha } + +ol.upperalpha { + list-style: upper-alpha } + +ol.lowerroman { + list-style: lower-roman } + +ol.upperroman { + list-style: upper-roman } + +p.attribution { + text-align: right ; + margin-left: 50% } + +p.caption { + font-style: italic } + +p.credits { + font-style: italic ; + font-size: smaller } + +p.label { + white-space: nowrap } + +p.rubric { + font-weight: bold ; + font-size: larger ; + color: maroon ; + text-align: center } + +p.sidebar-title { + font-family: sans-serif ; + font-weight: bold ; + font-size: larger } + +p.sidebar-subtitle { + font-family: sans-serif ; + font-weight: bold } + +p.topic-title { + font-weight: bold } + +pre.address { + margin-bottom: 0 ; + margin-top: 0 ; + font: inherit } + +pre.literal-block, pre.doctest-block, pre.math, pre.code { + margin-left: 2em ; + margin-right: 2em } + +pre.code .ln { color: grey; } /* line numbers */ +pre.code, code { background-color: #eeeeee } +pre.code .comment, code .comment { color: #5C6576 } +pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } +pre.code .literal.string, code .literal.string { color: #0C5404 } +pre.code .name.builtin, code .name.builtin { color: #352B84 } +pre.code .deleted, code .deleted { background-color: #DEB0A1} +pre.code .inserted, code .inserted { background-color: #A3D289} + +span.classifier { + font-family: sans-serif ; + font-style: oblique } + +span.classifier-delimiter { + font-family: sans-serif ; + font-weight: bold } + +span.interpreted { + font-family: sans-serif } + +span.option { + white-space: nowrap } + +span.pre { + white-space: pre } + +span.problematic { + color: red } + +span.section-subtitle { + /* font-size relative to parent (h1..h6 element) */ + font-size: 80% } + +table.citation { + border-left: solid 1px gray; + margin-left: 1px } + +table.docinfo { + margin: 2em 4em } + +table.docutils { + margin-top: 0.5em ; + margin-bottom: 0.5em } + +table.footnote { + border-left: solid 1px black; + margin-left: 1px } + +table.docutils td, table.docutils th, +table.docinfo td, table.docinfo th { + padding-left: 0.5em ; + padding-right: 0.5em ; + vertical-align: top } + +table.docutils th.field-name, table.docinfo th.docinfo-name { + font-weight: bold ; + text-align: left ; + white-space: nowrap ; + padding-left: 0 } + +/* "booktabs" style (no vertical lines) */ +table.docutils.booktabs { + border: 0px; + border-top: 2px solid; + border-bottom: 2px solid; + border-collapse: collapse; +} +table.docutils.booktabs * { + border: 0px; +} +table.docutils.booktabs th { + border-bottom: thin solid; + text-align: left; +} + +h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, +h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { + font-size: 100% } + +ul.auto-toc { + list-style-type: none } + +</style> +</head> +<body> +<div class="document" id="romania-stock-report"> +<h1 class="title">Romania - Stock Report</h1> + +<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! This file is generated by oca-gen-addon-readme !! +!! changes will be overwritten. !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> +<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_report"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> +<p>This module adds a stock report according to Romanian requirements.</p> +<p><strong>Table of contents</strong></p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#installation" id="id1">Installation</a></li> +<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li> +<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul> +<li><a class="reference internal" href="#authors" id="id4">Authors</a></li> +<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li> +<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li> +</ul> +</li> +</ul> +</div> +<div class="section" id="installation"> +<h1><a class="toc-backref" href="#id1">Installation</a></h1> +<p>To install this module, you need to:</p> +<ul class="simple"> +<li>clone the branch 14.0 of the repository <a class="reference external" href="https://github.com/OCA/l10n-romania">https://github.com/OCA/l10n-romania</a></li> +<li>add the path to this repository in your configuration (addons-path)</li> +<li>update the module list</li> +<li>search for “Romania - Stock Report” in your addons</li> +<li>install the module</li> +</ul> +</div> +<div class="section" id="bug-tracker"> +<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1> +<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-romania/issues">GitHub Issues</a>. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_report%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> +<p>Do not contact contributors directly about support or help with technical issues.</p> +</div> +<div class="section" id="credits"> +<h1><a class="toc-backref" href="#id3">Credits</a></h1> +<div class="section" id="authors"> +<h2><a class="toc-backref" href="#id4">Authors</a></h2> +<ul class="simple"> +<li>Terrabit</li> +<li>NextERP Romania</li> +</ul> +</div> +<div class="section" id="contributors"> +<h2><a class="toc-backref" href="#id5">Contributors</a></h2> +<ul class="simple"> +<li><a class="reference external" href="https://www.terrabit.ro">Terrabit</a>:<ul> +<li>Dorin Hongu <<a class="reference external" href="mailto:dhongu@gmail.com">dhongu@gmail.com</a>></li> +</ul> +</li> +<li><a class="reference external" href="https://www.nexterp.ro">NextERP Romania</a>:<ul> +<li>Fekete Mihai <<a class="reference external" href="mailto:feketemihai@nexterp.ro">feketemihai@nexterp.ro</a>></li> +<li>Alexandru Teodor <<a class="reference external" href="mailto:teodoralexandru@nexterp.ro">teodoralexandru@nexterp.ro</a>></li> +<li>Musat Natanaela <<a class="reference external" href="mailto:musatnatanaela@nexterp.ro">musatnatanaela@nexterp.ro</a>></li> +</ul> +</li> +</ul> +<p>Do not contact contributors directly about support or help with technical issues.</p> +</div> +<div class="section" id="maintainers"> +<h2><a class="toc-backref" href="#id6">Maintainers</a></h2> +<p>This module is maintained by the OCA.</p> +<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> +<p>OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.</p> +<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p> +<p><a class="reference external" href="https://github.com/dhongu"><img alt="dhongu" src="https://github.com/dhongu.png?size=40px" /></a> <a class="reference external" href="https://github.com/feketemihai"><img alt="feketemihai" src="https://github.com/feketemihai.png?size=40px" /></a></p> +<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report">OCA/l10n-romania</a> project on GitHub.</p> +<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> +</div> +</div> +</div> +</body> +</html> diff --git a/l10n_ro_stock_account_date/static/src/css/report.css b/l10n_ro_stock_account_date/static/src/css/report.css new file mode 100644 index 000000000..c37ada778 --- /dev/null +++ b/l10n_ro_stock_account_date/static/src/css/report.css @@ -0,0 +1,70 @@ +.act_as_table { + display: table; + background-color: white; +} +.act_as_row { + display: table-row; + page-break-inside: avoid; +} +.act_as_cell { + display: table-cell; + page-break-inside: avoid; +} +.act_as_thead { + display: table-header-group; +} +.act_as_row.labels { + background-color: #f0f0f0; +} +.data_table { + width: 100%; + border-left: 0px; + border-right: 0px; + text-align: center; + font-size: 10px; + padding-right: 3px; + padding-left: 3px; + padding-top: 2px; + padding-bottom: 2px; + border-collapse: collapse; +} +.data_table .act_as_cell { + border: 1px solid lightGrey; + text-align: center; +} + +.data_table .act_as_cell { + word-wrap: break-word; +} +.data_table .act_as_row.labels { + font-weight: bold; +} +.act_as_cell.left { + text-align: left; + padding: 5px 7px; +} +.act_as_cell.right { + text-align: right; + padding: 5px 7px; +} +.act_as_cell.sold { + font-style: italic; + font-weight: bold; +} + +.custom_footer { + font-size: 7px !important; +} +.button_row { + padding-bottom: 10px; +} +.o_stock_sheet_reports_page { + padding-top: 10px; + width: 90%; + margin-right: auto; + margin-left: auto; + font-family: Helvetica, Arial, serif; +} +.act_as_caption { + display: run-in; +} diff --git a/l10n_ro_stock_account_date/tests/__init__.py b/l10n_ro_stock_account_date/tests/__init__.py new file mode 100644 index 000000000..66210a1c2 --- /dev/null +++ b/l10n_ro_stock_account_date/tests/__init__.py @@ -0,0 +1 @@ +from . import test_stock_accounting_date diff --git a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py new file mode 100644 index 000000000..06b3fc075 --- /dev/null +++ b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py @@ -0,0 +1,107 @@ +# Copyright (C) 2020 Terrabit +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +import logging +from datetime import timedelta + +from odoo import fields +from odoo.tests import tagged + +from odoo.addons.l10n_ro_stock_account.tests.common import TestStockCommon + +_logger = logging.getLogger(__name__) + + +@tagged("post_install", "-at_install") +class TestStockReport(TestStockCommon): + def set_stock(self, product, qty): + inventory = self.env["stock.inventory"].create( + { + "location_ids": [(4, self.location_warehouse.id)], + "product_ids": [(4, product.id)], + } + ) + inventory.action_start() + + inventory.line_ids.product_qty = qty + inventory.action_validate() + + def trasfer(self, location, location_dest, product=None, accounting_date=False): + + self.PickingObj = self.env["stock.picking"] + self.MoveObj = self.env["stock.move"] + self.MoveObj = self.env["stock.move"] + + if not product: + product = self.product_mp + + picking = self.PickingObj.create( + { + "picking_type_id": self.picking_type_transfer.id, + "location_id": location.id, + "location_dest_id": location_dest.id, + } + ) + self.MoveObj.create( + { + "name": product.name, + "product_id": product.id, + "product_uom_qty": 2, + "product_uom": product.uom_id.id, + "picking_id": picking.id, + "location_id": location.id, + "location_dest_id": location_dest.id, + } + ) + if accounting_date: + picking.accounting_date = accounting_date + picking.action_confirm() + picking.action_assign() + for move_line in picking.move_lines: + if move_line.product_uom_qty > 0 and move_line.quantity_done == 0: + move_line.write({"quantity_done": move_line.product_uom_qty}) + picking._action_done() + return picking + + def test_inventory(self): + self.make_puchase() + acc_date = fields.Date.today() - timedelta(days=1) + inventory = self.env["stock.inventory"].create( + { + "location_ids": [(4, self.location_warehouse.id)], + "product_ids": [(4, self.product_1.id)], + "accounting_date": acc_date, + } + ) + inventory.action_start() + inventory.line_ids.product_qty = self.qty_po_p1 + 10 + _logger.info("start inventory") + inventory.action_validate() + stock_move = inventory.move_ids + self.assertEqual(inventory.accounting_date, acc_date) + self.assertEqual(stock_move.date.date(), acc_date) + self.assertEqual(stock_move.move_line_ids.date.date(), acc_date) + self.assertEqual( + stock_move.stock_valuation_layer_ids.create_date.date(), acc_date + ) + self.assertEqual(stock_move.account_move_ids.date, acc_date) + + def test_transfer(self): + self.set_stock(self.product_mp, 1000) + acc_date = fields.Date.today() - timedelta(days=1) + location_id = self.picking_type_transfer.default_location_src_id + location_dest_id = self.picking_type_transfer.default_location_dest_id.copy( + {"property_stock_valuation_account_id": self.account_valuation.id} + ) + _logger.info("Start transfer") + picking = self.trasfer(location_id, location_dest_id, accounting_date=acc_date) + stock_move = picking.move_lines + _logger.info("Tranfer efectuat") + self.assertEqual(picking.accounting_date.date(), acc_date) + self.assertEqual(stock_move.date.date(), acc_date) + self.assertEqual(stock_move.move_line_ids.date.date(), acc_date) + self.assertEqual( + stock_move.stock_valuation_layer_ids.mapped("create_date")[0].date(), + acc_date, + ) + self.assertEqual(stock_move.account_move_ids.date, acc_date) diff --git a/l10n_ro_stock_account_date/views/stock_picking_views.xml b/l10n_ro_stock_account_date/views/stock_picking_views.xml new file mode 100644 index 000000000..3b9131c2b --- /dev/null +++ b/l10n_ro_stock_account_date/views/stock_picking_views.xml @@ -0,0 +1,43 @@ +<odoo> + <record id="vpicktree" model="ir.ui.view"> + <field name="name">stock.picking.tree</field> + <field name="model">stock.picking</field> + <field name="inherit_id" ref="stock.vpicktree" /> + <field name="arch" type="xml"> + <field name="scheduled_date" position="before"> + <field name="accounting_date" readonly="1" /> + </field> + </field> + </record> + + <record id="view_picking_form" model="ir.ui.view"> + <field name="name">stock.picking.form</field> + <field name="model">stock.picking</field> + <field name="inherit_id" ref="stock.view_picking_form" /> + <field name="arch" type="xml"> + <xpath expr="//label[@for='scheduled_date']" position="before"> + <label for="accounting_date" /> + <div class="o_row"> + <field name="accounting_date" /> + </div> + </xpath> + </field> + </record> + + <record id="view_picking_internal_search" model="ir.ui.view"> + <field name="name">stock.picking.internal.search</field> + <field name="model">stock.picking</field> + <field name="inherit_id" ref="stock.view_picking_internal_search" /> + <field name="arch" type="xml"> + <filter name="expected_date" position="before"> + <filter + string="Accounting Date" + name="accounting_date" + domain="[]" + context="{'group_by': 'accounting_date'}" + /> + </filter> + + </field> + </record> +</odoo> diff --git a/l10n_ro_stock_account_date/views/stock_valuation_layer_views.xml b/l10n_ro_stock_account_date/views/stock_valuation_layer_views.xml new file mode 100644 index 000000000..fa77977a8 --- /dev/null +++ b/l10n_ro_stock_account_date/views/stock_valuation_layer_views.xml @@ -0,0 +1,12 @@ +<odoo> + <record id="stock_valuation_layer_form" model="ir.ui.view"> + <field name="model">stock.valuation.layer</field> + <field name="inherit_id" ref="stock_account.stock_valuation_layer_form" /> + <field name="priority">290</field> + <field name="arch" type="xml"> + <field name="create_date" position="after"> + <field name="date_done" /> + </field> + </field> + </record> +</odoo> From 24f2d0db25a6db8772e45bb7d66c9da7b7740e25 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 26 Jul 2022 14:37:09 +0000 Subject: [PATCH 02/68] [UPD] README.rst --- l10n_ro_stock_account_date/README.rst | 32 +++++++------------ .../static/description/index.html | 27 +++++++--------- 2 files changed, 23 insertions(+), 36 deletions(-) diff --git a/l10n_ro_stock_account_date/README.rst b/l10n_ro_stock_account_date/README.rst index 019be7b4c..713de3e28 100644 --- a/l10n_ro_stock_account_date/README.rst +++ b/l10n_ro_stock_account_date/README.rst @@ -1,6 +1,6 @@ -====================== -Romania - Stock Report -====================== +=============================== +Romania - Stock Accounting Date +=============================== .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! @@ -14,10 +14,10 @@ Romania - Stock Report :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github - :target: https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report + :target: https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date :alt: OCA/l10n-romania .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_report + :target: https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_account_date :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png :target: https://runbot.odoo-community.org/runbot/177/14.0 @@ -25,7 +25,7 @@ Romania - Stock Report |badge1| |badge2| |badge3| |badge4| |badge5| -This module adds a stock report according to Romanian requirements. +This module allows you to select "Accounting Date" for stock operations. **Table of contents** @@ -40,7 +40,7 @@ To install this module, you need to: * clone the branch 14.0 of the repository https://github.com/OCA/l10n-romania * add the path to this repository in your configuration (addons-path) * update the module list -* search for "Romania - Stock Report" in your addons +* search for "Romania - Stock Account Date" in your addons * install the module Bug Tracker @@ -49,7 +49,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-romania/issues>`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_report%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. +`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. Do not contact contributors directly about support or help with technical issues. @@ -59,21 +59,16 @@ Credits Authors ~~~~~~~ -* Terrabit * NextERP Romania Contributors ~~~~~~~~~~~~ -* `Terrabit <https://www.terrabit.ro>`_: - - * Dorin Hongu <dhongu@gmail.com> - * `NextERP Romania <https://www.nexterp.ro>`_: * Fekete Mihai <feketemihai@nexterp.ro> * Alexandru Teodor <teodoralexandru@nexterp.ro> - * Musat Natanaela <musatnatanaela@nexterp.ro> + * Cojocaru Marcel <cojocarumarcel@nexterp.ro> Do not contact contributors directly about support or help with technical issues. @@ -90,17 +85,14 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -.. |maintainer-dhongu| image:: https://github.com/dhongu.png?size=40px - :target: https://github.com/dhongu - :alt: dhongu .. |maintainer-feketemihai| image:: https://github.com/feketemihai.png?size=40px :target: https://github.com/feketemihai :alt: feketemihai -Current `maintainers <https://odoo-community.org/page/maintainer-role>`__: +Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: -|maintainer-dhongu| |maintainer-feketemihai| +|maintainer-feketemihai| -This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report>`_ project on GitHub. +This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date>`_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_ro_stock_account_date/static/description/index.html b/l10n_ro_stock_account_date/static/description/index.html index 07787a304..9d03f5d47 100644 --- a/l10n_ro_stock_account_date/static/description/index.html +++ b/l10n_ro_stock_account_date/static/description/index.html @@ -4,7 +4,7 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" /> -<title>Romania - Stock Report</title> +<title>Romania - Stock Accounting Date</title> <style type="text/css"> /* @@ -360,15 +360,15 @@ </style> </head> <body> -<div class="document" id="romania-stock-report"> -<h1 class="title">Romania - Stock Report</h1> +<div class="document" id="romania-stock-accounting-date"> +<h1 class="title">Romania - Stock Accounting Date</h1> <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_report"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> -<p>This module adds a stock report according to Romanian requirements.</p> +<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_account_date"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> +<p>This module allows you to select “Accounting Date” for stock operations.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> @@ -389,7 +389,7 @@ <h1><a class="toc-backref" href="#id1">Installation</a></h1> <li>clone the branch 14.0 of the repository <a class="reference external" href="https://github.com/OCA/l10n-romania">https://github.com/OCA/l10n-romania</a></li> <li>add the path to this repository in your configuration (addons-path)</li> <li>update the module list</li> -<li>search for “Romania - Stock Report” in your addons</li> +<li>search for “Romania - Stock Account Date” in your addons</li> <li>install the module</li> </ul> </div> @@ -398,7 +398,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-romania/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_report%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> +<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> </div> <div class="section" id="credits"> @@ -406,21 +406,16 @@ <h1><a class="toc-backref" href="#id3">Credits</a></h1> <div class="section" id="authors"> <h2><a class="toc-backref" href="#id4">Authors</a></h2> <ul class="simple"> -<li>Terrabit</li> <li>NextERP Romania</li> </ul> </div> <div class="section" id="contributors"> <h2><a class="toc-backref" href="#id5">Contributors</a></h2> <ul class="simple"> -<li><a class="reference external" href="https://www.terrabit.ro">Terrabit</a>:<ul> -<li>Dorin Hongu <<a class="reference external" href="mailto:dhongu@gmail.com">dhongu@gmail.com</a>></li> -</ul> -</li> <li><a class="reference external" href="https://www.nexterp.ro">NextERP Romania</a>:<ul> <li>Fekete Mihai <<a class="reference external" href="mailto:feketemihai@nexterp.ro">feketemihai@nexterp.ro</a>></li> <li>Alexandru Teodor <<a class="reference external" href="mailto:teodoralexandru@nexterp.ro">teodoralexandru@nexterp.ro</a>></li> -<li>Musat Natanaela <<a class="reference external" href="mailto:musatnatanaela@nexterp.ro">musatnatanaela@nexterp.ro</a>></li> +<li>Cojocaru Marcel <<a class="reference external" href="mailto:cojocarumarcel@nexterp.ro">cojocarumarcel@nexterp.ro</a>></li> </ul> </li> </ul> @@ -433,9 +428,9 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2> <p>OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.</p> -<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p> -<p><a class="reference external" href="https://github.com/dhongu"><img alt="dhongu" src="https://github.com/dhongu.png?size=40px" /></a> <a class="reference external" href="https://github.com/feketemihai"><img alt="feketemihai" src="https://github.com/feketemihai.png?size=40px" /></a></p> -<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report">OCA/l10n-romania</a> project on GitHub.</p> +<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> +<p><a class="reference external" href="https://github.com/feketemihai"><img alt="feketemihai" src="https://github.com/feketemihai.png?size=40px" /></a></p> +<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date">OCA/l10n-romania</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> </div> </div> From 035f9fd8f9996c2b572449d2a32a397472de0eba Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 26 Jul 2022 14:37:12 +0000 Subject: [PATCH 03/68] l10n_ro_stock_account_date 14.0.0.1.0 --- l10n_ro_stock_account_date/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/__manifest__.py b/l10n_ro_stock_account_date/__manifest__.py index 6abeaf5d5..116b45b72 100644 --- a/l10n_ro_stock_account_date/__manifest__.py +++ b/l10n_ro_stock_account_date/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date", - "version": "14.0.0.0.1", + "version": "14.0.0.1.0", "category": "Localization", "summary": "Romania - Stock Accounting Date", "author": "NextERP Romania," "Odoo Community Association (OCA)", From e22dd7439fffffdabe373531c26a4db4ff94a78e Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Wed, 27 Jul 2022 15:27:09 +0300 Subject: [PATCH 04/68] Update accounting date readonly in done --- l10n_ro_stock_account_date/views/stock_picking_views.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/views/stock_picking_views.xml b/l10n_ro_stock_account_date/views/stock_picking_views.xml index 3b9131c2b..a9d4d3b49 100644 --- a/l10n_ro_stock_account_date/views/stock_picking_views.xml +++ b/l10n_ro_stock_account_date/views/stock_picking_views.xml @@ -18,7 +18,10 @@ <xpath expr="//label[@for='scheduled_date']" position="before"> <label for="accounting_date" /> <div class="o_row"> - <field name="accounting_date" /> + <field + name="accounting_date" + attrs="{'readonly': [('state', '=', 'done')]}" + /> </div> </xpath> </field> From c5b73f1c63bcd8d435467fd16227c8795066a993 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Thu, 28 Jul 2022 05:49:32 +0000 Subject: [PATCH 05/68] l10n_ro_stock_account_date 14.0.0.2.0 --- l10n_ro_stock_account_date/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/__manifest__.py b/l10n_ro_stock_account_date/__manifest__.py index 116b45b72..af2a7f2a4 100644 --- a/l10n_ro_stock_account_date/__manifest__.py +++ b/l10n_ro_stock_account_date/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date", - "version": "14.0.0.1.0", + "version": "14.0.0.2.0", "category": "Localization", "summary": "Romania - Stock Accounting Date", "author": "NextERP Romania," "Odoo Community Association (OCA)", From e058a89781b9acb5eaf58e982442da0d097d98f9 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Thu, 28 Jul 2022 19:51:19 +0300 Subject: [PATCH 06/68] Migrate l10n_ro_stock_account_date to 15.0 --- l10n_ro_stock_account_date/__manifest__.py | 2 +- l10n_ro_stock_account_date/models/stock_picking.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_ro_stock_account_date/__manifest__.py b/l10n_ro_stock_account_date/__manifest__.py index af2a7f2a4..6a48fe2f0 100644 --- a/l10n_ro_stock_account_date/__manifest__.py +++ b/l10n_ro_stock_account_date/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date", - "version": "14.0.0.2.0", + "version": "15.0.0.2.0", "category": "Localization", "summary": "Romania - Stock Accounting Date", "author": "NextERP Romania," "Odoo Community Association (OCA)", diff --git a/l10n_ro_stock_account_date/models/stock_picking.py b/l10n_ro_stock_account_date/models/stock_picking.py index c18641a08..44f32efaf 100644 --- a/l10n_ro_stock_account_date/models/stock_picking.py +++ b/l10n_ro_stock_account_date/models/stock_picking.py @@ -9,7 +9,6 @@ class StockPicking(models.Model): _inherit = "stock.picking" accounting_date = fields.Datetime( - "Accounting Date", copy=False, help="If this field is set, the svl and accounting entiries will " "have this date, If not will have the today date as it should be", @@ -25,8 +24,9 @@ def _action_done(self): raise ValidationError( _( "You can not have a Accounting date=%s for picking " - "bigger than today!" % picking.accounting_date.date() + "bigger than today!" ) + % picking.accounting_date.date() ) picking.write( { From a5951a7ab5f4ee77047758ff6d1de4e6ae6af94e Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Fri, 29 Jul 2022 09:11:02 +0300 Subject: [PATCH 07/68] Migrate l10n_ro_stock_account_date to 15.0 --- l10n_ro_stock_account_date/models/__init__.py | 1 + .../models/stock_move.py | 19 ++++++--- .../models/stock_move_line.py | 3 +- .../models/stock_quant.py | 26 ++++++++++++ .../tests/test_stock_accounting_date.py | 42 +++++++++++-------- 5 files changed, 67 insertions(+), 24 deletions(-) create mode 100644 l10n_ro_stock_account_date/models/stock_quant.py diff --git a/l10n_ro_stock_account_date/models/__init__.py b/l10n_ro_stock_account_date/models/__init__.py index 9c344b9f2..a6b5e4a24 100644 --- a/l10n_ro_stock_account_date/models/__init__.py +++ b/l10n_ro_stock_account_date/models/__init__.py @@ -1,4 +1,5 @@ from . import stock_move from . import stock_move_line +from . import stock_quant from . import stock_picking from . import stock_valuation_layer diff --git a/l10n_ro_stock_account_date/models/stock_move.py b/l10n_ro_stock_account_date/models/stock_move.py index e907d3b8f..21b78d058 100644 --- a/l10n_ro_stock_account_date/models/stock_move.py +++ b/l10n_ro_stock_account_date/models/stock_move.py @@ -13,8 +13,8 @@ def get_move_date(self): if self.picking_id: if self.picking_id.accounting_date: new_date = self.picking_id.accounting_date - elif self.inventory_id: - new_date = self.inventory_id.accounting_date + elif self.is_inventory and self.date: + new_date = self.date elif "raw_material_production_id" in self._fields: if self.raw_material_production_id: new_date = self.raw_material_production_id.date_planned_start @@ -25,15 +25,24 @@ def get_move_date(self): return new_date def _action_done(self, cancel_backorder=False): + move_dates = {} + for move in self.filtered(lambda m: m.is_inventory and m.date): + move_dates[move.id] = move.date moves_todo = super()._action_done(cancel_backorder=cancel_backorder) for move in moves_todo: - move.date = move.get_move_date() + if not move.is_inventory: + move.date = move.get_move_date() + if move_dates.get(move.id): + move.date = move_dates[move.id] + move.stock_valuation_layer_ids.sudo().write({"create_date": move.date}) + move.account_move_ids.sudo().write({"date": move.date}) return moves_todo def _trigger_assign(self): res = super()._trigger_assign() for move in self: - move.date = move.get_move_date() + if not move.is_inventory: + move.date = move.get_move_date() return res def _get_price_unit(self): @@ -74,7 +83,7 @@ def _get_price_unit(self): def _account_entry_move(self, qty, description, svl_id, cost): self.ensure_one() - val_date = self.get_move_date() + val_date = self.get_move_date() or self.date self = self.with_context(force_period_date=val_date) return super(StockMove, self)._account_entry_move( qty, description, svl_id, cost diff --git a/l10n_ro_stock_account_date/models/stock_move_line.py b/l10n_ro_stock_account_date/models/stock_move_line.py index 15ee789f2..b2e7c5f52 100644 --- a/l10n_ro_stock_account_date/models/stock_move_line.py +++ b/l10n_ro_stock_account_date/models/stock_move_line.py @@ -10,6 +10,5 @@ class StockMoveLine(models.Model): def _action_done(self): res = super()._action_done() for move_line in self.exists(): - if move_line.move_id: - move_line.date = move_line.move_id.get_move_date() + move_line.date = move_line.move_id.get_move_date() return res diff --git a/l10n_ro_stock_account_date/models/stock_quant.py b/l10n_ro_stock_account_date/models/stock_quant.py new file mode 100644 index 000000000..bc918c5ba --- /dev/null +++ b/l10n_ro_stock_account_date/models/stock_quant.py @@ -0,0 +1,26 @@ +# Copyright (C) 2022 NextERP Romania SRL +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models + + +class StockQuant(models.Model): + _inherit = "stock.quant" + + def _get_inventory_move_values(self, qty, location_id, location_dest_id, out=False): + # Inherit to set date as accounting_date from inventoried quant + self.ensure_one() + vals = super()._get_inventory_move_values( + qty, location_id, location_dest_id, out + ) + if self.accounting_date: + vals["date"] = self.accounting_date + return vals + + def _apply_inventory(self): + # If accounting date is set, set also inventory date + res = super()._apply_inventory() + for quant in self: + if quant.accounting_date: + quant.inventory_date = quant.accounting_date + return res diff --git a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py index 06b3fc075..b0a736e27 100644 --- a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py +++ b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py @@ -15,16 +15,15 @@ @tagged("post_install", "-at_install") class TestStockReport(TestStockCommon): def set_stock(self, product, qty): - inventory = self.env["stock.inventory"].create( + inventory_obj = self.env["stock.quant"].with_context(inventory_mode=True) + inventory = inventory_obj.create( { - "location_ids": [(4, self.location_warehouse.id)], - "product_ids": [(4, product.id)], + "location_id": self.location_warehouse.id, + "product_id": product.id, + "inventory_quantity": qty, } ) - inventory.action_start() - - inventory.line_ids.product_qty = qty - inventory.action_validate() + inventory._apply_inventory() def trasfer(self, location, location_dest, product=None, accounting_date=False): @@ -66,19 +65,28 @@ def trasfer(self, location, location_dest, product=None, accounting_date=False): def test_inventory(self): self.make_puchase() acc_date = fields.Date.today() - timedelta(days=1) - inventory = self.env["stock.inventory"].create( + inventory_obj = self.env["stock.quant"].with_context(inventory_mode=True) + inventory = inventory_obj.create( { - "location_ids": [(4, self.location_warehouse.id)], - "product_ids": [(4, self.product_1.id)], - "accounting_date": acc_date, + "location_id": self.location_warehouse.id, + "product_id": self.product_1.id, + "inventory_quantity": self.qty_po_p1 + 10, } ) - inventory.action_start() - inventory.line_ids.product_qty = self.qty_po_p1 + 10 - _logger.info("start inventory") - inventory.action_validate() - stock_move = inventory.move_ids - self.assertEqual(inventory.accounting_date, acc_date) + inventory.accounting_date = acc_date + inventory._apply_inventory() + stock_move = self.env["stock.move"].search( + [ + ( + "location_id", + "=", + inventory.product_id.with_company( + inventory.company_id + ).property_stock_inventory.id, + ) + ] + ) + self.assertEqual(stock_move.date.date(), acc_date) self.assertEqual(stock_move.move_line_ids.date.date(), acc_date) self.assertEqual( From b979c4e3f03b1b0134e1fa4ef596d28ab90377df Mon Sep 17 00:00:00 2001 From: oca-ci <oca-ci@odoo-community.org> Date: Fri, 29 Jul 2022 06:49:49 +0000 Subject: [PATCH 08/68] [UPD] Update l10n_ro_stock_account_date.pot --- .../i18n/l10n_ro_stock_account_date.pot | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot diff --git a/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot b/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot new file mode 100644 index 000000000..b83f03719 --- /dev/null +++ b/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot @@ -0,0 +1,90 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_ro_stock_account_date +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_picking__accounting_date +#: model_terms:ir.ui.view,arch_db:l10n_ro_stock_account_date.view_picking_internal_search +msgid "Accounting Date" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__create_uid +msgid "Created by" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__create_date +msgid "Created on" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__date_done +msgid "Date Done" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_picking__accounting_date +msgid "" +"If this field is set, the svl and accounting entiries will have this date, " +"If not will have the today date as it should be" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__write_date +msgid "Last Updated on" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model,name:l10n_ro_stock_account_date.model_stock_move_line +msgid "Product Moves (Stock Move Line)" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model,name:l10n_ro_stock_account_date.model_stock_quant +msgid "Quants" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model,name:l10n_ro_stock_account_date.model_stock_move +msgid "Stock Move" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model,name:l10n_ro_stock_account_date.model_stock_valuation_layer +msgid "Stock Valuation Layer" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_valuation_layer__date_done +msgid "" +"This is the date when this recod was created. Original create_date is writen" +" at reception by module nexterp_stock_date" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model,name:l10n_ro_stock_account_date.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: code:addons/l10n_ro_stock_account_date/models/stock_picking.py:0 +#, python-format +msgid "You can not have a Accounting date=%s for picking bigger than today!" +msgstr "" From 923cd239b10f3e3f6059d925dd84df959f09631f Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Fri, 29 Jul 2022 07:00:02 +0000 Subject: [PATCH 09/68] [UPD] README.rst --- l10n_ro_stock_account_date/README.rst | 10 +++++----- .../static/description/index.html | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/l10n_ro_stock_account_date/README.rst b/l10n_ro_stock_account_date/README.rst index 713de3e28..d7da34ef8 100644 --- a/l10n_ro_stock_account_date/README.rst +++ b/l10n_ro_stock_account_date/README.rst @@ -14,13 +14,13 @@ Romania - Stock Accounting Date :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github - :target: https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date + :target: https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date :alt: OCA/l10n-romania .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_account_date + :target: https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/177/14.0 + :target: https://runbot.odoo-community.org/runbot/177/15.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -49,7 +49,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-romania/issues>`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. +`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. Do not contact contributors directly about support or help with technical issues. @@ -93,6 +93,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: |maintainer-feketemihai| -This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date>`_ project on GitHub. +This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date>`_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_ro_stock_account_date/static/description/index.html b/l10n_ro_stock_account_date/static/description/index.html index 9d03f5d47..7f96f2c71 100644 --- a/l10n_ro_stock_account_date/static/description/index.html +++ b/l10n_ro_stock_account_date/static/description/index.html @@ -367,7 +367,7 @@ <h1 class="title">Romania - Stock Accounting Date</h1> !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_account_date"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> +<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>This module allows you to select “Accounting Date” for stock operations.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> @@ -398,7 +398,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-romania/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> +<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> </div> <div class="section" id="credits"> @@ -430,7 +430,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2> promote its widespread use.</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> <p><a class="reference external" href="https://github.com/feketemihai"><img alt="feketemihai" src="https://github.com/feketemihai.png?size=40px" /></a></p> -<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date">OCA/l10n-romania</a> project on GitHub.</p> +<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date">OCA/l10n-romania</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> </div> </div> From 6c499a504ef9ad4298916a997d2090ae0a812b28 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Fri, 29 Jul 2022 07:00:03 +0000 Subject: [PATCH 10/68] l10n_ro_stock_account_date 15.0.0.3.0 --- l10n_ro_stock_account_date/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/__manifest__.py b/l10n_ro_stock_account_date/__manifest__.py index 6a48fe2f0..ab3a6c84e 100644 --- a/l10n_ro_stock_account_date/__manifest__.py +++ b/l10n_ro_stock_account_date/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date", - "version": "15.0.0.2.0", + "version": "15.0.0.3.0", "category": "Localization", "summary": "Romania - Stock Accounting Date", "author": "NextERP Romania," "Odoo Community Association (OCA)", From a1cc0d721346ebaf7d271cfd576cb0d2d4e21445 Mon Sep 17 00:00:00 2001 From: Fekete Mihai <feketemihai@nexterp.ro> Date: Fri, 7 Oct 2022 05:15:02 +0000 Subject: [PATCH 11/68] Added translation using Weblate (Romanian) --- l10n_ro_stock_account_date/i18n/ro.po | 92 +++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 l10n_ro_stock_account_date/i18n/ro.po diff --git a/l10n_ro_stock_account_date/i18n/ro.po b/l10n_ro_stock_account_date/i18n/ro.po new file mode 100644 index 000000000..032b46856 --- /dev/null +++ b/l10n_ro_stock_account_date/i18n/ro.po @@ -0,0 +1,92 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_ro_stock_account_date +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " +"20)) ? 1 : 2;\n" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_picking__accounting_date +#: model_terms:ir.ui.view,arch_db:l10n_ro_stock_account_date.view_picking_internal_search +msgid "Accounting Date" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__create_uid +msgid "Created by" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__create_date +msgid "Created on" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__date_done +msgid "Date Done" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_picking__accounting_date +msgid "" +"If this field is set, the svl and accounting entiries will have this date, " +"If not will have the today date as it should be" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__write_date +msgid "Last Updated on" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model,name:l10n_ro_stock_account_date.model_stock_move_line +msgid "Product Moves (Stock Move Line)" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model,name:l10n_ro_stock_account_date.model_stock_quant +msgid "Quants" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model,name:l10n_ro_stock_account_date.model_stock_move +msgid "Stock Move" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model,name:l10n_ro_stock_account_date.model_stock_valuation_layer +msgid "Stock Valuation Layer" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_valuation_layer__date_done +msgid "" +"This is the date when this recod was created. Original create_date is writen" +" at reception by module nexterp_stock_date" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model,name:l10n_ro_stock_account_date.model_stock_picking +msgid "Transfer" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: code:addons/l10n_ro_stock_account_date/models/stock_picking.py:0 +#, python-format +msgid "You can not have a Accounting date=%s for picking bigger than today!" +msgstr "" From f15de57bf8b036f2607350c31657e4225d72a3d6 Mon Sep 17 00:00:00 2001 From: Fekete Mihai <feketemihai@nexterp.ro> Date: Fri, 7 Oct 2022 05:16:07 +0000 Subject: [PATCH 12/68] Translated using Weblate (Romanian) Currently translated at 21.4% (3 of 14 strings) Translation: l10n-romania-15.0/l10n-romania-15.0-l10n_ro_stock_account_date Translate-URL: https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date/ro/ --- l10n_ro_stock_account_date/i18n/ro.po | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/l10n_ro_stock_account_date/i18n/ro.po b/l10n_ro_stock_account_date/i18n/ro.po index 032b46856..f173cb106 100644 --- a/l10n_ro_stock_account_date/i18n/ro.po +++ b/l10n_ro_stock_account_date/i18n/ro.po @@ -6,7 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2022-10-07 07:36+0000\n" +"Last-Translator: Fekete Mihai <feketemihai@nexterp.ro>\n" "Language-Team: none\n" "Language: ro\n" "MIME-Version: 1.0\n" @@ -14,22 +15,23 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " "20)) ? 1 : 2;\n" +"X-Generator: Weblate 4.3.2\n" #. module: l10n_ro_stock_account_date #: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_picking__accounting_date #: model_terms:ir.ui.view,arch_db:l10n_ro_stock_account_date.view_picking_internal_search msgid "Accounting Date" -msgstr "" +msgstr "Data Contabila" #. module: l10n_ro_stock_account_date #: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__create_uid msgid "Created by" -msgstr "" +msgstr "Creeat de" #. module: l10n_ro_stock_account_date #: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__create_date msgid "Created on" -msgstr "" +msgstr "Creat la" #. module: l10n_ro_stock_account_date #: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__date_done From b0fe5b6a434314fc6216ba2eff8ee4445201bb94 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Wed, 12 Oct 2022 13:49:43 +0300 Subject: [PATCH 13/68] Isolate l10n_ro_stock_account --- l10n_ro_stock_account_date/tests/test_stock_accounting_date.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py index b0a736e27..a78624646 100644 --- a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py +++ b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py @@ -99,7 +99,7 @@ def test_transfer(self): acc_date = fields.Date.today() - timedelta(days=1) location_id = self.picking_type_transfer.default_location_src_id location_dest_id = self.picking_type_transfer.default_location_dest_id.copy( - {"property_stock_valuation_account_id": self.account_valuation.id} + {"l10n_ro_property_stock_valuation_account_id": self.account_valuation.id} ) _logger.info("Start transfer") picking = self.trasfer(location_id, location_dest_id, accounting_date=acc_date) From ada44dd54cae6a1a33f6aed668e60d182f06701e Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Sat, 15 Oct 2022 08:48:37 +0300 Subject: [PATCH 14/68] 15.0 Isolate l10n_ro_stock_account_date and wizard --- l10n_ro_stock_account_date/__manifest__.py | 1 + .../models/stock_move.py | 115 +++++++++--------- .../models/stock_move_line.py | 9 +- .../models/stock_picking.py | 14 ++- .../models/stock_valuation_layer.py | 40 +++--- .../tests/test_stock_accounting_date.py | 6 +- .../views/stock_picking_views.xml | 24 +++- .../views/stock_valuation_layer_views.xml | 6 +- 8 files changed, 120 insertions(+), 95 deletions(-) diff --git a/l10n_ro_stock_account_date/__manifest__.py b/l10n_ro_stock_account_date/__manifest__.py index ab3a6c84e..9b6f1b886 100644 --- a/l10n_ro_stock_account_date/__manifest__.py +++ b/l10n_ro_stock_account_date/__manifest__.py @@ -14,5 +14,6 @@ "views/stock_valuation_layer_views.xml", ], "installable": True, + "development_status": "Mature", "maintainers": ["feketemihai"], } diff --git a/l10n_ro_stock_account_date/models/stock_move.py b/l10n_ro_stock_account_date/models/stock_move.py index 21b78d058..e7dd6f308 100644 --- a/l10n_ro_stock_account_date/models/stock_move.py +++ b/l10n_ro_stock_account_date/models/stock_move.py @@ -5,86 +5,83 @@ class StockMove(models.Model): - _inherit = "stock.move" + _name = "stock.move" + _inherit = ["stock.move", "l10n.ro.mixin"] - def get_move_date(self): + def l10n_ro_get_move_date(self): self.ensure_one() - new_date = False - if self.picking_id: - if self.picking_id.accounting_date: - new_date = self.picking_id.accounting_date - elif self.is_inventory and self.date: - new_date = self.date - elif "raw_material_production_id" in self._fields: - if self.raw_material_production_id: - new_date = self.raw_material_production_id.date_planned_start - elif self.production_id: - new_date = self.production_id.date_planned_start + new_date = self._context.get("force_period_date") if not new_date: - new_date = fields.datetime.now() + if self.picking_id: + if self.picking_id.l10n_ro_accounting_date: + new_date = self.picking_id.l10n_ro_accounting_date + elif self.inventory_id: + new_date = self.inventory_id.accounting_date + elif "raw_material_production_id" in self._fields: + if self.raw_material_production_id: + new_date = self.raw_material_production_id.date_planned_start + elif self.production_id: + new_date = self.production_id.date_planned_start + if not new_date: + new_date = fields.datetime.now() return new_date def _action_done(self, cancel_backorder=False): - move_dates = {} - for move in self.filtered(lambda m: m.is_inventory and m.date): - move_dates[move.id] = move.date moves_todo = super()._action_done(cancel_backorder=cancel_backorder) - for move in moves_todo: - if not move.is_inventory: - move.date = move.get_move_date() - if move_dates.get(move.id): - move.date = move_dates[move.id] - move.stock_valuation_layer_ids.sudo().write({"create_date": move.date}) - move.account_move_ids.sudo().write({"date": move.date}) + for move in moves_todo.filtered("is_l10n_ro_record"): + move.date = move.l10n_ro_get_move_date() return moves_todo def _trigger_assign(self): res = super()._trigger_assign() - for move in self: - if not move.is_inventory: - move.date = move.get_move_date() + for move in self.filtered("is_l10n_ro_record"): + move.date = move.l10n_ro_get_move_date() return res def _get_price_unit(self): # Update price unit for purchases in different currencies with the # reception date. - if self.picking_id.date and self.purchase_line_id: - po_line = self.purchase_line_id - order = po_line.order_id - price_unit = po_line.price_unit - if po_line.taxes_id: - price_unit = po_line.taxes_id.with_context(round=False).compute_all( - price_unit, - currency=order.currency_id, - quantity=1.0, - product=po_line.product_id, - partner=order.partner_id, - )["total_excluded"] - if po_line.product_uom.id != po_line.product_id.uom_id.id: - price_unit *= ( - po_line.product_uom.factor / po_line.product_id.uom_id.factor + if self.is_l10n_ro_record: + if self.picking_id.date and self.purchase_line_id: + po_line = self.purchase_line_id + order = po_line.order_id + price_unit = po_line.price_unit + if po_line.taxes_id: + price_unit = po_line.taxes_id.with_context(round=False).compute_all( + price_unit, + currency=order.currency_id, + quantity=1.0, + product=po_line.product_id, + partner=order.partner_id, + )["total_excluded"] + if po_line.product_uom.id != po_line.product_id.uom_id.id: + price_unit *= ( + po_line.product_uom.factor / po_line.product_id.uom_id.factor + ) + if order.currency_id != order.company_id.currency_id: + price_unit = order.currency_id._convert( + price_unit, + order.company_id.currency_id, + self.company_id, + self.picking_id.l10n_ro_accounting_date + or fields.datetime.now(), + round=False, + ) + self.write( + { + "price_unit": price_unit, + "date": self.picking_id.l10n_ro_accounting_date + or fields.datetime.now(), + } ) - if order.currency_id != order.company_id.currency_id: - price_unit = order.currency_id._convert( - price_unit, - order.company_id.currency_id, - self.company_id, - self.picking_id.accounting_date or fields.datetime.now(), - round=False, - ) - self.write( - { - "price_unit": price_unit, - "date": self.picking_id.accounting_date or fields.datetime.now(), - } - ) - return price_unit + return price_unit return super()._get_price_unit() def _account_entry_move(self, qty, description, svl_id, cost): self.ensure_one() - val_date = self.get_move_date() or self.date - self = self.with_context(force_period_date=val_date) + if self.is_l10n_ro_record: + val_date = self.l10n_ro_get_move_date() + self = self.with_context(force_period_date=val_date) return super(StockMove, self)._account_entry_move( qty, description, svl_id, cost ) diff --git a/l10n_ro_stock_account_date/models/stock_move_line.py b/l10n_ro_stock_account_date/models/stock_move_line.py index b2e7c5f52..456859182 100644 --- a/l10n_ro_stock_account_date/models/stock_move_line.py +++ b/l10n_ro_stock_account_date/models/stock_move_line.py @@ -5,10 +5,13 @@ class StockMoveLine(models.Model): - _inherit = "stock.move.line" + _name = "stock.move.line" + _inherit = ["stock.move.line", "l10n.ro.mixin"] def _action_done(self): res = super()._action_done() - for move_line in self.exists(): - move_line.date = move_line.move_id.get_move_date() + ro_recs = self.exists().filtered("is_l10n_ro_record") + for move_line in ro_recs: + if move_line.move_id: + move_line.date = move_line.move_id.l10n_ro_get_move_date() return res diff --git a/l10n_ro_stock_account_date/models/stock_picking.py b/l10n_ro_stock_account_date/models/stock_picking.py index 44f32efaf..4567f1824 100644 --- a/l10n_ro_stock_account_date/models/stock_picking.py +++ b/l10n_ro_stock_account_date/models/stock_picking.py @@ -6,9 +6,11 @@ class StockPicking(models.Model): - _inherit = "stock.picking" + _name = "stock.picking" + _inherit = ["stock.picking", "l10n.ro.mixin"] - accounting_date = fields.Datetime( + l10n_ro_accounting_date = fields.Datetime( + "Accounting Date", copy=False, help="If this field is set, the svl and accounting entiries will " "have this date, If not will have the today date as it should be", @@ -18,9 +20,9 @@ class StockPicking(models.Model): def _action_done(self): """Update date_done from accounting_date field""" res = super()._action_done() - for picking in self: - if picking.accounting_date: - if picking.accounting_date.date() > fields.date.today(): + for picking in self.filtered("is_l10n_ro_record"): + if picking.l10n_ro_accounting_date: + if picking.l10n_ro_accounting_date.date() > fields.date.today(): raise ValidationError( _( "You can not have a Accounting date=%s for picking " @@ -30,7 +32,7 @@ def _action_done(self): ) picking.write( { - "date_done": picking.accounting_date, + "date_done": picking.l10n_ro_accounting_date, } ) return res diff --git a/l10n_ro_stock_account_date/models/stock_valuation_layer.py b/l10n_ro_stock_account_date/models/stock_valuation_layer.py index 6df9e152c..6457d9696 100644 --- a/l10n_ro_stock_account_date/models/stock_valuation_layer.py +++ b/l10n_ro_stock_account_date/models/stock_valuation_layer.py @@ -14,7 +14,7 @@ class StockValuationLayer(models.Model): write_uid = fields.Many2one( "res.users", "Last Updated by", index=True, readonly=True ) - date_done = fields.Datetime( + l10n_ro_date_done = fields.Datetime( readonly=True, help="This is the date when this recod was created. Original create_date is writen" " at reception by module nexterp_stock_date", @@ -23,24 +23,28 @@ class StockValuationLayer(models.Model): @api.model_create_multi def create(self, vals_list): for values in vals_list: - val_date = fields.datetime.now() - if values.get("stock_move_id"): - move = self.env["stock.move"].browse(values["stock_move_id"]) - val_date = move.get_move_date() - values.update( - { - "create_uid": self._uid, - "create_date": val_date, - "write_uid": self._uid, - "write_date": val_date, - "date_done": fields.datetime.now(), - } - ) + if self.env["res.company"]._check_is_l10n_ro_record( + values.get("company_id") + ): + val_date = fields.datetime.now() + if values.get("stock_move_id"): + move = self.env["stock.move"].browse(values["stock_move_id"]) + val_date = move.l10n_ro_get_move_date() + values.update( + { + "create_uid": self._uid, + "create_date": val_date, + "write_uid": self._uid, + "write_date": val_date, + "l10n_ro_date_done": fields.datetime.now(), + } + ) return super().create(vals_list) def write(self, vals): - if not vals.get("write_uid"): - vals["write_uid"] = self._uid - if not vals.get("write_date"): - vals["write_date"] = fields.datetime.now() + if self.filtered("is_l10n_ro_record"): + if not vals.get("write_uid"): + vals["write_uid"] = self._uid + if not vals.get("write_date"): + vals["write_date"] = fields.datetime.now() return super().write(vals) diff --git a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py index a78624646..3c8acbce2 100644 --- a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py +++ b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py @@ -53,7 +53,7 @@ def trasfer(self, location, location_dest, product=None, accounting_date=False): } ) if accounting_date: - picking.accounting_date = accounting_date + picking.l10n_ro_accounting_date = accounting_date picking.action_confirm() picking.action_assign() for move_line in picking.move_lines: @@ -102,10 +102,10 @@ def test_transfer(self): {"l10n_ro_property_stock_valuation_account_id": self.account_valuation.id} ) _logger.info("Start transfer") - picking = self.trasfer(location_id, location_dest_id, accounting_date=acc_date) + picking = self.transfer(location_id, location_dest_id, accounting_date=acc_date) stock_move = picking.move_lines _logger.info("Tranfer efectuat") - self.assertEqual(picking.accounting_date.date(), acc_date) + self.assertEqual(picking.l10n_ro_accounting_date.date(), acc_date) self.assertEqual(stock_move.date.date(), acc_date) self.assertEqual(stock_move.move_line_ids.date.date(), acc_date) self.assertEqual( diff --git a/l10n_ro_stock_account_date/views/stock_picking_views.xml b/l10n_ro_stock_account_date/views/stock_picking_views.xml index a9d4d3b49..f084aa108 100644 --- a/l10n_ro_stock_account_date/views/stock_picking_views.xml +++ b/l10n_ro_stock_account_date/views/stock_picking_views.xml @@ -5,7 +5,12 @@ <field name="inherit_id" ref="stock.vpicktree" /> <field name="arch" type="xml"> <field name="scheduled_date" position="before"> - <field name="accounting_date" readonly="1" /> + <field name="is_l10n_ro_record" invisible="1" /> + <field + name="l10n_ro_accounting_date" + readonly="1" + attrs="{'invisible': [('is_l10n_ro_record', '=', False)]}" + /> </field> </field> </record> @@ -16,10 +21,17 @@ <field name="inherit_id" ref="stock.view_picking_form" /> <field name="arch" type="xml"> <xpath expr="//label[@for='scheduled_date']" position="before"> - <label for="accounting_date" /> - <div class="o_row"> + <field name="is_l10n_ro_record" invisible="1" /> + <label + for="l10n_ro_accounting_date" + attrs="{'invisible': [('is_l10n_ro_record', '=', False)]}" + /> + <div + class="o_row" + attrs="{'invisible': [('is_l10n_ro_record', '=', False)]}" + > <field - name="accounting_date" + name="l10n_ro_accounting_date" attrs="{'readonly': [('state', '=', 'done')]}" /> </div> @@ -33,11 +45,13 @@ <field name="inherit_id" ref="stock.view_picking_internal_search" /> <field name="arch" type="xml"> <filter name="expected_date" position="before"> + <field name="is_l10n_ro_record" invisible="1" /> <filter string="Accounting Date" name="accounting_date" domain="[]" - context="{'group_by': 'accounting_date'}" + context="{'group_by': 'l10n_ro_accounting_date'}" + attrs="{'invisible': [('is_l10n_ro_record', '=', False)]}" /> </filter> diff --git a/l10n_ro_stock_account_date/views/stock_valuation_layer_views.xml b/l10n_ro_stock_account_date/views/stock_valuation_layer_views.xml index fa77977a8..db2ef0cd5 100644 --- a/l10n_ro_stock_account_date/views/stock_valuation_layer_views.xml +++ b/l10n_ro_stock_account_date/views/stock_valuation_layer_views.xml @@ -5,7 +5,11 @@ <field name="priority">290</field> <field name="arch" type="xml"> <field name="create_date" position="after"> - <field name="date_done" /> + <field name="is_l10n_ro_record" invisible="1" /> + <field + name="l10n_ro_date_done" + attrs="{'invisible': [('is_l10n_ro_record', '=', False)]}" + /> </field> </field> </record> From 7118a05792abd22f373745ad8fac03294543c4d6 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Sat, 15 Oct 2022 09:13:55 +0300 Subject: [PATCH 15/68] 15.0 Isolate l10n_ro_stock_account_date and wizard --- l10n_ro_stock_account_date/models/stock_move.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_ro_stock_account_date/models/stock_move.py b/l10n_ro_stock_account_date/models/stock_move.py index e7dd6f308..27c460b95 100644 --- a/l10n_ro_stock_account_date/models/stock_move.py +++ b/l10n_ro_stock_account_date/models/stock_move.py @@ -15,8 +15,8 @@ def l10n_ro_get_move_date(self): if self.picking_id: if self.picking_id.l10n_ro_accounting_date: new_date = self.picking_id.l10n_ro_accounting_date - elif self.inventory_id: - new_date = self.inventory_id.accounting_date + elif self.is_inventory: + new_date = self.date elif "raw_material_production_id" in self._fields: if self.raw_material_production_id: new_date = self.raw_material_production_id.date_planned_start From 3ec8786877c322902c3a752c3374bd06ff0075fe Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Sat, 29 Oct 2022 14:58:17 +0000 Subject: [PATCH 16/68] l10n_ro_stock_account_date 15.0.1.0.0 --- l10n_ro_stock_account_date/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/__manifest__.py b/l10n_ro_stock_account_date/__manifest__.py index 9b6f1b886..c24c5c6d2 100644 --- a/l10n_ro_stock_account_date/__manifest__.py +++ b/l10n_ro_stock_account_date/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date", - "version": "15.0.0.3.0", + "version": "15.0.1.0.0", "category": "Localization", "summary": "Romania - Stock Accounting Date", "author": "NextERP Romania," "Odoo Community Association (OCA)", From a47d6fe08b76bdc17fa91988ecfbf50b9ff04153 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Sat, 29 Oct 2022 19:15:35 +0300 Subject: [PATCH 17/68] Update stock account date izolation --- l10n_ro_stock_account_date/models/stock_picking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/models/stock_picking.py b/l10n_ro_stock_account_date/models/stock_picking.py index 4567f1824..c67ca298b 100644 --- a/l10n_ro_stock_account_date/models/stock_picking.py +++ b/l10n_ro_stock_account_date/models/stock_picking.py @@ -28,7 +28,7 @@ def _action_done(self): "You can not have a Accounting date=%s for picking " "bigger than today!" ) - % picking.accounting_date.date() + % picking.l10n_ro_accounting_date.date() ) picking.write( { From e62a15f00f8199d295ebe95c993836dccbe8de82 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Sat, 29 Oct 2022 19:30:59 +0300 Subject: [PATCH 18/68] Update stock account date izolation --- l10n_ro_stock_account_date/tests/test_stock_accounting_date.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py index 3c8acbce2..f8b586d89 100644 --- a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py +++ b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py @@ -25,7 +25,7 @@ def set_stock(self, product, qty): ) inventory._apply_inventory() - def trasfer(self, location, location_dest, product=None, accounting_date=False): + def transfer(self, location, location_dest, product=None, accounting_date=False): self.PickingObj = self.env["stock.picking"] self.MoveObj = self.env["stock.move"] From 06cee8162e805f693d9792aedb1a7a6cce6b9b31 Mon Sep 17 00:00:00 2001 From: oca-ci <oca-ci@odoo-community.org> Date: Sat, 29 Oct 2022 17:14:03 +0000 Subject: [PATCH 19/68] [UPD] Update l10n_ro_stock_account_date.pot --- .../i18n/l10n_ro_stock_account_date.pot | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot b/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot index b83f03719..e892521f4 100644 --- a/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot +++ b/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot @@ -14,7 +14,7 @@ msgstr "" "Plural-Forms: \n" #. module: l10n_ro_stock_account_date -#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_picking__accounting_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_picking__l10n_ro_accounting_date #: model_terms:ir.ui.view,arch_db:l10n_ro_stock_account_date.view_picking_internal_search msgid "Accounting Date" msgstr "" @@ -30,17 +30,24 @@ msgid "Created on" msgstr "" #. module: l10n_ro_stock_account_date -#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__date_done -msgid "Date Done" -msgstr "" - -#. module: l10n_ro_stock_account_date -#: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_picking__accounting_date +#: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_picking__l10n_ro_accounting_date msgid "" "If this field is set, the svl and accounting entiries will have this date, " "If not will have the today date as it should be" msgstr "" +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_move__is_l10n_ro_record +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_move_line__is_l10n_ro_record +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_picking__is_l10n_ro_record +msgid "Is Romanian Record" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__l10n_ro_date_done +msgid "L10N Ro Date Done" +msgstr "" + #. module: l10n_ro_stock_account_date #: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__write_uid msgid "Last Updated by" @@ -72,7 +79,7 @@ msgid "Stock Valuation Layer" msgstr "" #. module: l10n_ro_stock_account_date -#: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_valuation_layer__date_done +#: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_valuation_layer__l10n_ro_date_done msgid "" "This is the date when this recod was created. Original create_date is writen" " at reception by module nexterp_stock_date" From 076b2afbf47aa91390ef135ad3e5f3e6a510bce9 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Sat, 29 Oct 2022 17:25:52 +0000 Subject: [PATCH 20/68] [UPD] README.rst --- l10n_ro_stock_account_date/README.rst | 4 ++-- l10n_ro_stock_account_date/static/description/index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_ro_stock_account_date/README.rst b/l10n_ro_stock_account_date/README.rst index d7da34ef8..5915b5d2f 100644 --- a/l10n_ro_stock_account_date/README.rst +++ b/l10n_ro_stock_account_date/README.rst @@ -7,9 +7,9 @@ Romania - Stock Accounting Date !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png +.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png :target: https://odoo-community.org/page/development-status - :alt: Beta + :alt: Mature .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 diff --git a/l10n_ro_stock_account_date/static/description/index.html b/l10n_ro_stock_account_date/static/description/index.html index 7f96f2c71..8cf6b339c 100644 --- a/l10n_ro_stock_account_date/static/description/index.html +++ b/l10n_ro_stock_account_date/static/description/index.html @@ -367,7 +367,7 @@ <h1 class="title">Romania - Stock Accounting Date</h1> !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> +<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>This module allows you to select “Accounting Date” for stock operations.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> From 9bdbdbb183bfab042646c3a16c56fcddbd6bad4f Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Sat, 29 Oct 2022 17:25:52 +0000 Subject: [PATCH 21/68] l10n_ro_stock_account_date 15.0.2.0.0 --- l10n_ro_stock_account_date/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/__manifest__.py b/l10n_ro_stock_account_date/__manifest__.py index c24c5c6d2..69ea16386 100644 --- a/l10n_ro_stock_account_date/__manifest__.py +++ b/l10n_ro_stock_account_date/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date", - "version": "15.0.1.0.0", + "version": "15.0.2.0.0", "category": "Localization", "summary": "Romania - Stock Accounting Date", "author": "NextERP Romania," "Odoo Community Association (OCA)", From e5ec5bdb8a87340958b6b13228bc0919d4029725 Mon Sep 17 00:00:00 2001 From: Weblate <noreply@weblate.org> Date: Sat, 29 Oct 2022 17:25:59 +0000 Subject: [PATCH 22/68] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-romania-15.0/l10n-romania-15.0-l10n_ro_stock_account_date Translate-URL: https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date/ --- l10n_ro_stock_account_date/i18n/ro.po | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/l10n_ro_stock_account_date/i18n/ro.po b/l10n_ro_stock_account_date/i18n/ro.po index f173cb106..0a0884046 100644 --- a/l10n_ro_stock_account_date/i18n/ro.po +++ b/l10n_ro_stock_account_date/i18n/ro.po @@ -18,7 +18,7 @@ msgstr "" "X-Generator: Weblate 4.3.2\n" #. module: l10n_ro_stock_account_date -#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_picking__accounting_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_picking__l10n_ro_accounting_date #: model_terms:ir.ui.view,arch_db:l10n_ro_stock_account_date.view_picking_internal_search msgid "Accounting Date" msgstr "Data Contabila" @@ -34,17 +34,24 @@ msgid "Created on" msgstr "Creat la" #. module: l10n_ro_stock_account_date -#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__date_done -msgid "Date Done" -msgstr "" - -#. module: l10n_ro_stock_account_date -#: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_picking__accounting_date +#: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_picking__l10n_ro_accounting_date msgid "" "If this field is set, the svl and accounting entiries will have this date, " "If not will have the today date as it should be" msgstr "" +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_move__is_l10n_ro_record +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_move_line__is_l10n_ro_record +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_picking__is_l10n_ro_record +msgid "Is Romanian Record" +msgstr "" + +#. module: l10n_ro_stock_account_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__l10n_ro_date_done +msgid "L10N Ro Date Done" +msgstr "" + #. module: l10n_ro_stock_account_date #: model:ir.model.fields,field_description:l10n_ro_stock_account_date.field_stock_valuation_layer__write_uid msgid "Last Updated by" @@ -76,10 +83,10 @@ msgid "Stock Valuation Layer" msgstr "" #. module: l10n_ro_stock_account_date -#: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_valuation_layer__date_done +#: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_valuation_layer__l10n_ro_date_done msgid "" -"This is the date when this recod was created. Original create_date is writen" -" at reception by module nexterp_stock_date" +"This is the date when this recod was created. Original create_date is writen " +"at reception by module nexterp_stock_date" msgstr "" #. module: l10n_ro_stock_account_date From 5af08fe36f78ae66d5535d73da29e44a270f8cbf Mon Sep 17 00:00:00 2001 From: Cojocaru Marcel <marcel.cojocaru@gmail.com> Date: Thu, 29 Dec 2022 18:28:01 +0200 Subject: [PATCH 23/68] [15.0][FIX] fix sa seteze create_date pt svls non ro --- .../models/stock_valuation_layer.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/l10n_ro_stock_account_date/models/stock_valuation_layer.py b/l10n_ro_stock_account_date/models/stock_valuation_layer.py index 6457d9696..27c912503 100644 --- a/l10n_ro_stock_account_date/models/stock_valuation_layer.py +++ b/l10n_ro_stock_account_date/models/stock_valuation_layer.py @@ -23,18 +23,24 @@ class StockValuationLayer(models.Model): @api.model_create_multi def create(self, vals_list): for values in vals_list: + val_date = fields.datetime.now() + values.update( + { + "create_uid": self._uid, + "create_date": val_date, + "write_uid": self._uid, + "write_date": val_date, + } + ) if self.env["res.company"]._check_is_l10n_ro_record( values.get("company_id") ): - val_date = fields.datetime.now() if values.get("stock_move_id"): move = self.env["stock.move"].browse(values["stock_move_id"]) val_date = move.l10n_ro_get_move_date() values.update( { - "create_uid": self._uid, "create_date": val_date, - "write_uid": self._uid, "write_date": val_date, "l10n_ro_date_done": fields.datetime.now(), } From 276a3cfc6b5f8bd13204961cab44b5d33ac65ea4 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Fri, 30 Dec 2022 10:09:26 +0000 Subject: [PATCH 24/68] l10n_ro_stock_account_date 15.0.2.1.0 --- l10n_ro_stock_account_date/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/__manifest__.py b/l10n_ro_stock_account_date/__manifest__.py index 69ea16386..42757d805 100644 --- a/l10n_ro_stock_account_date/__manifest__.py +++ b/l10n_ro_stock_account_date/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date", - "version": "15.0.2.0.0", + "version": "15.0.2.1.0", "category": "Localization", "summary": "Romania - Stock Accounting Date", "author": "NextERP Romania," "Odoo Community Association (OCA)", From dd729b061ff7deba0786ad7669c28cef3ee4e0a3 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Mon, 27 Mar 2023 12:22:53 +0300 Subject: [PATCH 25/68] Move code from 14 --- .../models/stock_move.py | 10 +++ .../tests/test_stock_accounting_date.py | 87 ++++--------------- 2 files changed, 28 insertions(+), 69 deletions(-) diff --git a/l10n_ro_stock_account_date/models/stock_move.py b/l10n_ro_stock_account_date/models/stock_move.py index 27c460b95..59473e17a 100644 --- a/l10n_ro_stock_account_date/models/stock_move.py +++ b/l10n_ro_stock_account_date/models/stock_move.py @@ -42,10 +42,20 @@ def _get_price_unit(self): # Update price unit for purchases in different currencies with the # reception date. if self.is_l10n_ro_record: + if ( + self.origin_returned_move_id + and self.origin_returned_move_id.sudo().stock_valuation_layer_ids + ): + # in acest caz trebuie sa se execute din l10n_ro_stock_account + return super()._get_price_unit() + if self.picking_id.date and self.purchase_line_id: po_line = self.purchase_line_id order = po_line.order_id price_unit = po_line.price_unit + if po_line.product_qty != 0.0: + price_unit = po_line.price_subtotal / po_line.product_qty + if po_line.taxes_id: price_unit = po_line.taxes_id.with_context(round=False).compute_all( price_unit, diff --git a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py index f8b586d89..a794a87a1 100644 --- a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py +++ b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py @@ -13,85 +13,33 @@ @tagged("post_install", "-at_install") -class TestStockReport(TestStockCommon): - def set_stock(self, product, qty): - inventory_obj = self.env["stock.quant"].with_context(inventory_mode=True) - inventory = inventory_obj.create( - { - "location_id": self.location_warehouse.id, - "product_id": product.id, - "inventory_quantity": qty, - } - ) - inventory._apply_inventory() - - def transfer(self, location, location_dest, product=None, accounting_date=False): - - self.PickingObj = self.env["stock.picking"] - self.MoveObj = self.env["stock.move"] - self.MoveObj = self.env["stock.move"] - - if not product: - product = self.product_mp - - picking = self.PickingObj.create( - { - "picking_type_id": self.picking_type_transfer.id, - "location_id": location.id, - "location_dest_id": location_dest.id, - } - ) - self.MoveObj.create( - { - "name": product.name, - "product_id": product.id, - "product_uom_qty": 2, - "product_uom": product.uom_id.id, - "picking_id": picking.id, - "location_id": location.id, - "location_dest_id": location_dest.id, - } - ) - if accounting_date: - picking.l10n_ro_accounting_date = accounting_date - picking.action_confirm() - picking.action_assign() - for move_line in picking.move_lines: - if move_line.product_uom_qty > 0 and move_line.quantity_done == 0: - move_line.write({"quantity_done": move_line.product_uom_qty}) - picking._action_done() - return picking +class TestStockAccountDate(TestStockCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() def test_inventory(self): - self.make_puchase() + self.make_purchase() acc_date = fields.Date.today() - timedelta(days=1) - inventory_obj = self.env["stock.quant"].with_context(inventory_mode=True) - inventory = inventory_obj.create( + inventory = self.env["stock.inventory"].create( { - "location_id": self.location_warehouse.id, - "product_id": self.product_1.id, - "inventory_quantity": self.qty_po_p1 + 10, + "location_ids": [(4, self.location_warehouse.id)], + "product_ids": [(4, self.product_1.id)], + "accounting_date": acc_date, } ) - inventory.accounting_date = acc_date - inventory._apply_inventory() - stock_move = self.env["stock.move"].search( - [ - ( - "location_id", - "=", - inventory.product_id.with_company( - inventory.company_id - ).property_stock_inventory.id, - ) - ] - ) - + inventory.action_start() + inventory.line_ids.product_qty = self.qty_po_p1 + 20 + _logger.info("start inventory") + inventory.action_validate() + stock_move = inventory.move_ids + self.assertEqual(inventory.accounting_date, acc_date) self.assertEqual(stock_move.date.date(), acc_date) self.assertEqual(stock_move.move_line_ids.date.date(), acc_date) self.assertEqual( stock_move.stock_valuation_layer_ids.create_date.date(), acc_date ) + self.assertTrue(stock_move.account_move_ids) self.assertEqual(stock_move.account_move_ids.date, acc_date) def test_transfer(self): @@ -102,7 +50,8 @@ def test_transfer(self): {"l10n_ro_property_stock_valuation_account_id": self.account_valuation.id} ) _logger.info("Start transfer") - picking = self.transfer(location_id, location_dest_id, accounting_date=acc_date) + self.transfer(location_id, location_dest_id, accounting_date=acc_date) + picking = self.picking stock_move = picking.move_lines _logger.info("Tranfer efectuat") self.assertEqual(picking.l10n_ro_accounting_date.date(), acc_date) From 8d8e277a149b013a22455926defaa452622fbb07 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Tue, 28 Mar 2023 16:58:50 +0300 Subject: [PATCH 26/68] Adapt code from 14 --- .../tests/test_stock_accounting_date.py | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py index a794a87a1..47259772f 100644 --- a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py +++ b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py @@ -21,19 +21,27 @@ def setUpClass(cls): def test_inventory(self): self.make_purchase() acc_date = fields.Date.today() - timedelta(days=1) - inventory = self.env["stock.inventory"].create( + inventory_obj = self.env["stock.quant"].with_context(inventory_mode=True) + inventory = inventory_obj.create( { - "location_ids": [(4, self.location_warehouse.id)], - "product_ids": [(4, self.product_1.id)], - "accounting_date": acc_date, + "location_id": self.location_warehouse.id, + "product_id": self.product_1.id, + "inventory_quantity": self.qty_po_p1 + 10, } ) - inventory.action_start() - inventory.line_ids.product_qty = self.qty_po_p1 + 20 - _logger.info("start inventory") - inventory.action_validate() - stock_move = inventory.move_ids - self.assertEqual(inventory.accounting_date, acc_date) + inventory.accounting_date = acc_date + inventory._apply_inventory() + stock_move = self.env["stock.move"].search( + [ + ( + "location_id", + "=", + inventory.product_id.with_company( + inventory.company_id + ).property_stock_inventory.id, + ) + ] + ) self.assertEqual(stock_move.date.date(), acc_date) self.assertEqual(stock_move.move_line_ids.date.date(), acc_date) self.assertEqual( From 8a78d3efaa5e674b12f5c25d831582271cf60c95 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Thu, 6 Apr 2023 08:48:56 +0300 Subject: [PATCH 27/68] Increase versions --- l10n_ro_stock_account_date/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/__manifest__.py b/l10n_ro_stock_account_date/__manifest__.py index 42757d805..55c0954be 100644 --- a/l10n_ro_stock_account_date/__manifest__.py +++ b/l10n_ro_stock_account_date/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date", - "version": "15.0.2.1.0", + "version": "15.0.2.1.1", "category": "Localization", "summary": "Romania - Stock Accounting Date", "author": "NextERP Romania," "Odoo Community Association (OCA)", From 67baf39e5f89f63259a60bd3f908ad2e958aebc7 Mon Sep 17 00:00:00 2001 From: Dorin Hongu <dhongu@gmail.com> Date: Thu, 20 Apr 2023 11:32:56 +0300 Subject: [PATCH 28/68] fix apel sudo --- l10n_ro_stock_account_date/models/stock_valuation_layer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/models/stock_valuation_layer.py b/l10n_ro_stock_account_date/models/stock_valuation_layer.py index 27c912503..1c8b63df1 100644 --- a/l10n_ro_stock_account_date/models/stock_valuation_layer.py +++ b/l10n_ro_stock_account_date/models/stock_valuation_layer.py @@ -16,7 +16,7 @@ class StockValuationLayer(models.Model): ) l10n_ro_date_done = fields.Datetime( readonly=True, - help="This is the date when this recod was created. Original create_date is writen" + help="This is the date when this record was created. Original create_date is writen" " at reception by module nexterp_stock_date", ) From d06b6ecc96e19af98d69f8965677b9520bcf845d Mon Sep 17 00:00:00 2001 From: oca-ci <oca-ci@odoo-community.org> Date: Mon, 24 Apr 2023 08:45:34 +0000 Subject: [PATCH 29/68] [UPD] Update l10n_ro_stock_account_date.pot --- .../i18n/l10n_ro_stock_account_date.pot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot b/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot index e892521f4..adc14dbd5 100644 --- a/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot +++ b/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot @@ -81,8 +81,8 @@ msgstr "" #. module: l10n_ro_stock_account_date #: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_valuation_layer__l10n_ro_date_done msgid "" -"This is the date when this recod was created. Original create_date is writen" -" at reception by module nexterp_stock_date" +"This is the date when this record was created. Original create_date is " +"writen at reception by module nexterp_stock_date" msgstr "" #. module: l10n_ro_stock_account_date From e992fe80e40e162f51acb61a970366f8309beae5 Mon Sep 17 00:00:00 2001 From: Weblate <noreply@weblate.org> Date: Mon, 24 Apr 2023 09:42:11 +0000 Subject: [PATCH 30/68] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-romania-15.0/l10n-romania-15.0-l10n_ro_stock_account_date Translate-URL: https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date/ --- l10n_ro_stock_account_date/i18n/ro.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_ro_stock_account_date/i18n/ro.po b/l10n_ro_stock_account_date/i18n/ro.po index 0a0884046..1b2d4cdeb 100644 --- a/l10n_ro_stock_account_date/i18n/ro.po +++ b/l10n_ro_stock_account_date/i18n/ro.po @@ -85,8 +85,8 @@ msgstr "" #. module: l10n_ro_stock_account_date #: model:ir.model.fields,help:l10n_ro_stock_account_date.field_stock_valuation_layer__l10n_ro_date_done msgid "" -"This is the date when this recod was created. Original create_date is writen " -"at reception by module nexterp_stock_date" +"This is the date when this record was created. Original create_date is " +"writen at reception by module nexterp_stock_date" msgstr "" #. module: l10n_ro_stock_account_date From df1eaf5ece5901f980c9f743a59967a71d958b6a Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Thu, 11 May 2023 08:53:02 +0300 Subject: [PATCH 31/68] [IMP] l10n_ro_stock_account_date: pre-commit stuff --- .../odoo/addons/l10n_ro_stock_account_date | 1 + setup/l10n_ro_stock_account_date/setup.py | 6 ++++++ 2 files changed, 7 insertions(+) create mode 120000 setup/l10n_ro_stock_account_date/odoo/addons/l10n_ro_stock_account_date create mode 100644 setup/l10n_ro_stock_account_date/setup.py diff --git a/setup/l10n_ro_stock_account_date/odoo/addons/l10n_ro_stock_account_date b/setup/l10n_ro_stock_account_date/odoo/addons/l10n_ro_stock_account_date new file mode 120000 index 000000000..f3e1e38aa --- /dev/null +++ b/setup/l10n_ro_stock_account_date/odoo/addons/l10n_ro_stock_account_date @@ -0,0 +1 @@ +../../../../l10n_ro_stock_account_date \ No newline at end of file diff --git a/setup/l10n_ro_stock_account_date/setup.py b/setup/l10n_ro_stock_account_date/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/l10n_ro_stock_account_date/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From d09a72c16837e28ec65febe3cbed747f04656ac0 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Thu, 11 May 2023 08:59:27 +0300 Subject: [PATCH 32/68] [MIG] l10n_ro_stock_account_date: Migration to 16.0 --- l10n_ro_stock_account_date/__manifest__.py | 2 +- l10n_ro_stock_account_date/readme/INSTALL.rst | 2 +- l10n_ro_stock_account_date/tests/test_stock_accounting_date.py | 2 +- test-requirements.txt | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 test-requirements.txt diff --git a/l10n_ro_stock_account_date/__manifest__.py b/l10n_ro_stock_account_date/__manifest__.py index 55c0954be..cc8ff7a6d 100644 --- a/l10n_ro_stock_account_date/__manifest__.py +++ b/l10n_ro_stock_account_date/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date", - "version": "15.0.2.1.1", + "version": "16.0.1.0.0", "category": "Localization", "summary": "Romania - Stock Accounting Date", "author": "NextERP Romania," "Odoo Community Association (OCA)", diff --git a/l10n_ro_stock_account_date/readme/INSTALL.rst b/l10n_ro_stock_account_date/readme/INSTALL.rst index 35a8e323f..f19c9d61b 100644 --- a/l10n_ro_stock_account_date/readme/INSTALL.rst +++ b/l10n_ro_stock_account_date/readme/INSTALL.rst @@ -1,6 +1,6 @@ To install this module, you need to: -* clone the branch 14.0 of the repository https://github.com/OCA/l10n-romania +* clone the branch 16.0 of the repository https://github.com/OCA/l10n-romania * add the path to this repository in your configuration (addons-path) * update the module list * search for "Romania - Stock Account Date" in your addons diff --git a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py index 47259772f..00778797b 100644 --- a/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py +++ b/l10n_ro_stock_account_date/tests/test_stock_accounting_date.py @@ -60,7 +60,7 @@ def test_transfer(self): _logger.info("Start transfer") self.transfer(location_id, location_dest_id, accounting_date=acc_date) picking = self.picking - stock_move = picking.move_lines + stock_move = picking.move_ids _logger.info("Tranfer efectuat") self.assertEqual(picking.l10n_ro_accounting_date.date(), acc_date) self.assertEqual(stock_move.date.date(), acc_date) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000..057ee2b31 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,2 @@ +odoo-addon-l10n_ro_stock @ git+https://github.com/OCA/l10n-romania@refs/pull/522/head#subdirectory=setup/l10n_ro_stock +odoo-addon-l10n_ro_stock_account @ git+https://github.com/OCA/l10n-romania@refs/pull/523/head#subdirectory=setup/l10n_ro_stock_account From 8cfaf260cb7589129da7cecb936bbc653c6c3b52 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Sat, 23 Jul 2022 21:05:01 +0300 Subject: [PATCH 33/68] [14.0] [ADD] Add modules for stock accounting date. --- l10n_ro_stock_account_date_wizard/README.rst | 106 +++++ l10n_ro_stock_account_date_wizard/__init__.py | 1 + .../__manifest__.py | 18 + .../readme/CONTRIBUTORS.rst | 7 + .../readme/DESCRIPTION.rst | 1 + .../readme/INSTALL.rst | 7 + .../static/description/icon.png | Bin 0 -> 566 bytes .../static/description/index.html | 444 ++++++++++++++++++ .../static/src/css/report.css | 70 +++ .../tests/__init__.py | 1 + .../tests/test_stock_accounting_date.py | 153 ++++++ .../wizard/__init__.py | 2 + .../wizard/stock_backorder_confirmation.py | 66 +++ .../stock_backorder_confirmation_views.xml | 14 + .../wizard/stock_immediate_transfer.py | 48 ++ .../wizard/stock_immediate_transfer_views.xml | 16 + 16 files changed, 954 insertions(+) create mode 100644 l10n_ro_stock_account_date_wizard/README.rst create mode 100644 l10n_ro_stock_account_date_wizard/__init__.py create mode 100644 l10n_ro_stock_account_date_wizard/__manifest__.py create mode 100644 l10n_ro_stock_account_date_wizard/readme/CONTRIBUTORS.rst create mode 100644 l10n_ro_stock_account_date_wizard/readme/DESCRIPTION.rst create mode 100644 l10n_ro_stock_account_date_wizard/readme/INSTALL.rst create mode 100644 l10n_ro_stock_account_date_wizard/static/description/icon.png create mode 100644 l10n_ro_stock_account_date_wizard/static/description/index.html create mode 100644 l10n_ro_stock_account_date_wizard/static/src/css/report.css create mode 100644 l10n_ro_stock_account_date_wizard/tests/__init__.py create mode 100644 l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py create mode 100644 l10n_ro_stock_account_date_wizard/wizard/__init__.py create mode 100644 l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py create mode 100644 l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation_views.xml create mode 100644 l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py create mode 100644 l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer_views.xml diff --git a/l10n_ro_stock_account_date_wizard/README.rst b/l10n_ro_stock_account_date_wizard/README.rst new file mode 100644 index 000000000..019be7b4c --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/README.rst @@ -0,0 +1,106 @@ +====================== +Romania - Stock Report +====================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report + :alt: OCA/l10n-romania +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_report + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/177/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds a stock report according to Romanian requirements. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +To install this module, you need to: + +* clone the branch 14.0 of the repository https://github.com/OCA/l10n-romania +* add the path to this repository in your configuration (addons-path) +* update the module list +* search for "Romania - Stock Report" in your addons +* install the module + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-romania/issues>`_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_report%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Terrabit +* NextERP Romania + +Contributors +~~~~~~~~~~~~ + +* `Terrabit <https://www.terrabit.ro>`_: + + * Dorin Hongu <dhongu@gmail.com> + +* `NextERP Romania <https://www.nexterp.ro>`_: + + * Fekete Mihai <feketemihai@nexterp.ro> + * Alexandru Teodor <teodoralexandru@nexterp.ro> + * Musat Natanaela <musatnatanaela@nexterp.ro> + +Do not contact contributors directly about support or help with technical issues. + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-dhongu| image:: https://github.com/dhongu.png?size=40px + :target: https://github.com/dhongu + :alt: dhongu +.. |maintainer-feketemihai| image:: https://github.com/feketemihai.png?size=40px + :target: https://github.com/feketemihai + :alt: feketemihai + +Current `maintainers <https://odoo-community.org/page/maintainer-role>`__: + +|maintainer-dhongu| |maintainer-feketemihai| + +This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report>`_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_ro_stock_account_date_wizard/__init__.py b/l10n_ro_stock_account_date_wizard/__init__.py new file mode 100644 index 000000000..40272379f --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/__init__.py @@ -0,0 +1 @@ +from . import wizard diff --git a/l10n_ro_stock_account_date_wizard/__manifest__.py b/l10n_ro_stock_account_date_wizard/__manifest__.py new file mode 100644 index 000000000..53cd6dfaa --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright (C) 2022 NextERP Romania +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Romania - Stock Accounting Date Wizard", + "version": "14.0.1.2.0", + "category": "Localization", + "summary": "Romania - Stock Accounting Date Wizard", + "author": "NextERP Romania," "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/l10n-romania", + "depends": ["l10n_ro_stock_account"], + "license": "AGPL-3", + "data": [ + "wizard/stock_backorder_confirmation_views.xml", + "wizard/stock_immediate_transfer_views.xml", + ], + "installable": True, + "maintainers": ["feketemihai"], +} diff --git a/l10n_ro_stock_account_date_wizard/readme/CONTRIBUTORS.rst b/l10n_ro_stock_account_date_wizard/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..f0dd53f10 --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/readme/CONTRIBUTORS.rst @@ -0,0 +1,7 @@ +* `NextERP Romania <https://www.nexterp.ro>`_: + + * Fekete Mihai <feketemihai@nexterp.ro> + * Alexandru Teodor <teodoralexandru@nexterp.ro> + * Cojocaru Marcel <cojocarumarcel@nexterp.ro> + +Do not contact contributors directly about support or help with technical issues. diff --git a/l10n_ro_stock_account_date_wizard/readme/DESCRIPTION.rst b/l10n_ro_stock_account_date_wizard/readme/DESCRIPTION.rst new file mode 100644 index 000000000..6cb0a067f --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows you to select "Accounting Date" for stock operations in the Stock Confirmation Wizards. diff --git a/l10n_ro_stock_account_date_wizard/readme/INSTALL.rst b/l10n_ro_stock_account_date_wizard/readme/INSTALL.rst new file mode 100644 index 000000000..90586fa34 --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/readme/INSTALL.rst @@ -0,0 +1,7 @@ +To install this module, you need to: + +* clone the branch 14.0 of the repository https://github.com/OCA/l10n-romania +* add the path to this repository in your configuration (addons-path) +* update the module list +* search for "Romania - Stock Account Date Wizard" in your addons +* install the module diff --git a/l10n_ro_stock_account_date_wizard/static/description/icon.png b/l10n_ro_stock_account_date_wizard/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7ba9c1019cd79fba46148ad7c5deb9917b98888f GIT binary patch literal 566 zcmeAS@N?(olHy`uVBq!ia0vp^4Is?H1|$#LC7uRSY)RhkE<hRxemd{22U45`9+AZi z3<9q~m@#0=iyDw%S%G6ZkZu5DgNKH*7#J9>JY5_^DsH{Kw9(gzQN-aQds|CO;G9FQ zYi=Gg=$yTQ%~blvj2ktH%sTs@%ricy`;G^w845n!G5h?hFxvW&|LL-O_x0}2KmPfj z+2>7V=bZO%j`44wzy9;P4L|QMH8$QHYu!*Psc?>=kgdbmVGiRX9)a`*3+5w3P6+06 zU>K&Cv+tk8x6V~C_7PB2wZt`|BqgyV)hf9t6-Y4{85kPr8kp!B7=;*`SQ#5z8JTJu z7+Dz@te?hFi=rVnKP5A*5>11F1zf}ale*?W4U!-mg7ec#$`gxH8OqDc^)mCai<1)z YQuXqS(r3T3kpel+)78&qol`;+0JR&lX#fBK literal 0 HcmV?d00001 diff --git a/l10n_ro_stock_account_date_wizard/static/description/index.html b/l10n_ro_stock_account_date_wizard/static/description/index.html new file mode 100644 index 000000000..07787a304 --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/static/description/index.html @@ -0,0 +1,444 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" /> +<title>Romania - Stock Report</title> +<style type="text/css"> + +/* +:Author: David Goodger (goodger@python.org) +:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $ +:Copyright: This stylesheet has been placed in the public domain. + +Default cascading style sheet for the HTML output of Docutils. + +See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to +customize this style sheet. +*/ + +/* used to remove borders from tables and images */ +.borderless, table.borderless td, table.borderless th { + border: 0 } + +table.borderless td, table.borderless th { + /* Override padding for "table.docutils td" with "! important". + The right padding separates the table cells. */ + padding: 0 0.5em 0 0 ! important } + +.first { + /* Override more specific margin styles with "! important". */ + margin-top: 0 ! important } + +.last, .with-subtitle { + margin-bottom: 0 ! important } + +.hidden { + display: none } + +.subscript { + vertical-align: sub; + font-size: smaller } + +.superscript { + vertical-align: super; + font-size: smaller } + +a.toc-backref { + text-decoration: none ; + color: black } + +blockquote.epigraph { + margin: 2em 5em ; } + +dl.docutils dd { + margin-bottom: 0.5em } + +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + +/* Uncomment (and remove this text!) to get bold-faced definition list terms +dl.docutils dt { + font-weight: bold } +*/ + +div.abstract { + margin: 2em 5em } + +div.abstract p.topic-title { + font-weight: bold ; + text-align: center } + +div.admonition, div.attention, div.caution, div.danger, div.error, +div.hint, div.important, div.note, div.tip, div.warning { + margin: 2em ; + border: medium outset ; + padding: 1em } + +div.admonition p.admonition-title, div.hint p.admonition-title, +div.important p.admonition-title, div.note p.admonition-title, +div.tip p.admonition-title { + font-weight: bold ; + font-family: sans-serif } + +div.attention p.admonition-title, div.caution p.admonition-title, +div.danger p.admonition-title, div.error p.admonition-title, +div.warning p.admonition-title, .code .error { + color: red ; + font-weight: bold ; + font-family: sans-serif } + +/* Uncomment (and remove this text!) to get reduced vertical space in + compound paragraphs. +div.compound .compound-first, div.compound .compound-middle { + margin-bottom: 0.5em } + +div.compound .compound-last, div.compound .compound-middle { + margin-top: 0.5em } +*/ + +div.dedication { + margin: 2em 5em ; + text-align: center ; + font-style: italic } + +div.dedication p.topic-title { + font-weight: bold ; + font-style: normal } + +div.figure { + margin-left: 2em ; + margin-right: 2em } + +div.footer, div.header { + clear: both; + font-size: smaller } + +div.line-block { + display: block ; + margin-top: 1em ; + margin-bottom: 1em } + +div.line-block div.line-block { + margin-top: 0 ; + margin-bottom: 0 ; + margin-left: 1.5em } + +div.sidebar { + margin: 0 0 0.5em 1em ; + border: medium outset ; + padding: 1em ; + background-color: #ffffee ; + width: 40% ; + float: right ; + clear: right } + +div.sidebar p.rubric { + font-family: sans-serif ; + font-size: medium } + +div.system-messages { + margin: 5em } + +div.system-messages h1 { + color: red } + +div.system-message { + border: medium outset ; + padding: 1em } + +div.system-message p.system-message-title { + color: red ; + font-weight: bold } + +div.topic { + margin: 2em } + +h1.section-subtitle, h2.section-subtitle, h3.section-subtitle, +h4.section-subtitle, h5.section-subtitle, h6.section-subtitle { + margin-top: 0.4em } + +h1.title { + text-align: center } + +h2.subtitle { + text-align: center } + +hr.docutils { + width: 75% } + +img.align-left, .figure.align-left, object.align-left, table.align-left { + clear: left ; + float: left ; + margin-right: 1em } + +img.align-right, .figure.align-right, object.align-right, table.align-right { + clear: right ; + float: right ; + margin-left: 1em } + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left } + +.align-center { + clear: both ; + text-align: center } + +.align-right { + text-align: right } + +/* reset inner alignment in figures */ +div.align-right { + text-align: inherit } + +/* div.align-center * { */ +/* text-align: left } */ + +.align-top { + vertical-align: top } + +.align-middle { + vertical-align: middle } + +.align-bottom { + vertical-align: bottom } + +ol.simple, ul.simple { + margin-bottom: 1em } + +ol.arabic { + list-style: decimal } + +ol.loweralpha { + list-style: lower-alpha } + +ol.upperalpha { + list-style: upper-alpha } + +ol.lowerroman { + list-style: lower-roman } + +ol.upperroman { + list-style: upper-roman } + +p.attribution { + text-align: right ; + margin-left: 50% } + +p.caption { + font-style: italic } + +p.credits { + font-style: italic ; + font-size: smaller } + +p.label { + white-space: nowrap } + +p.rubric { + font-weight: bold ; + font-size: larger ; + color: maroon ; + text-align: center } + +p.sidebar-title { + font-family: sans-serif ; + font-weight: bold ; + font-size: larger } + +p.sidebar-subtitle { + font-family: sans-serif ; + font-weight: bold } + +p.topic-title { + font-weight: bold } + +pre.address { + margin-bottom: 0 ; + margin-top: 0 ; + font: inherit } + +pre.literal-block, pre.doctest-block, pre.math, pre.code { + margin-left: 2em ; + margin-right: 2em } + +pre.code .ln { color: grey; } /* line numbers */ +pre.code, code { background-color: #eeeeee } +pre.code .comment, code .comment { color: #5C6576 } +pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } +pre.code .literal.string, code .literal.string { color: #0C5404 } +pre.code .name.builtin, code .name.builtin { color: #352B84 } +pre.code .deleted, code .deleted { background-color: #DEB0A1} +pre.code .inserted, code .inserted { background-color: #A3D289} + +span.classifier { + font-family: sans-serif ; + font-style: oblique } + +span.classifier-delimiter { + font-family: sans-serif ; + font-weight: bold } + +span.interpreted { + font-family: sans-serif } + +span.option { + white-space: nowrap } + +span.pre { + white-space: pre } + +span.problematic { + color: red } + +span.section-subtitle { + /* font-size relative to parent (h1..h6 element) */ + font-size: 80% } + +table.citation { + border-left: solid 1px gray; + margin-left: 1px } + +table.docinfo { + margin: 2em 4em } + +table.docutils { + margin-top: 0.5em ; + margin-bottom: 0.5em } + +table.footnote { + border-left: solid 1px black; + margin-left: 1px } + +table.docutils td, table.docutils th, +table.docinfo td, table.docinfo th { + padding-left: 0.5em ; + padding-right: 0.5em ; + vertical-align: top } + +table.docutils th.field-name, table.docinfo th.docinfo-name { + font-weight: bold ; + text-align: left ; + white-space: nowrap ; + padding-left: 0 } + +/* "booktabs" style (no vertical lines) */ +table.docutils.booktabs { + border: 0px; + border-top: 2px solid; + border-bottom: 2px solid; + border-collapse: collapse; +} +table.docutils.booktabs * { + border: 0px; +} +table.docutils.booktabs th { + border-bottom: thin solid; + text-align: left; +} + +h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, +h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { + font-size: 100% } + +ul.auto-toc { + list-style-type: none } + +</style> +</head> +<body> +<div class="document" id="romania-stock-report"> +<h1 class="title">Romania - Stock Report</h1> + +<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! This file is generated by oca-gen-addon-readme !! +!! changes will be overwritten. !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> +<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_report"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> +<p>This module adds a stock report according to Romanian requirements.</p> +<p><strong>Table of contents</strong></p> +<div class="contents local topic" id="contents"> +<ul class="simple"> +<li><a class="reference internal" href="#installation" id="id1">Installation</a></li> +<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li> +<li><a class="reference internal" href="#credits" id="id3">Credits</a><ul> +<li><a class="reference internal" href="#authors" id="id4">Authors</a></li> +<li><a class="reference internal" href="#contributors" id="id5">Contributors</a></li> +<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li> +</ul> +</li> +</ul> +</div> +<div class="section" id="installation"> +<h1><a class="toc-backref" href="#id1">Installation</a></h1> +<p>To install this module, you need to:</p> +<ul class="simple"> +<li>clone the branch 14.0 of the repository <a class="reference external" href="https://github.com/OCA/l10n-romania">https://github.com/OCA/l10n-romania</a></li> +<li>add the path to this repository in your configuration (addons-path)</li> +<li>update the module list</li> +<li>search for “Romania - Stock Report” in your addons</li> +<li>install the module</li> +</ul> +</div> +<div class="section" id="bug-tracker"> +<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1> +<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-romania/issues">GitHub Issues</a>. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_report%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> +<p>Do not contact contributors directly about support or help with technical issues.</p> +</div> +<div class="section" id="credits"> +<h1><a class="toc-backref" href="#id3">Credits</a></h1> +<div class="section" id="authors"> +<h2><a class="toc-backref" href="#id4">Authors</a></h2> +<ul class="simple"> +<li>Terrabit</li> +<li>NextERP Romania</li> +</ul> +</div> +<div class="section" id="contributors"> +<h2><a class="toc-backref" href="#id5">Contributors</a></h2> +<ul class="simple"> +<li><a class="reference external" href="https://www.terrabit.ro">Terrabit</a>:<ul> +<li>Dorin Hongu <<a class="reference external" href="mailto:dhongu@gmail.com">dhongu@gmail.com</a>></li> +</ul> +</li> +<li><a class="reference external" href="https://www.nexterp.ro">NextERP Romania</a>:<ul> +<li>Fekete Mihai <<a class="reference external" href="mailto:feketemihai@nexterp.ro">feketemihai@nexterp.ro</a>></li> +<li>Alexandru Teodor <<a class="reference external" href="mailto:teodoralexandru@nexterp.ro">teodoralexandru@nexterp.ro</a>></li> +<li>Musat Natanaela <<a class="reference external" href="mailto:musatnatanaela@nexterp.ro">musatnatanaela@nexterp.ro</a>></li> +</ul> +</li> +</ul> +<p>Do not contact contributors directly about support or help with technical issues.</p> +</div> +<div class="section" id="maintainers"> +<h2><a class="toc-backref" href="#id6">Maintainers</a></h2> +<p>This module is maintained by the OCA.</p> +<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> +<p>OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.</p> +<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p> +<p><a class="reference external" href="https://github.com/dhongu"><img alt="dhongu" src="https://github.com/dhongu.png?size=40px" /></a> <a class="reference external" href="https://github.com/feketemihai"><img alt="feketemihai" src="https://github.com/feketemihai.png?size=40px" /></a></p> +<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report">OCA/l10n-romania</a> project on GitHub.</p> +<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> +</div> +</div> +</div> +</body> +</html> diff --git a/l10n_ro_stock_account_date_wizard/static/src/css/report.css b/l10n_ro_stock_account_date_wizard/static/src/css/report.css new file mode 100644 index 000000000..c37ada778 --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/static/src/css/report.css @@ -0,0 +1,70 @@ +.act_as_table { + display: table; + background-color: white; +} +.act_as_row { + display: table-row; + page-break-inside: avoid; +} +.act_as_cell { + display: table-cell; + page-break-inside: avoid; +} +.act_as_thead { + display: table-header-group; +} +.act_as_row.labels { + background-color: #f0f0f0; +} +.data_table { + width: 100%; + border-left: 0px; + border-right: 0px; + text-align: center; + font-size: 10px; + padding-right: 3px; + padding-left: 3px; + padding-top: 2px; + padding-bottom: 2px; + border-collapse: collapse; +} +.data_table .act_as_cell { + border: 1px solid lightGrey; + text-align: center; +} + +.data_table .act_as_cell { + word-wrap: break-word; +} +.data_table .act_as_row.labels { + font-weight: bold; +} +.act_as_cell.left { + text-align: left; + padding: 5px 7px; +} +.act_as_cell.right { + text-align: right; + padding: 5px 7px; +} +.act_as_cell.sold { + font-style: italic; + font-weight: bold; +} + +.custom_footer { + font-size: 7px !important; +} +.button_row { + padding-bottom: 10px; +} +.o_stock_sheet_reports_page { + padding-top: 10px; + width: 90%; + margin-right: auto; + margin-left: auto; + font-family: Helvetica, Arial, serif; +} +.act_as_caption { + display: run-in; +} diff --git a/l10n_ro_stock_account_date_wizard/tests/__init__.py b/l10n_ro_stock_account_date_wizard/tests/__init__.py new file mode 100644 index 000000000..66210a1c2 --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/tests/__init__.py @@ -0,0 +1 @@ +from . import test_stock_accounting_date diff --git a/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py new file mode 100644 index 000000000..cc35d5371 --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py @@ -0,0 +1,153 @@ +# Copyright (C) 2020 Terrabit +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +import logging +from datetime import timedelta + +from odoo import fields +from odoo.tests import Form, tagged + +from odoo.addons.l10n_ro_stock_account.tests.common import TestStockCommon + +_logger = logging.getLogger(__name__) + + +@tagged("post_install", "-at_install") +class TestStockReport(TestStockCommon): + def set_stock(self, product, qty): + inventory = self.env["stock.inventory"].create( + { + "location_ids": [(4, self.location_warehouse.id)], + "product_ids": [(4, product.id)], + } + ) + inventory.action_start() + + inventory.line_ids.product_qty = qty + inventory.action_validate() + + def trasfer(self, location, location_dest, product=None, accounting_date=False): + self.PickingObj = self.env["stock.picking"] + self.MoveObj = self.env["stock.move"] + self.MoveObj = self.env["stock.move"] + + if not product: + product = self.product_mp + + picking = self.PickingObj.create( + { + "picking_type_id": self.picking_type_transfer.id, + "location_id": location.id, + "location_dest_id": location_dest.id, + } + ) + self.MoveObj.create( + { + "name": product.name, + "product_id": product.id, + "product_uom_qty": 10, + "product_uom": product.uom_id.id, + "picking_id": picking.id, + "location_id": location.id, + "location_dest_id": location_dest.id, + } + ) + if accounting_date: + picking.accounting_date = accounting_date + picking.action_confirm() + picking.action_assign() + for move_line in picking.move_lines: + if move_line.product_uom_qty > 0 and move_line.quantity_done == 0: + move_line.write({"quantity_done": move_line.product_uom_qty}) + return picking + + def test_transfer_backorder(self): + self.set_stock(self.product_mp, 1000) + acc_date = fields.Date.today() - timedelta(days=1) + location_id = self.picking_type_transfer.default_location_src_id + location_dest_id = self.picking_type_transfer.default_location_dest_id.copy( + {"property_stock_valuation_account_id": self.account_valuation.id} + ) + _logger.info("Start transfer") + picking = self.trasfer(location_id, location_dest_id) + picking.move_lines[0].move_line_ids[0].qty_done = 2 + action_data = picking.button_validate() + backorder_wizard = Form( + self.env["stock.backorder.confirmation"].with_context( + action_data.get("context", {}) + ) + ).save() + backorder_wizard.accounting_date = acc_date + backorder_wizard.process() + stock_move = picking.move_lines + _logger.info("Tranfer efectuat") + self.assertEqual(picking.accounting_date.date(), acc_date) + self.assertEqual(stock_move.date.date(), acc_date) + self.assertEqual(stock_move.move_line_ids.date.date(), acc_date) + self.assertEqual( + stock_move.stock_valuation_layer_ids.mapped("create_date")[0].date(), + acc_date, + ) + self.assertEqual(stock_move.account_move_ids.date, acc_date) + + def test_transfer_cancel_backorder(self): + self.set_stock(self.product_mp, 1000) + acc_date = fields.Date.today() - timedelta(days=1) + location_id = self.picking_type_transfer.default_location_src_id + location_dest_id = self.picking_type_transfer.default_location_dest_id.copy( + {"property_stock_valuation_account_id": self.account_valuation.id} + ) + _logger.info("Start transfer") + picking = self.trasfer(location_id, location_dest_id) + picking.move_lines[0].move_line_ids[0].qty_done = 2 + action_data = picking.button_validate() + backorder_wizard = Form( + self.env["stock.backorder.confirmation"].with_context( + action_data.get("context", {}) + ) + ).save() + backorder_wizard.accounting_date = acc_date + backorder_wizard.process_cancel_backorder() + stock_move = picking.move_lines.filtered(lambda m: m.state == "done") + _logger.info("Tranfer efectuat") + self.assertEqual(picking.accounting_date.date(), acc_date) + self.assertEqual(stock_move.date.date(), acc_date) + self.assertEqual(stock_move.move_line_ids.date.date(), acc_date) + self.assertEqual( + stock_move.stock_valuation_layer_ids.mapped("create_date")[0].date(), + acc_date, + ) + self.assertEqual(stock_move.account_move_ids.date, acc_date) + + def test_receipt(self): + picking_type_in = self.picking_type_in_warehouse + acc_date = fields.Date.today() - timedelta(days=1) + po = Form(self.env["purchase.order"]) + po.partner_id = self.vendor + po.picking_type_id = picking_type_in + + with po.order_line.new() as po_line: + po_line.product_id = self.product_1 + po_line.product_qty = self.qty_po_p1 + po_line.price_unit = self.price_p1 + + po = po.save() + po.button_confirm() + picking = po.picking_ids.filtered(lambda pick: pick.state != "done") + + wiz = picking.button_validate() + wiz = Form( + self.env["stock.immediate.transfer"].with_context(wiz["context"]) + ).save() + wiz.accounting_date = acc_date + wiz.process() + + stock_move = picking.move_lines + _logger.info("Tranfer efectuat") + self.assertEqual(picking.accounting_date.date(), acc_date) + self.assertEqual(stock_move.date.date(), acc_date) + self.assertEqual(stock_move.move_line_ids.date.date(), acc_date) + self.assertEqual( + stock_move.stock_valuation_layer_ids.mapped("create_date")[0].date(), + acc_date, + ) diff --git a/l10n_ro_stock_account_date_wizard/wizard/__init__.py b/l10n_ro_stock_account_date_wizard/wizard/__init__.py new file mode 100644 index 000000000..7a5186a84 --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/wizard/__init__.py @@ -0,0 +1,2 @@ +from . import stock_backorder_confirmation +from . import stock_immediate_transfer diff --git a/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py new file mode 100644 index 000000000..64f1386b6 --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py @@ -0,0 +1,66 @@ +# Copyright (C) 2022 NextERP Romania SRL +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + + +class StockBackorderConfirmation(models.TransientModel): + _inherit = "stock.backorder.confirmation" + + accounting_date = fields.Datetime( + help="If this field is set, the svl and accounting entiries will " + "have this date, If not will have the today date as it should be", + default=fields.Datetime.now(), + ) + + @api.model + def default_get(self, fields): + res = super().default_get(fields) + if res.get("pick_ids"): + if ( + self.env["stock.picking"] + .browse(res["pick_ids"][0][2][0]) + .accounting_date + ): + res["accounting_date"] = ( + self.env["stock.picking"] + .browse(res["pick_ids"][0][2][0]) + .accounting_date + ) + return res + + def process(self): + if self.accounting_date: + if self.accounting_date.date() > fields.date.today(): + raise ValidationError( + _( + "You can not have a Accounting date=%s for picking bigger than today!" + % self.accounting_date.date() + ) + ) + self.pick_ids.write( + { + "accounting_date": self.accounting_date, + "date_done": self.accounting_date, + } + ) + return super().process() + + def process_cancel_backorder(self): + pickings_to_validate = self.env.context.get("button_validate_picking_ids") + if pickings_to_validate and self.accounting_date: + if self.accounting_date.date() > fields.date.today(): + raise ValidationError( + _( + "You can not have a Accounting date=%s for picking bigger than today!" + % self.accounting_date.date() + ) + ) + self.env["stock.picking"].browse(pickings_to_validate).write( + { + "accounting_date": self.accounting_date, + "date_done": self.accounting_date, + } + ) + return super().process_cancel_backorder() diff --git a/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation_views.xml b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation_views.xml new file mode 100644 index 000000000..0c6a54187 --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation_views.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8" ?> +<odoo> + <record id="view_backorder_confirmation" model="ir.ui.view"> + <field name="model">stock.backorder.confirmation</field> + <field name="inherit_id" ref="stock.view_backorder_confirmation" /> + <field name="arch" type="xml"> + <xpath expr="//footer" position="before"> + <group> + <field name="accounting_date" /> + </group> + </xpath> + </field> + </record> +</odoo> diff --git a/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py b/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py new file mode 100644 index 000000000..d18d171aa --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py @@ -0,0 +1,48 @@ +# Copyright (C) 2022 NextERP Romania SRL +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + + +class StockImmediateTransfer(models.TransientModel): + _inherit = "stock.immediate.transfer" + + accounting_date = fields.Datetime( + help="If this field is set, the svl and accounting entiries will " + "have this date, If not will have the today date as it should be", + default=fields.Datetime.now(), + ) + + @api.model + def default_get(self, fields): + res = super().default_get(fields) + if res.get("pick_ids"): + if ( + self.env["stock.picking"] + .browse(res["pick_ids"][0][2][0]) + .accounting_date + ): + res["accounting_date"] = ( + self.env["stock.picking"] + .browse(res["pick_ids"][0][2][0]) + .accounting_date + ) + return res + + def process(self): + if self.accounting_date: + if self.accounting_date.date() > fields.date.today(): + raise ValidationError( + _( + "You can not have a Accounting date=%s for picking bigger than today!" + % self.accounting_date.date() + ) + ) + self.pick_ids.write( + { + "accounting_date": self.accounting_date, + "date_done": self.accounting_date, + } + ) + return super().process() diff --git a/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer_views.xml b/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer_views.xml new file mode 100644 index 000000000..8c3fbeae3 --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer_views.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8" ?> +<odoo> + <record id="view_immediate_transfer" model="ir.ui.view"> + <field name="model">stock.immediate.transfer</field> + <field name="inherit_id" ref="stock.view_immediate_transfer" /> + <field name="arch" type="xml"> + <xpath expr="//footer" position="before"> + <group> + <group> + <field name="accounting_date" /> + </group> + </group> + </xpath> + </field> + </record> +</odoo> From 5d5fcef4fde18fdd629d39249e5854841dedc79b Mon Sep 17 00:00:00 2001 From: Fekete Mihai <feketemihai@nexterp.ro> Date: Tue, 26 Jul 2022 13:07:00 +0300 Subject: [PATCH 34/68] Update __manifest__.py --- l10n_ro_stock_account_date_wizard/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date_wizard/__manifest__.py b/l10n_ro_stock_account_date_wizard/__manifest__.py index 53cd6dfaa..b77f5263a 100644 --- a/l10n_ro_stock_account_date_wizard/__manifest__.py +++ b/l10n_ro_stock_account_date_wizard/__manifest__.py @@ -7,7 +7,7 @@ "summary": "Romania - Stock Accounting Date Wizard", "author": "NextERP Romania," "Odoo Community Association (OCA)", "website": "https://github.com/OCA/l10n-romania", - "depends": ["l10n_ro_stock_account"], + "depends": ["l10n_ro_stock_account_date"], "license": "AGPL-3", "data": [ "wizard/stock_backorder_confirmation_views.xml", From a86d6d48b7e7004dcc8b59a4e686d0bbe14c3860 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 26 Jul 2022 14:37:09 +0000 Subject: [PATCH 35/68] [UPD] README.rst --- l10n_ro_stock_account_date_wizard/README.rst | 32 +++++++------------ .../static/description/index.html | 27 +++++++--------- 2 files changed, 23 insertions(+), 36 deletions(-) diff --git a/l10n_ro_stock_account_date_wizard/README.rst b/l10n_ro_stock_account_date_wizard/README.rst index 019be7b4c..10799c885 100644 --- a/l10n_ro_stock_account_date_wizard/README.rst +++ b/l10n_ro_stock_account_date_wizard/README.rst @@ -1,6 +1,6 @@ -====================== -Romania - Stock Report -====================== +====================================== +Romania - Stock Accounting Date Wizard +====================================== .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! @@ -14,10 +14,10 @@ Romania - Stock Report :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github - :target: https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report + :target: https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date_wizard :alt: OCA/l10n-romania .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_report + :target: https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_account_date_wizard :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png :target: https://runbot.odoo-community.org/runbot/177/14.0 @@ -25,7 +25,7 @@ Romania - Stock Report |badge1| |badge2| |badge3| |badge4| |badge5| -This module adds a stock report according to Romanian requirements. +This module allows you to select "Accounting Date" for stock operations in the Stock Confirmation Wizards. **Table of contents** @@ -40,7 +40,7 @@ To install this module, you need to: * clone the branch 14.0 of the repository https://github.com/OCA/l10n-romania * add the path to this repository in your configuration (addons-path) * update the module list -* search for "Romania - Stock Report" in your addons +* search for "Romania - Stock Account Date Wizard" in your addons * install the module Bug Tracker @@ -49,7 +49,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-romania/issues>`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_report%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. +`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date_wizard%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. Do not contact contributors directly about support or help with technical issues. @@ -59,21 +59,16 @@ Credits Authors ~~~~~~~ -* Terrabit * NextERP Romania Contributors ~~~~~~~~~~~~ -* `Terrabit <https://www.terrabit.ro>`_: - - * Dorin Hongu <dhongu@gmail.com> - * `NextERP Romania <https://www.nexterp.ro>`_: * Fekete Mihai <feketemihai@nexterp.ro> * Alexandru Teodor <teodoralexandru@nexterp.ro> - * Musat Natanaela <musatnatanaela@nexterp.ro> + * Cojocaru Marcel <cojocarumarcel@nexterp.ro> Do not contact contributors directly about support or help with technical issues. @@ -90,17 +85,14 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -.. |maintainer-dhongu| image:: https://github.com/dhongu.png?size=40px - :target: https://github.com/dhongu - :alt: dhongu .. |maintainer-feketemihai| image:: https://github.com/feketemihai.png?size=40px :target: https://github.com/feketemihai :alt: feketemihai -Current `maintainers <https://odoo-community.org/page/maintainer-role>`__: +Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: -|maintainer-dhongu| |maintainer-feketemihai| +|maintainer-feketemihai| -This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report>`_ project on GitHub. +This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date_wizard>`_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_ro_stock_account_date_wizard/static/description/index.html b/l10n_ro_stock_account_date_wizard/static/description/index.html index 07787a304..3d5424b5f 100644 --- a/l10n_ro_stock_account_date_wizard/static/description/index.html +++ b/l10n_ro_stock_account_date_wizard/static/description/index.html @@ -4,7 +4,7 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" /> -<title>Romania - Stock Report</title> +<title>Romania - Stock Accounting Date Wizard</title> <style type="text/css"> /* @@ -360,15 +360,15 @@ </style> </head> <body> -<div class="document" id="romania-stock-report"> -<h1 class="title">Romania - Stock Report</h1> +<div class="document" id="romania-stock-accounting-date-wizard"> +<h1 class="title">Romania - Stock Accounting Date Wizard</h1> <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_report"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> -<p>This module adds a stock report according to Romanian requirements.</p> +<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date_wizard"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_account_date_wizard"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> +<p>This module allows you to select “Accounting Date” for stock operations in the Stock Confirmation Wizards.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> @@ -389,7 +389,7 @@ <h1><a class="toc-backref" href="#id1">Installation</a></h1> <li>clone the branch 14.0 of the repository <a class="reference external" href="https://github.com/OCA/l10n-romania">https://github.com/OCA/l10n-romania</a></li> <li>add the path to this repository in your configuration (addons-path)</li> <li>update the module list</li> -<li>search for “Romania - Stock Report” in your addons</li> +<li>search for “Romania - Stock Account Date Wizard” in your addons</li> <li>install the module</li> </ul> </div> @@ -398,7 +398,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-romania/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_report%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> +<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date_wizard%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> </div> <div class="section" id="credits"> @@ -406,21 +406,16 @@ <h1><a class="toc-backref" href="#id3">Credits</a></h1> <div class="section" id="authors"> <h2><a class="toc-backref" href="#id4">Authors</a></h2> <ul class="simple"> -<li>Terrabit</li> <li>NextERP Romania</li> </ul> </div> <div class="section" id="contributors"> <h2><a class="toc-backref" href="#id5">Contributors</a></h2> <ul class="simple"> -<li><a class="reference external" href="https://www.terrabit.ro">Terrabit</a>:<ul> -<li>Dorin Hongu <<a class="reference external" href="mailto:dhongu@gmail.com">dhongu@gmail.com</a>></li> -</ul> -</li> <li><a class="reference external" href="https://www.nexterp.ro">NextERP Romania</a>:<ul> <li>Fekete Mihai <<a class="reference external" href="mailto:feketemihai@nexterp.ro">feketemihai@nexterp.ro</a>></li> <li>Alexandru Teodor <<a class="reference external" href="mailto:teodoralexandru@nexterp.ro">teodoralexandru@nexterp.ro</a>></li> -<li>Musat Natanaela <<a class="reference external" href="mailto:musatnatanaela@nexterp.ro">musatnatanaela@nexterp.ro</a>></li> +<li>Cojocaru Marcel <<a class="reference external" href="mailto:cojocarumarcel@nexterp.ro">cojocarumarcel@nexterp.ro</a>></li> </ul> </li> </ul> @@ -433,9 +428,9 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2> <p>OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.</p> -<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p> -<p><a class="reference external" href="https://github.com/dhongu"><img alt="dhongu" src="https://github.com/dhongu.png?size=40px" /></a> <a class="reference external" href="https://github.com/feketemihai"><img alt="feketemihai" src="https://github.com/feketemihai.png?size=40px" /></a></p> -<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_report">OCA/l10n-romania</a> project on GitHub.</p> +<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> +<p><a class="reference external" href="https://github.com/feketemihai"><img alt="feketemihai" src="https://github.com/feketemihai.png?size=40px" /></a></p> +<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date_wizard">OCA/l10n-romania</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> </div> </div> From f697d43a09778f3d00823749e56646434fe346b3 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 26 Jul 2022 14:37:10 +0000 Subject: [PATCH 36/68] l10n_ro_stock_account_date_wizard 14.0.1.3.0 --- l10n_ro_stock_account_date_wizard/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date_wizard/__manifest__.py b/l10n_ro_stock_account_date_wizard/__manifest__.py index b77f5263a..1171586eb 100644 --- a/l10n_ro_stock_account_date_wizard/__manifest__.py +++ b/l10n_ro_stock_account_date_wizard/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date Wizard", - "version": "14.0.1.2.0", + "version": "14.0.1.3.0", "category": "Localization", "summary": "Romania - Stock Accounting Date Wizard", "author": "NextERP Romania," "Odoo Community Association (OCA)", From fbbcf4434a74c0a1ff5fc752ea0dea7c829dccd4 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Thu, 28 Jul 2022 19:58:54 +0300 Subject: [PATCH 37/68] Migrate l10n_ro_stock_account_date_wizard to 15.0 --- l10n_ro_stock_account_date_wizard/__manifest__.py | 2 +- .../tests/test_stock_accounting_date.py | 6 +++--- .../wizard/stock_backorder_confirmation.py | 4 ++-- .../wizard/stock_immediate_transfer.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/l10n_ro_stock_account_date_wizard/__manifest__.py b/l10n_ro_stock_account_date_wizard/__manifest__.py index 1171586eb..34bd428f4 100644 --- a/l10n_ro_stock_account_date_wizard/__manifest__.py +++ b/l10n_ro_stock_account_date_wizard/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date Wizard", - "version": "14.0.1.3.0", + "version": "15.0.1.3.0", "category": "Localization", "summary": "Romania - Stock Accounting Date Wizard", "author": "NextERP Romania," "Odoo Community Association (OCA)", diff --git a/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py index cc35d5371..62bc129be 100644 --- a/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py +++ b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py @@ -74,7 +74,7 @@ def test_transfer_backorder(self): action_data = picking.button_validate() backorder_wizard = Form( self.env["stock.backorder.confirmation"].with_context( - action_data.get("context", {}) + **action_data.get("context", {}) ) ).save() backorder_wizard.accounting_date = acc_date @@ -103,7 +103,7 @@ def test_transfer_cancel_backorder(self): action_data = picking.button_validate() backorder_wizard = Form( self.env["stock.backorder.confirmation"].with_context( - action_data.get("context", {}) + **action_data.get("context", {}) ) ).save() backorder_wizard.accounting_date = acc_date @@ -137,7 +137,7 @@ def test_receipt(self): wiz = picking.button_validate() wiz = Form( - self.env["stock.immediate.transfer"].with_context(wiz["context"]) + self.env["stock.immediate.transfer"].with_context(**wiz["context"]) ).save() wiz.accounting_date = acc_date wiz.process() diff --git a/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py index 64f1386b6..23b2af099 100644 --- a/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py +++ b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py @@ -36,8 +36,8 @@ def process(self): raise ValidationError( _( "You can not have a Accounting date=%s for picking bigger than today!" - % self.accounting_date.date() ) + % self.accounting_date.date() ) self.pick_ids.write( { @@ -54,8 +54,8 @@ def process_cancel_backorder(self): raise ValidationError( _( "You can not have a Accounting date=%s for picking bigger than today!" - % self.accounting_date.date() ) + % self.accounting_date.date() ) self.env["stock.picking"].browse(pickings_to_validate).write( { diff --git a/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py b/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py index d18d171aa..90ab89029 100644 --- a/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py +++ b/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py @@ -36,8 +36,8 @@ def process(self): raise ValidationError( _( "You can not have a Accounting date=%s for picking bigger than today!" - % self.accounting_date.date() ) + % self.accounting_date.date() ) self.pick_ids.write( { From 2dc4bc4245e5f32a670134de499d9aa071dace70 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Fri, 29 Jul 2022 12:52:34 +0300 Subject: [PATCH 38/68] Update tests. --- .../tests/test_stock_accounting_date.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py index 62bc129be..9a3321280 100644 --- a/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py +++ b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py @@ -15,16 +15,15 @@ @tagged("post_install", "-at_install") class TestStockReport(TestStockCommon): def set_stock(self, product, qty): - inventory = self.env["stock.inventory"].create( + inventory_obj = self.env["stock.quant"].with_context(inventory_mode=True) + inventory = inventory_obj.create( { - "location_ids": [(4, self.location_warehouse.id)], - "product_ids": [(4, product.id)], + "location_id": self.location_warehouse.id, + "product_id": product.id, + "inventory_quantity": qty, } ) - inventory.action_start() - - inventory.line_ids.product_qty = qty - inventory.action_validate() + inventory._apply_inventory() def trasfer(self, location, location_dest, product=None, accounting_date=False): self.PickingObj = self.env["stock.picking"] From c90258e8ba6787f8a3756ba4c6484737b9938d95 Mon Sep 17 00:00:00 2001 From: oca-ci <oca-ci@odoo-community.org> Date: Fri, 29 Jul 2022 10:34:05 +0000 Subject: [PATCH 39/68] [UPD] Update l10n_ro_stock_account_date_wizard.pot --- .../l10n_ro_stock_account_date_wizard.pot | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 l10n_ro_stock_account_date_wizard/i18n/l10n_ro_stock_account_date_wizard.pot diff --git a/l10n_ro_stock_account_date_wizard/i18n/l10n_ro_stock_account_date_wizard.pot b/l10n_ro_stock_account_date_wizard/i18n/l10n_ro_stock_account_date_wizard.pot new file mode 100644 index 000000000..2efd962b9 --- /dev/null +++ b/l10n_ro_stock_account_date_wizard/i18n/l10n_ro_stock_account_date_wizard.pot @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_ro_stock_account_date_wizard +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: l10n_ro_stock_account_date_wizard +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date_wizard.field_stock_backorder_confirmation__accounting_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date_wizard.field_stock_immediate_transfer__accounting_date +msgid "Accounting Date" +msgstr "" + +#. module: l10n_ro_stock_account_date_wizard +#: model:ir.model,name:l10n_ro_stock_account_date_wizard.model_stock_backorder_confirmation +msgid "Backorder Confirmation" +msgstr "" + +#. module: l10n_ro_stock_account_date_wizard +#: model:ir.model.fields,help:l10n_ro_stock_account_date_wizard.field_stock_backorder_confirmation__accounting_date +#: model:ir.model.fields,help:l10n_ro_stock_account_date_wizard.field_stock_immediate_transfer__accounting_date +msgid "" +"If this field is set, the svl and accounting entiries will have this date, " +"If not will have the today date as it should be" +msgstr "" + +#. module: l10n_ro_stock_account_date_wizard +#: model:ir.model,name:l10n_ro_stock_account_date_wizard.model_stock_immediate_transfer +msgid "Immediate Transfer" +msgstr "" + +#. module: l10n_ro_stock_account_date_wizard +#: code:addons/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py:0 +#: code:addons/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py:0 +#: code:addons/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py:0 +#, python-format +msgid "You can not have a Accounting date=%s for picking bigger than today!" +msgstr "" From 0e17bab8960a00ea3926b75f20024ceda739e12d Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Fri, 29 Jul 2022 10:42:59 +0000 Subject: [PATCH 40/68] [UPD] README.rst --- l10n_ro_stock_account_date_wizard/README.rst | 10 +++++----- .../static/description/index.html | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/l10n_ro_stock_account_date_wizard/README.rst b/l10n_ro_stock_account_date_wizard/README.rst index 10799c885..81169b4ac 100644 --- a/l10n_ro_stock_account_date_wizard/README.rst +++ b/l10n_ro_stock_account_date_wizard/README.rst @@ -14,13 +14,13 @@ Romania - Stock Accounting Date Wizard :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github - :target: https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date_wizard + :target: https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date_wizard :alt: OCA/l10n-romania .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_account_date_wizard + :target: https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date_wizard :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/177/14.0 + :target: https://runbot.odoo-community.org/runbot/177/15.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -49,7 +49,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-romania/issues>`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date_wizard%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. +`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date_wizard%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. Do not contact contributors directly about support or help with technical issues. @@ -93,6 +93,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: |maintainer-feketemihai| -This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date_wizard>`_ project on GitHub. +This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date_wizard>`_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_ro_stock_account_date_wizard/static/description/index.html b/l10n_ro_stock_account_date_wizard/static/description/index.html index 3d5424b5f..fd21084d1 100644 --- a/l10n_ro_stock_account_date_wizard/static/description/index.html +++ b/l10n_ro_stock_account_date_wizard/static/description/index.html @@ -367,7 +367,7 @@ <h1 class="title">Romania - Stock Accounting Date Wizard</h1> !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date_wizard"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-14-0/l10n-romania-14-0-l10n_ro_stock_account_date_wizard"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> +<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date_wizard"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date_wizard"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>This module allows you to select “Accounting Date” for stock operations in the Stock Confirmation Wizards.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> @@ -398,7 +398,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-romania/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date_wizard%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> +<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date_wizard%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> </div> <div class="section" id="credits"> @@ -430,7 +430,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2> promote its widespread use.</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> <p><a class="reference external" href="https://github.com/feketemihai"><img alt="feketemihai" src="https://github.com/feketemihai.png?size=40px" /></a></p> -<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/14.0/l10n_ro_stock_account_date_wizard">OCA/l10n-romania</a> project on GitHub.</p> +<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date_wizard">OCA/l10n-romania</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> </div> </div> From 939642275b033e27d99d65b33298c9905d984554 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Fri, 29 Jul 2022 10:42:59 +0000 Subject: [PATCH 41/68] l10n_ro_stock_account_date_wizard 15.0.1.4.0 --- l10n_ro_stock_account_date_wizard/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date_wizard/__manifest__.py b/l10n_ro_stock_account_date_wizard/__manifest__.py index 34bd428f4..f51823033 100644 --- a/l10n_ro_stock_account_date_wizard/__manifest__.py +++ b/l10n_ro_stock_account_date_wizard/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date Wizard", - "version": "15.0.1.3.0", + "version": "15.0.1.4.0", "category": "Localization", "summary": "Romania - Stock Accounting Date Wizard", "author": "NextERP Romania," "Odoo Community Association (OCA)", From cb8251a904b8cbd91dedd909b23f3c6a92de2f08 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Wed, 12 Oct 2022 13:49:43 +0300 Subject: [PATCH 42/68] Isolate l10n_ro_stock_account --- .../tests/test_stock_accounting_date.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py index 9a3321280..8e9509787 100644 --- a/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py +++ b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py @@ -65,7 +65,7 @@ def test_transfer_backorder(self): acc_date = fields.Date.today() - timedelta(days=1) location_id = self.picking_type_transfer.default_location_src_id location_dest_id = self.picking_type_transfer.default_location_dest_id.copy( - {"property_stock_valuation_account_id": self.account_valuation.id} + {"l10n_ro_property_stock_valuation_account_id": self.account_valuation.id} ) _logger.info("Start transfer") picking = self.trasfer(location_id, location_dest_id) @@ -94,7 +94,7 @@ def test_transfer_cancel_backorder(self): acc_date = fields.Date.today() - timedelta(days=1) location_id = self.picking_type_transfer.default_location_src_id location_dest_id = self.picking_type_transfer.default_location_dest_id.copy( - {"property_stock_valuation_account_id": self.account_valuation.id} + {"l10n_ro_property_stock_valuation_account_id": self.account_valuation.id} ) _logger.info("Start transfer") picking = self.trasfer(location_id, location_dest_id) From 7d87e24c6034882f3e536b39c9bd1f1d6d6454ae Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Sat, 15 Oct 2022 08:48:37 +0300 Subject: [PATCH 43/68] 15.0 Isolate l10n_ro_stock_account_date and wizard --- .../__manifest__.py | 1 + .../tests/test_stock_accounting_date.py | 14 ++--- .../wizard/stock_backorder_confirmation.py | 61 ++++++++++--------- .../stock_backorder_confirmation_views.xml | 6 +- .../wizard/stock_immediate_transfer.py | 51 +++++++++------- .../wizard/stock_immediate_transfer_views.xml | 6 +- 6 files changed, 79 insertions(+), 60 deletions(-) diff --git a/l10n_ro_stock_account_date_wizard/__manifest__.py b/l10n_ro_stock_account_date_wizard/__manifest__.py index f51823033..8df755ada 100644 --- a/l10n_ro_stock_account_date_wizard/__manifest__.py +++ b/l10n_ro_stock_account_date_wizard/__manifest__.py @@ -14,5 +14,6 @@ "wizard/stock_immediate_transfer_views.xml", ], "installable": True, + "development_status": "Mature", "maintainers": ["feketemihai"], } diff --git a/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py index 8e9509787..c0c3ec8a3 100644 --- a/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py +++ b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py @@ -52,7 +52,7 @@ def trasfer(self, location, location_dest, product=None, accounting_date=False): } ) if accounting_date: - picking.accounting_date = accounting_date + picking.l10n_ro_accounting_date = accounting_date picking.action_confirm() picking.action_assign() for move_line in picking.move_lines: @@ -76,11 +76,11 @@ def test_transfer_backorder(self): **action_data.get("context", {}) ) ).save() - backorder_wizard.accounting_date = acc_date + backorder_wizard.l10n_ro_accounting_date = acc_date backorder_wizard.process() stock_move = picking.move_lines _logger.info("Tranfer efectuat") - self.assertEqual(picking.accounting_date.date(), acc_date) + self.assertEqual(picking.l10n_ro_accounting_date.date(), acc_date) self.assertEqual(stock_move.date.date(), acc_date) self.assertEqual(stock_move.move_line_ids.date.date(), acc_date) self.assertEqual( @@ -105,11 +105,11 @@ def test_transfer_cancel_backorder(self): **action_data.get("context", {}) ) ).save() - backorder_wizard.accounting_date = acc_date + backorder_wizard.l10n_ro_accounting_date = acc_date backorder_wizard.process_cancel_backorder() stock_move = picking.move_lines.filtered(lambda m: m.state == "done") _logger.info("Tranfer efectuat") - self.assertEqual(picking.accounting_date.date(), acc_date) + self.assertEqual(picking.l10n_ro_accounting_date.date(), acc_date) self.assertEqual(stock_move.date.date(), acc_date) self.assertEqual(stock_move.move_line_ids.date.date(), acc_date) self.assertEqual( @@ -138,12 +138,12 @@ def test_receipt(self): wiz = Form( self.env["stock.immediate.transfer"].with_context(**wiz["context"]) ).save() - wiz.accounting_date = acc_date + wiz.l10n_ro_accounting_date = acc_date wiz.process() stock_move = picking.move_lines _logger.info("Tranfer efectuat") - self.assertEqual(picking.accounting_date.date(), acc_date) + self.assertEqual(picking.l10n_ro_accounting_date.date(), acc_date) self.assertEqual(stock_move.date.date(), acc_date) self.assertEqual(stock_move.move_line_ids.date.date(), acc_date) self.assertEqual( diff --git a/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py index 23b2af099..eab03755a 100644 --- a/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py +++ b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py @@ -6,9 +6,10 @@ class StockBackorderConfirmation(models.TransientModel): - _inherit = "stock.backorder.confirmation" + _name = "stock.backorder.confirmation" + _inherit = ["stock.backorder.confirmation", "l10n.ro.mixin"] - accounting_date = fields.Datetime( + l10n_ro_accounting_date = fields.Datetime( help="If this field is set, the svl and accounting entiries will " "have this date, If not will have the today date as it should be", default=fields.Datetime.now(), @@ -17,22 +18,24 @@ class StockBackorderConfirmation(models.TransientModel): @api.model def default_get(self, fields): res = super().default_get(fields) - if res.get("pick_ids"): - if ( - self.env["stock.picking"] - .browse(res["pick_ids"][0][2][0]) - .accounting_date - ): - res["accounting_date"] = ( + if self.env["res.company"]._check_is_l10n_ro_record(self.env.company.id): + res["is_l10n_ro_record"] = True + if res.get("pick_ids"): + if ( self.env["stock.picking"] .browse(res["pick_ids"][0][2][0]) - .accounting_date - ) + .l10n_ro_accounting_date + ): + res["l10n_ro_accounting_date"] = ( + self.env["stock.picking"] + .browse(res["pick_ids"][0][2][0]) + .l10n_ro_accounting_date + ) return res def process(self): - if self.accounting_date: - if self.accounting_date.date() > fields.date.today(): + if self.is_l10n_ro_record: + if self.l10n_ro_accounting_date.date() > fields.date.today(): raise ValidationError( _( "You can not have a Accounting date=%s for picking bigger than today!" @@ -41,26 +44,28 @@ def process(self): ) self.pick_ids.write( { - "accounting_date": self.accounting_date, - "date_done": self.accounting_date, + "l10n_ro_accounting_date": self.l10n_ro_accounting_date, + "date_done": self.l10n_ro_accounting_date, } ) return super().process() def process_cancel_backorder(self): - pickings_to_validate = self.env.context.get("button_validate_picking_ids") - if pickings_to_validate and self.accounting_date: - if self.accounting_date.date() > fields.date.today(): - raise ValidationError( - _( - "You can not have a Accounting date=%s for picking bigger than today!" + if self.is_l10n_ro_record: + pickings_to_validate = self.env.context.get("button_validate_picking_ids") + if pickings_to_validate and self.l10n_ro_accounting_date: + if self.l10n_ro_accounting_date.date() > fields.date.today(): + raise ValidationError( + _( + "You can not have a Accounting date=%s for " + "picking bigger than today!" + ) + % self.accounting_date.date() ) - % self.accounting_date.date() + self.env["stock.picking"].browse(pickings_to_validate).write( + { + "accounting_date": self.accounting_date, + "date_done": self.accounting_date, + } ) - self.env["stock.picking"].browse(pickings_to_validate).write( - { - "accounting_date": self.accounting_date, - "date_done": self.accounting_date, - } - ) return super().process_cancel_backorder() diff --git a/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation_views.xml b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation_views.xml index 0c6a54187..971c779f2 100644 --- a/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation_views.xml +++ b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation_views.xml @@ -6,7 +6,11 @@ <field name="arch" type="xml"> <xpath expr="//footer" position="before"> <group> - <field name="accounting_date" /> + <field name="is_l10n_ro_record" invisible="1" /> + <field + name="l10n_ro_accounting_date" + attrs="{'invisible': [('is_l10n_ro_record', '=', False)]}" + /> </group> </xpath> </field> diff --git a/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py b/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py index 90ab89029..f25bdb1d0 100644 --- a/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py +++ b/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py @@ -6,9 +6,10 @@ class StockImmediateTransfer(models.TransientModel): - _inherit = "stock.immediate.transfer" + _name = "stock.immediate.transfer" + _inherit = ["stock.immediate.transfer", "l10n.ro.mixin"] - accounting_date = fields.Datetime( + l10n_ro_accounting_date = fields.Datetime( help="If this field is set, the svl and accounting entiries will " "have this date, If not will have the today date as it should be", default=fields.Datetime.now(), @@ -17,32 +18,36 @@ class StockImmediateTransfer(models.TransientModel): @api.model def default_get(self, fields): res = super().default_get(fields) - if res.get("pick_ids"): - if ( - self.env["stock.picking"] - .browse(res["pick_ids"][0][2][0]) - .accounting_date - ): - res["accounting_date"] = ( + if self.env["res.company"]._check_is_l10n_ro_record(self.env.company.id): + res["is_l10n_ro_record"] = True + if res.get("pick_ids"): + if ( self.env["stock.picking"] .browse(res["pick_ids"][0][2][0]) - .accounting_date - ) + .l10n_ro_accounting_date + ): + res["l10n_ro_accounting_date"] = ( + self.env["stock.picking"] + .browse(res["pick_ids"][0][2][0]) + .l10n_ro_accounting_date + ) return res def process(self): - if self.accounting_date: - if self.accounting_date.date() > fields.date.today(): - raise ValidationError( - _( - "You can not have a Accounting date=%s for picking bigger than today!" + if self.is_l10n_ro_record: + if self.l10n_ro_accounting_date: + if self.l10n_ro_accounting_date.date() > fields.date.today(): + raise ValidationError( + _( + "You can not have a Accounting date=%s " + "for picking bigger than today!" + ) + % self.accounting_date.date() ) - % self.accounting_date.date() + self.pick_ids.write( + { + "l10n_ro_accounting_date": self.l10n_ro_accounting_date, + "date_done": self.l10n_ro_accounting_date, + } ) - self.pick_ids.write( - { - "accounting_date": self.accounting_date, - "date_done": self.accounting_date, - } - ) return super().process() diff --git a/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer_views.xml b/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer_views.xml index 8c3fbeae3..4f39f9134 100644 --- a/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer_views.xml +++ b/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer_views.xml @@ -7,7 +7,11 @@ <xpath expr="//footer" position="before"> <group> <group> - <field name="accounting_date" /> + <field name="is_l10n_ro_record" invisible="1" /> + <field + name="l10n_ro_accounting_date" + attrs="{'invisible': [('is_l10n_ro_record', '=', False)]}" + /> </group> </group> </xpath> From cc1cd20d015eebdd24479ef850add51571467394 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Sat, 15 Oct 2022 09:28:23 +0300 Subject: [PATCH 44/68] 15.0 Isolate l10n_ro_stock_account_date and wizard --- .../wizard/stock_backorder_confirmation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py index eab03755a..bc7f19c00 100644 --- a/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py +++ b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py @@ -40,7 +40,7 @@ def process(self): _( "You can not have a Accounting date=%s for picking bigger than today!" ) - % self.accounting_date.date() + % self.l10n_ro_accounting_date.date() ) self.pick_ids.write( { @@ -60,12 +60,12 @@ def process_cancel_backorder(self): "You can not have a Accounting date=%s for " "picking bigger than today!" ) - % self.accounting_date.date() + % self.l10n_ro_accounting_date.date() ) self.env["stock.picking"].browse(pickings_to_validate).write( { - "accounting_date": self.accounting_date, - "date_done": self.accounting_date, + "accounting_date": self.l10n_ro_accounting_date, + "date_done": self.l10n_ro_accounting_date, } ) return super().process_cancel_backorder() From 433f3b8edbe0bd79333360d4a405db2a3eead3dd Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Sat, 29 Oct 2022 14:58:15 +0000 Subject: [PATCH 45/68] l10n_ro_stock_account_date_wizard 15.0.2.0.0 --- l10n_ro_stock_account_date_wizard/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date_wizard/__manifest__.py b/l10n_ro_stock_account_date_wizard/__manifest__.py index 8df755ada..c4e903ac9 100644 --- a/l10n_ro_stock_account_date_wizard/__manifest__.py +++ b/l10n_ro_stock_account_date_wizard/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date Wizard", - "version": "15.0.1.4.0", + "version": "15.0.2.0.0", "category": "Localization", "summary": "Romania - Stock Accounting Date Wizard", "author": "NextERP Romania," "Odoo Community Association (OCA)", From e235d7df4d20e19cc12ff804d7c2ed399ef4d7ef Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Sat, 29 Oct 2022 19:15:35 +0300 Subject: [PATCH 46/68] Update stock account date izolation --- .../wizard/stock_backorder_confirmation.py | 2 +- .../wizard/stock_immediate_transfer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py index bc7f19c00..c42b23c2e 100644 --- a/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py +++ b/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py @@ -64,7 +64,7 @@ def process_cancel_backorder(self): ) self.env["stock.picking"].browse(pickings_to_validate).write( { - "accounting_date": self.l10n_ro_accounting_date, + "l10n_ro_accounting_date": self.l10n_ro_accounting_date, "date_done": self.l10n_ro_accounting_date, } ) diff --git a/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py b/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py index f25bdb1d0..12e5ebdb5 100644 --- a/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py +++ b/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py @@ -42,7 +42,7 @@ def process(self): "You can not have a Accounting date=%s " "for picking bigger than today!" ) - % self.accounting_date.date() + % self.l10n_ro_accounting_date.date() ) self.pick_ids.write( { From 95ce2c09065d4e8e0d2a95711ff1c09ff5d31a34 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Sat, 29 Oct 2022 19:31:38 +0300 Subject: [PATCH 47/68] Update stock account date izolation --- .../tests/test_stock_accounting_date.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py index c0c3ec8a3..b30bc1587 100644 --- a/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py +++ b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py @@ -25,7 +25,7 @@ def set_stock(self, product, qty): ) inventory._apply_inventory() - def trasfer(self, location, location_dest, product=None, accounting_date=False): + def transfer(self, location, location_dest, product=None, accounting_date=False): self.PickingObj = self.env["stock.picking"] self.MoveObj = self.env["stock.move"] self.MoveObj = self.env["stock.move"] @@ -68,7 +68,7 @@ def test_transfer_backorder(self): {"l10n_ro_property_stock_valuation_account_id": self.account_valuation.id} ) _logger.info("Start transfer") - picking = self.trasfer(location_id, location_dest_id) + picking = self.transfer(location_id, location_dest_id) picking.move_lines[0].move_line_ids[0].qty_done = 2 action_data = picking.button_validate() backorder_wizard = Form( @@ -97,7 +97,7 @@ def test_transfer_cancel_backorder(self): {"l10n_ro_property_stock_valuation_account_id": self.account_valuation.id} ) _logger.info("Start transfer") - picking = self.trasfer(location_id, location_dest_id) + picking = self.transfer(location_id, location_dest_id) picking.move_lines[0].move_line_ids[0].qty_done = 2 action_data = picking.button_validate() backorder_wizard = Form( From 2d9758d65a8080ff683271cfb199bde4dad9483b Mon Sep 17 00:00:00 2001 From: oca-ci <oca-ci@odoo-community.org> Date: Sat, 29 Oct 2022 17:14:03 +0000 Subject: [PATCH 48/68] [UPD] Update l10n_ro_stock_account_date_wizard.pot --- .../l10n_ro_stock_account_date_wizard.pot | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/l10n_ro_stock_account_date_wizard/i18n/l10n_ro_stock_account_date_wizard.pot b/l10n_ro_stock_account_date_wizard/i18n/l10n_ro_stock_account_date_wizard.pot index 2efd962b9..d35952f71 100644 --- a/l10n_ro_stock_account_date_wizard/i18n/l10n_ro_stock_account_date_wizard.pot +++ b/l10n_ro_stock_account_date_wizard/i18n/l10n_ro_stock_account_date_wizard.pot @@ -13,20 +13,14 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: l10n_ro_stock_account_date_wizard -#: model:ir.model.fields,field_description:l10n_ro_stock_account_date_wizard.field_stock_backorder_confirmation__accounting_date -#: model:ir.model.fields,field_description:l10n_ro_stock_account_date_wizard.field_stock_immediate_transfer__accounting_date -msgid "Accounting Date" -msgstr "" - #. module: l10n_ro_stock_account_date_wizard #: model:ir.model,name:l10n_ro_stock_account_date_wizard.model_stock_backorder_confirmation msgid "Backorder Confirmation" msgstr "" #. module: l10n_ro_stock_account_date_wizard -#: model:ir.model.fields,help:l10n_ro_stock_account_date_wizard.field_stock_backorder_confirmation__accounting_date -#: model:ir.model.fields,help:l10n_ro_stock_account_date_wizard.field_stock_immediate_transfer__accounting_date +#: model:ir.model.fields,help:l10n_ro_stock_account_date_wizard.field_stock_backorder_confirmation__l10n_ro_accounting_date +#: model:ir.model.fields,help:l10n_ro_stock_account_date_wizard.field_stock_immediate_transfer__l10n_ro_accounting_date msgid "" "If this field is set, the svl and accounting entiries will have this date, " "If not will have the today date as it should be" @@ -37,6 +31,18 @@ msgstr "" msgid "Immediate Transfer" msgstr "" +#. module: l10n_ro_stock_account_date_wizard +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date_wizard.field_stock_backorder_confirmation__is_l10n_ro_record +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date_wizard.field_stock_immediate_transfer__is_l10n_ro_record +msgid "Is Romanian Record" +msgstr "" + +#. module: l10n_ro_stock_account_date_wizard +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date_wizard.field_stock_backorder_confirmation__l10n_ro_accounting_date +#: model:ir.model.fields,field_description:l10n_ro_stock_account_date_wizard.field_stock_immediate_transfer__l10n_ro_accounting_date +msgid "L10N Ro Accounting Date" +msgstr "" + #. module: l10n_ro_stock_account_date_wizard #: code:addons/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py:0 #: code:addons/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py:0 From c093df926498f1eabe4a1b4117cb138ea595ed05 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Sat, 29 Oct 2022 17:25:52 +0000 Subject: [PATCH 49/68] [UPD] README.rst --- l10n_ro_stock_account_date_wizard/README.rst | 4 ++-- .../static/description/index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_ro_stock_account_date_wizard/README.rst b/l10n_ro_stock_account_date_wizard/README.rst index 81169b4ac..09e913712 100644 --- a/l10n_ro_stock_account_date_wizard/README.rst +++ b/l10n_ro_stock_account_date_wizard/README.rst @@ -7,9 +7,9 @@ Romania - Stock Accounting Date Wizard !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png +.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png :target: https://odoo-community.org/page/development-status - :alt: Beta + :alt: Mature .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 diff --git a/l10n_ro_stock_account_date_wizard/static/description/index.html b/l10n_ro_stock_account_date_wizard/static/description/index.html index fd21084d1..de3e4748f 100644 --- a/l10n_ro_stock_account_date_wizard/static/description/index.html +++ b/l10n_ro_stock_account_date_wizard/static/description/index.html @@ -367,7 +367,7 @@ <h1 class="title">Romania - Stock Accounting Date Wizard</h1> !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date_wizard"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date_wizard"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> +<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date_wizard"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date_wizard"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>This module allows you to select “Accounting Date” for stock operations in the Stock Confirmation Wizards.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> From 20fab27e46e55bfba7604d5dc2a660e0bc903e8d Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Sat, 29 Oct 2022 17:25:53 +0000 Subject: [PATCH 50/68] l10n_ro_stock_account_date_wizard 15.0.3.0.0 --- l10n_ro_stock_account_date_wizard/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date_wizard/__manifest__.py b/l10n_ro_stock_account_date_wizard/__manifest__.py index c4e903ac9..9ce5399d1 100644 --- a/l10n_ro_stock_account_date_wizard/__manifest__.py +++ b/l10n_ro_stock_account_date_wizard/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date Wizard", - "version": "15.0.2.0.0", + "version": "15.0.3.0.0", "category": "Localization", "summary": "Romania - Stock Accounting Date Wizard", "author": "NextERP Romania," "Odoo Community Association (OCA)", From 47a7a6d60e33f1cc533f24bd450a77fb11d2203c Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Thu, 11 May 2023 09:03:45 +0300 Subject: [PATCH 51/68] [IMP] l10n_ro_stock_account_date_wizard: pre-commit stuff --- .../odoo/addons/l10n_ro_stock_account_date_wizard | 1 + setup/l10n_ro_stock_account_date_wizard/setup.py | 6 ++++++ 2 files changed, 7 insertions(+) create mode 120000 setup/l10n_ro_stock_account_date_wizard/odoo/addons/l10n_ro_stock_account_date_wizard create mode 100644 setup/l10n_ro_stock_account_date_wizard/setup.py diff --git a/setup/l10n_ro_stock_account_date_wizard/odoo/addons/l10n_ro_stock_account_date_wizard b/setup/l10n_ro_stock_account_date_wizard/odoo/addons/l10n_ro_stock_account_date_wizard new file mode 120000 index 000000000..034940542 --- /dev/null +++ b/setup/l10n_ro_stock_account_date_wizard/odoo/addons/l10n_ro_stock_account_date_wizard @@ -0,0 +1 @@ +../../../../l10n_ro_stock_account_date_wizard \ No newline at end of file diff --git a/setup/l10n_ro_stock_account_date_wizard/setup.py b/setup/l10n_ro_stock_account_date_wizard/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/l10n_ro_stock_account_date_wizard/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) From 78c53d20c805b123a1b7848fb51b69232b627d09 Mon Sep 17 00:00:00 2001 From: Mihai Fekete <feketemihai@nexterp.ro> Date: Thu, 11 May 2023 09:06:01 +0300 Subject: [PATCH 52/68] [MIG] l10n_ro_stock_account_date_wizard: Migration to 16.0 --- l10n_ro_stock_account_date_wizard/__manifest__.py | 2 +- l10n_ro_stock_account_date_wizard/readme/INSTALL.rst | 2 +- .../tests/test_stock_accounting_date.py | 12 ++++++------ test-requirements.txt | 3 +++ 4 files changed, 11 insertions(+), 8 deletions(-) create mode 100644 test-requirements.txt diff --git a/l10n_ro_stock_account_date_wizard/__manifest__.py b/l10n_ro_stock_account_date_wizard/__manifest__.py index 9ce5399d1..df4fafe9a 100644 --- a/l10n_ro_stock_account_date_wizard/__manifest__.py +++ b/l10n_ro_stock_account_date_wizard/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date Wizard", - "version": "15.0.3.0.0", + "version": "16.0.1.0.0", "category": "Localization", "summary": "Romania - Stock Accounting Date Wizard", "author": "NextERP Romania," "Odoo Community Association (OCA)", diff --git a/l10n_ro_stock_account_date_wizard/readme/INSTALL.rst b/l10n_ro_stock_account_date_wizard/readme/INSTALL.rst index 90586fa34..35475572f 100644 --- a/l10n_ro_stock_account_date_wizard/readme/INSTALL.rst +++ b/l10n_ro_stock_account_date_wizard/readme/INSTALL.rst @@ -1,6 +1,6 @@ To install this module, you need to: -* clone the branch 14.0 of the repository https://github.com/OCA/l10n-romania +* clone the branch 16.0 of the repository https://github.com/OCA/l10n-romania * add the path to this repository in your configuration (addons-path) * update the module list * search for "Romania - Stock Account Date Wizard" in your addons diff --git a/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py index b30bc1587..e227441e9 100644 --- a/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py +++ b/l10n_ro_stock_account_date_wizard/tests/test_stock_accounting_date.py @@ -55,7 +55,7 @@ def transfer(self, location, location_dest, product=None, accounting_date=False) picking.l10n_ro_accounting_date = accounting_date picking.action_confirm() picking.action_assign() - for move_line in picking.move_lines: + for move_line in picking.move_ids: if move_line.product_uom_qty > 0 and move_line.quantity_done == 0: move_line.write({"quantity_done": move_line.product_uom_qty}) return picking @@ -69,7 +69,7 @@ def test_transfer_backorder(self): ) _logger.info("Start transfer") picking = self.transfer(location_id, location_dest_id) - picking.move_lines[0].move_line_ids[0].qty_done = 2 + picking.move_ids[0].move_line_ids[0].qty_done = 2 action_data = picking.button_validate() backorder_wizard = Form( self.env["stock.backorder.confirmation"].with_context( @@ -78,7 +78,7 @@ def test_transfer_backorder(self): ).save() backorder_wizard.l10n_ro_accounting_date = acc_date backorder_wizard.process() - stock_move = picking.move_lines + stock_move = picking.move_ids _logger.info("Tranfer efectuat") self.assertEqual(picking.l10n_ro_accounting_date.date(), acc_date) self.assertEqual(stock_move.date.date(), acc_date) @@ -98,7 +98,7 @@ def test_transfer_cancel_backorder(self): ) _logger.info("Start transfer") picking = self.transfer(location_id, location_dest_id) - picking.move_lines[0].move_line_ids[0].qty_done = 2 + picking.move_ids[0].move_line_ids[0].qty_done = 2 action_data = picking.button_validate() backorder_wizard = Form( self.env["stock.backorder.confirmation"].with_context( @@ -107,7 +107,7 @@ def test_transfer_cancel_backorder(self): ).save() backorder_wizard.l10n_ro_accounting_date = acc_date backorder_wizard.process_cancel_backorder() - stock_move = picking.move_lines.filtered(lambda m: m.state == "done") + stock_move = picking.move_ids.filtered(lambda m: m.state == "done") _logger.info("Tranfer efectuat") self.assertEqual(picking.l10n_ro_accounting_date.date(), acc_date) self.assertEqual(stock_move.date.date(), acc_date) @@ -141,7 +141,7 @@ def test_receipt(self): wiz.l10n_ro_accounting_date = acc_date wiz.process() - stock_move = picking.move_lines + stock_move = picking.move_ids _logger.info("Tranfer efectuat") self.assertEqual(picking.l10n_ro_accounting_date.date(), acc_date) self.assertEqual(stock_move.date.date(), acc_date) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000..abbe4b4cf --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,3 @@ +odoo-addon-l10n_ro_stock @ git+https://github.com/OCA/l10n-romania@refs/pull/522/head#subdirectory=setup/l10n_ro_stock +odoo-addon-l10n_ro_stock_account @ git+https://github.com/OCA/l10n-romania@refs/pull/523/head#subdirectory=setup/l10n_ro_stock_account +odoo-addon-l10n_ro_stock_account_date @ git+https://github.com/OCA/l10n-romania@refs/pull/525/head#subdirectory=setup/l10n_ro_stock_account_date From bbe0d386884698b99288a64b5de9d8596ba0a2cd Mon Sep 17 00:00:00 2001 From: Fekete Mihai <feketemihai@nexterp.ro> Date: Tue, 30 May 2023 10:55:54 +0300 Subject: [PATCH 53/68] Delete test-requirements.txt --- test-requirements.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 test-requirements.txt diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index 057ee2b31..000000000 --- a/test-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -odoo-addon-l10n_ro_stock @ git+https://github.com/OCA/l10n-romania@refs/pull/522/head#subdirectory=setup/l10n_ro_stock -odoo-addon-l10n_ro_stock_account @ git+https://github.com/OCA/l10n-romania@refs/pull/523/head#subdirectory=setup/l10n_ro_stock_account From 623fa8b02381996bbfb9e3e4ab9ced2daccdf5d9 Mon Sep 17 00:00:00 2001 From: oca-ci <oca-ci@odoo-community.org> Date: Tue, 30 May 2023 08:36:52 +0000 Subject: [PATCH 54/68] [UPD] Update l10n_ro_stock_account_date.pot --- l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot b/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot index adc14dbd5..6ff8c8244 100644 --- a/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot +++ b/l10n_ro_stock_account_date/i18n/l10n_ro_stock_account_date.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 15.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -91,6 +91,7 @@ msgid "Transfer" msgstr "" #. module: l10n_ro_stock_account_date +#. odoo-python #: code:addons/l10n_ro_stock_account_date/models/stock_picking.py:0 #, python-format msgid "You can not have a Accounting date=%s for picking bigger than today!" From c68768e99518596fa93abd5b78e91a11621c600d Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 30 May 2023 08:49:02 +0000 Subject: [PATCH 55/68] [UPD] addons table in README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 32575aaf4..e3dae5ebf 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ addon | version | maintainers | summary [l10n_ro_partner_unique](l10n_ro_partner_unique/) | 16.0.1.1.0 | [](https://github.com/feketemihai) | Creates a rule for vat and nrc unique for partners. [l10n_ro_stock](l10n_ro_stock/) | 16.0.0.1.0 | [](https://github.com/feketemihai) | Romania - Stock [l10n_ro_stock_account](l10n_ro_stock_account/) | 16.0.1.1.0 | [](https://github.com/dhongu) [](https://github.com/feketemihai) | Romania - Stock Accounting +[l10n_ro_stock_account_date](l10n_ro_stock_account_date/) | 16.0.1.0.0 | [](https://github.com/feketemihai) | Romania - Stock Accounting Date [l10n_ro_vat_on_payment](l10n_ro_vat_on_payment/) | 16.0.1.1.0 | [](https://github.com/feketemihai) | Romania - VAT on Payment [//]: # (end addons) From 0de2311fbbbf65c64daf40f689dcafda37d5d865 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 30 May 2023 08:49:04 +0000 Subject: [PATCH 56/68] [UPD] README.rst --- l10n_ro_stock_account_date/README.rst | 12 ++++++------ .../static/description/index.html | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/l10n_ro_stock_account_date/README.rst b/l10n_ro_stock_account_date/README.rst index 5915b5d2f..4789817ba 100644 --- a/l10n_ro_stock_account_date/README.rst +++ b/l10n_ro_stock_account_date/README.rst @@ -14,13 +14,13 @@ Romania - Stock Accounting Date :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github - :target: https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date + :target: https://github.com/OCA/l10n-romania/tree/16.0/l10n_ro_stock_account_date :alt: OCA/l10n-romania .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date + :target: https://translation.odoo-community.org/projects/l10n-romania-16-0/l10n-romania-16-0-l10n_ro_stock_account_date :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/177/15.0 + :target: https://runbot.odoo-community.org/runbot/177/16.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -37,7 +37,7 @@ Installation To install this module, you need to: -* clone the branch 14.0 of the repository https://github.com/OCA/l10n-romania +* clone the branch 16.0 of the repository https://github.com/OCA/l10n-romania * add the path to this repository in your configuration (addons-path) * update the module list * search for "Romania - Stock Account Date" in your addons @@ -49,7 +49,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-romania/issues>`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. +`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. Do not contact contributors directly about support or help with technical issues. @@ -93,6 +93,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: |maintainer-feketemihai| -This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date>`_ project on GitHub. +This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/16.0/l10n_ro_stock_account_date>`_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_ro_stock_account_date/static/description/index.html b/l10n_ro_stock_account_date/static/description/index.html index 8cf6b339c..1cf9739ae 100644 --- a/l10n_ro_stock_account_date/static/description/index.html +++ b/l10n_ro_stock_account_date/static/description/index.html @@ -367,7 +367,7 @@ <h1 class="title">Romania - Stock Accounting Date</h1> !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> +<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/16.0/l10n_ro_stock_account_date"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-16-0/l10n-romania-16-0-l10n_ro_stock_account_date"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/16.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>This module allows you to select “Accounting Date” for stock operations.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> @@ -386,7 +386,7 @@ <h1 class="title">Romania - Stock Accounting Date</h1> <h1><a class="toc-backref" href="#id1">Installation</a></h1> <p>To install this module, you need to:</p> <ul class="simple"> -<li>clone the branch 14.0 of the repository <a class="reference external" href="https://github.com/OCA/l10n-romania">https://github.com/OCA/l10n-romania</a></li> +<li>clone the branch 16.0 of the repository <a class="reference external" href="https://github.com/OCA/l10n-romania">https://github.com/OCA/l10n-romania</a></li> <li>add the path to this repository in your configuration (addons-path)</li> <li>update the module list</li> <li>search for “Romania - Stock Account Date” in your addons</li> @@ -398,7 +398,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-romania/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> +<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> </div> <div class="section" id="credits"> @@ -430,7 +430,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2> promote its widespread use.</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> <p><a class="reference external" href="https://github.com/feketemihai"><img alt="feketemihai" src="https://github.com/feketemihai.png?size=40px" /></a></p> -<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date">OCA/l10n-romania</a> project on GitHub.</p> +<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/16.0/l10n_ro_stock_account_date">OCA/l10n-romania</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> </div> </div> From e32c464cc24f4be335ee2b1b747df3a4552982b9 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 30 May 2023 08:49:05 +0000 Subject: [PATCH 57/68] [ADD] setup.py --- setup/_metapackage/VERSION.txt | 2 +- setup/_metapackage/setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/_metapackage/VERSION.txt b/setup/_metapackage/VERSION.txt index 126ff1751..3b3983f8f 100644 --- a/setup/_metapackage/VERSION.txt +++ b/setup/_metapackage/VERSION.txt @@ -1 +1 @@ -16.0.20230530.0 \ No newline at end of file +16.0.20230530.1 \ No newline at end of file diff --git a/setup/_metapackage/setup.py b/setup/_metapackage/setup.py index cd48fcab0..07612c4ef 100644 --- a/setup/_metapackage/setup.py +++ b/setup/_metapackage/setup.py @@ -18,6 +18,7 @@ 'odoo-addon-l10n_ro_partner_unique>=16.0dev,<16.1dev', 'odoo-addon-l10n_ro_stock>=16.0dev,<16.1dev', 'odoo-addon-l10n_ro_stock_account>=16.0dev,<16.1dev', + 'odoo-addon-l10n_ro_stock_account_date>=16.0dev,<16.1dev', 'odoo-addon-l10n_ro_vat_on_payment>=16.0dev,<16.1dev', ], classifiers=[ From df2e449143f8fdaaef7854ef68c3f50ee02eabf4 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 30 May 2023 08:49:05 +0000 Subject: [PATCH 58/68] l10n_ro_stock_account_date 16.0.1.1.0 --- l10n_ro_stock_account_date/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date/__manifest__.py b/l10n_ro_stock_account_date/__manifest__.py index cc8ff7a6d..bd32a6181 100644 --- a/l10n_ro_stock_account_date/__manifest__.py +++ b/l10n_ro_stock_account_date/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date", - "version": "16.0.1.0.0", + "version": "16.0.1.1.0", "category": "Localization", "summary": "Romania - Stock Accounting Date", "author": "NextERP Romania," "Odoo Community Association (OCA)", From bb12396cdcbae3534a2df70317a3c499b79df528 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 30 May 2023 08:49:10 +0000 Subject: [PATCH 59/68] [UPD] addons table in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e3dae5ebf..e3c655b3e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ addon | version | maintainers | summary [l10n_ro_partner_unique](l10n_ro_partner_unique/) | 16.0.1.1.0 | [](https://github.com/feketemihai) | Creates a rule for vat and nrc unique for partners. [l10n_ro_stock](l10n_ro_stock/) | 16.0.0.1.0 | [](https://github.com/feketemihai) | Romania - Stock [l10n_ro_stock_account](l10n_ro_stock_account/) | 16.0.1.1.0 | [](https://github.com/dhongu) [](https://github.com/feketemihai) | Romania - Stock Accounting -[l10n_ro_stock_account_date](l10n_ro_stock_account_date/) | 16.0.1.0.0 | [](https://github.com/feketemihai) | Romania - Stock Accounting Date +[l10n_ro_stock_account_date](l10n_ro_stock_account_date/) | 16.0.1.1.0 | [](https://github.com/feketemihai) | Romania - Stock Accounting Date [l10n_ro_vat_on_payment](l10n_ro_vat_on_payment/) | 16.0.1.1.0 | [](https://github.com/feketemihai) | Romania - VAT on Payment [//]: # (end addons) From fab1ec8c7e83f5dcf1b5c1eaea5b083393ef0d7a Mon Sep 17 00:00:00 2001 From: Fekete Mihai <feketemihai@nexterp.ro> Date: Tue, 30 May 2023 11:56:24 +0300 Subject: [PATCH 60/68] Delete test-requirements.txt --- test-requirements.txt | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 test-requirements.txt diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index abbe4b4cf..000000000 --- a/test-requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -odoo-addon-l10n_ro_stock @ git+https://github.com/OCA/l10n-romania@refs/pull/522/head#subdirectory=setup/l10n_ro_stock -odoo-addon-l10n_ro_stock_account @ git+https://github.com/OCA/l10n-romania@refs/pull/523/head#subdirectory=setup/l10n_ro_stock_account -odoo-addon-l10n_ro_stock_account_date @ git+https://github.com/OCA/l10n-romania@refs/pull/525/head#subdirectory=setup/l10n_ro_stock_account_date From 0d3a73c9a8f63e1e6196e8608bcdb7e69e95b42f Mon Sep 17 00:00:00 2001 From: Weblate <noreply@weblate.org> Date: Tue, 30 May 2023 11:11:50 +0000 Subject: [PATCH 61/68] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-romania-16.0/l10n-romania-16.0-l10n_ro_stock_account_date Translate-URL: https://translation.odoo-community.org/projects/l10n-romania-16-0/l10n-romania-16-0-l10n_ro_stock_account_date/ --- l10n_ro_stock_account_date/i18n/ro.po | 1 + 1 file changed, 1 insertion(+) diff --git a/l10n_ro_stock_account_date/i18n/ro.po b/l10n_ro_stock_account_date/i18n/ro.po index 1b2d4cdeb..3689a59e0 100644 --- a/l10n_ro_stock_account_date/i18n/ro.po +++ b/l10n_ro_stock_account_date/i18n/ro.po @@ -95,6 +95,7 @@ msgid "Transfer" msgstr "" #. module: l10n_ro_stock_account_date +#. odoo-python #: code:addons/l10n_ro_stock_account_date/models/stock_picking.py:0 #, python-format msgid "You can not have a Accounting date=%s for picking bigger than today!" From 63af78bbb425a43a967c4ad1d58d44e34b1e525f Mon Sep 17 00:00:00 2001 From: Weblate <noreply@weblate.org> Date: Tue, 30 May 2023 11:11:54 +0000 Subject: [PATCH 62/68] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-romania-16.0/l10n-romania-16.0-l10n_ro_stock_account Translate-URL: https://translation.odoo-community.org/projects/l10n-romania-16-0/l10n-romania-16-0-l10n_ro_stock_account/ --- l10n_ro_stock_account/i18n/ro.po | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/l10n_ro_stock_account/i18n/ro.po b/l10n_ro_stock_account/i18n/ro.po index a67fa6ab5..17793590c 100644 --- a/l10n_ro_stock_account/i18n/ro.po +++ b/l10n_ro_stock_account/i18n/ro.po @@ -17,6 +17,7 @@ msgstr "" "Plural-Forms: \n" #. module: l10n_ro_stock_account +#. odoo-python #: code:addons/l10n_ro_stock_account/models/stock_landed_cost.py:0 #, python-format msgid " already out" @@ -43,6 +44,7 @@ msgid "Companies" msgstr "Companii" #. module: l10n_ro_stock_account +#. odoo-python #: code:addons/l10n_ro_stock_account/models/stock_landed_cost.py:0 #, python-format msgid "" @@ -71,6 +73,7 @@ msgid "Display Name" msgstr "Nume afișat" #. module: l10n_ro_stock_account +#. odoo-python #: code:addons/l10n_ro_stock_account/models/product_category.py:0 #, python-format msgid "" @@ -194,13 +197,14 @@ msgid "" msgstr "" #. module: l10n_ro_stock_account +#. odoo-python #: code:addons/l10n_ro_stock_account/models/stock_landed_cost.py:0 #, python-format msgid "Please configure Stock Expense Account for product: %s." msgstr "" #. module: l10n_ro_stock_account -#: model:ir.model,name:l10n_ro_stock_account.model_product_product +#: model:ir.model,name:l10n_ro_stock_account.model_product_template msgid "Product" msgstr "" @@ -215,9 +219,9 @@ msgid "Product Moves (Stock Move Line)" msgstr "" #. module: l10n_ro_stock_account -#: model:ir.model,name:l10n_ro_stock_account.model_product_template -msgid "Product Template" -msgstr "Șablon produs" +#: model:ir.model,name:l10n_ro_stock_account.model_product_product +msgid "Product Variant" +msgstr "" #. module: l10n_ro_stock_account #: model:ir.model.fields,field_description:l10n_ro_stock_account.field_l10n_ro_stock_valuation_layer_tracking__quantity @@ -425,12 +429,16 @@ msgid "Wizard model to reavaluate a stock inventory for a product" msgstr "" #. module: l10n_ro_stock_account +#. odoo-python #: code:addons/l10n_ro_stock_account/models/stock_move_line.py:0 #, python-format msgid "" "You cannot decrease the quantity of a move line. Please create a return." msgstr "" +#~ msgid "Product Template" +#~ msgstr "Șablon produs" + #, python-format #~ msgid "" #~ "For Romanian Stock Accounting the stock_input, stock_output and " From b872aec3ece331b5a926b4c4abfcf7c95e95308f Mon Sep 17 00:00:00 2001 From: oca-ci <oca-ci@odoo-community.org> Date: Tue, 30 May 2023 16:38:17 +0000 Subject: [PATCH 63/68] [UPD] Update l10n_ro_stock_account_date_wizard.pot --- .../i18n/l10n_ro_stock_account_date_wizard.pot | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date_wizard/i18n/l10n_ro_stock_account_date_wizard.pot b/l10n_ro_stock_account_date_wizard/i18n/l10n_ro_stock_account_date_wizard.pot index d35952f71..6abd1e75e 100644 --- a/l10n_ro_stock_account_date_wizard/i18n/l10n_ro_stock_account_date_wizard.pot +++ b/l10n_ro_stock_account_date_wizard/i18n/l10n_ro_stock_account_date_wizard.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 15.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -44,6 +44,7 @@ msgid "L10N Ro Accounting Date" msgstr "" #. module: l10n_ro_stock_account_date_wizard +#. odoo-python #: code:addons/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py:0 #: code:addons/l10n_ro_stock_account_date_wizard/wizard/stock_backorder_confirmation.py:0 #: code:addons/l10n_ro_stock_account_date_wizard/wizard/stock_immediate_transfer.py:0 From c1cc4794df0e58613e7b415615cda06063ece734 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 30 May 2023 16:45:43 +0000 Subject: [PATCH 64/68] [UPD] addons table in README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e3c655b3e..9b94c225a 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ addon | version | maintainers | summary [l10n_ro_stock](l10n_ro_stock/) | 16.0.0.1.0 | [](https://github.com/feketemihai) | Romania - Stock [l10n_ro_stock_account](l10n_ro_stock_account/) | 16.0.1.1.0 | [](https://github.com/dhongu) [](https://github.com/feketemihai) | Romania - Stock Accounting [l10n_ro_stock_account_date](l10n_ro_stock_account_date/) | 16.0.1.1.0 | [](https://github.com/feketemihai) | Romania - Stock Accounting Date +[l10n_ro_stock_account_date_wizard](l10n_ro_stock_account_date_wizard/) | 16.0.1.0.0 | [](https://github.com/feketemihai) | Romania - Stock Accounting Date Wizard [l10n_ro_vat_on_payment](l10n_ro_vat_on_payment/) | 16.0.1.1.0 | [](https://github.com/feketemihai) | Romania - VAT on Payment [//]: # (end addons) From 324f2c5e79dfb2ee75a8b853a2c6bb9ead4d4b2b Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 30 May 2023 16:45:45 +0000 Subject: [PATCH 65/68] [UPD] README.rst --- l10n_ro_stock_account_date_wizard/README.rst | 12 ++++++------ .../static/description/index.html | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/l10n_ro_stock_account_date_wizard/README.rst b/l10n_ro_stock_account_date_wizard/README.rst index 09e913712..2b56ba0b2 100644 --- a/l10n_ro_stock_account_date_wizard/README.rst +++ b/l10n_ro_stock_account_date_wizard/README.rst @@ -14,13 +14,13 @@ Romania - Stock Accounting Date Wizard :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github - :target: https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date_wizard + :target: https://github.com/OCA/l10n-romania/tree/16.0/l10n_ro_stock_account_date_wizard :alt: OCA/l10n-romania .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date_wizard + :target: https://translation.odoo-community.org/projects/l10n-romania-16-0/l10n-romania-16-0-l10n_ro_stock_account_date_wizard :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/177/15.0 + :target: https://runbot.odoo-community.org/runbot/177/16.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -37,7 +37,7 @@ Installation To install this module, you need to: -* clone the branch 14.0 of the repository https://github.com/OCA/l10n-romania +* clone the branch 16.0 of the repository https://github.com/OCA/l10n-romania * add the path to this repository in your configuration (addons-path) * update the module list * search for "Romania - Stock Account Date Wizard" in your addons @@ -49,7 +49,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-romania/issues>`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date_wizard%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. +`feedback <https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date_wizard%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. Do not contact contributors directly about support or help with technical issues. @@ -93,6 +93,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: |maintainer-feketemihai| -This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date_wizard>`_ project on GitHub. +This module is part of the `OCA/l10n-romania <https://github.com/OCA/l10n-romania/tree/16.0/l10n_ro_stock_account_date_wizard>`_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_ro_stock_account_date_wizard/static/description/index.html b/l10n_ro_stock_account_date_wizard/static/description/index.html index de3e4748f..f271e8210 100644 --- a/l10n_ro_stock_account_date_wizard/static/description/index.html +++ b/l10n_ro_stock_account_date_wizard/static/description/index.html @@ -367,7 +367,7 @@ <h1 class="title">Romania - Stock Accounting Date Wizard</h1> !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date_wizard"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-15-0/l10n-romania-15-0-l10n_ro_stock_account_date_wizard"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> +<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/16.0/l10n_ro_stock_account_date_wizard"><img alt="OCA/l10n-romania" src="https://img.shields.io/badge/github-OCA%2Fl10n--romania-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/l10n-romania-16-0/l10n-romania-16-0-l10n_ro_stock_account_date_wizard"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/177/16.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>This module allows you to select “Accounting Date” for stock operations in the Stock Confirmation Wizards.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> @@ -386,7 +386,7 @@ <h1 class="title">Romania - Stock Accounting Date Wizard</h1> <h1><a class="toc-backref" href="#id1">Installation</a></h1> <p>To install this module, you need to:</p> <ul class="simple"> -<li>clone the branch 14.0 of the repository <a class="reference external" href="https://github.com/OCA/l10n-romania">https://github.com/OCA/l10n-romania</a></li> +<li>clone the branch 16.0 of the repository <a class="reference external" href="https://github.com/OCA/l10n-romania">https://github.com/OCA/l10n-romania</a></li> <li>add the path to this repository in your configuration (addons-path)</li> <li>update the module list</li> <li>search for “Romania - Stock Account Date Wizard” in your addons</li> @@ -398,7 +398,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-romania/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date_wizard%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> +<a class="reference external" href="https://github.com/OCA/l10n-romania/issues/new?body=module:%20l10n_ro_stock_account_date_wizard%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> </div> <div class="section" id="credits"> @@ -430,7 +430,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2> promote its widespread use.</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> <p><a class="reference external" href="https://github.com/feketemihai"><img alt="feketemihai" src="https://github.com/feketemihai.png?size=40px" /></a></p> -<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/15.0/l10n_ro_stock_account_date_wizard">OCA/l10n-romania</a> project on GitHub.</p> +<p>This module is part of the <a class="reference external" href="https://github.com/OCA/l10n-romania/tree/16.0/l10n_ro_stock_account_date_wizard">OCA/l10n-romania</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> </div> </div> From 359915c3563ee9f37a2d94c19c6919d943511ef4 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 30 May 2023 16:45:45 +0000 Subject: [PATCH 66/68] [ADD] setup.py --- setup/_metapackage/VERSION.txt | 2 +- setup/_metapackage/setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/_metapackage/VERSION.txt b/setup/_metapackage/VERSION.txt index 3b3983f8f..4fbdc9244 100644 --- a/setup/_metapackage/VERSION.txt +++ b/setup/_metapackage/VERSION.txt @@ -1 +1 @@ -16.0.20230530.1 \ No newline at end of file +16.0.20230530.2 \ No newline at end of file diff --git a/setup/_metapackage/setup.py b/setup/_metapackage/setup.py index 07612c4ef..057bcb9f7 100644 --- a/setup/_metapackage/setup.py +++ b/setup/_metapackage/setup.py @@ -19,6 +19,7 @@ 'odoo-addon-l10n_ro_stock>=16.0dev,<16.1dev', 'odoo-addon-l10n_ro_stock_account>=16.0dev,<16.1dev', 'odoo-addon-l10n_ro_stock_account_date>=16.0dev,<16.1dev', + 'odoo-addon-l10n_ro_stock_account_date_wizard>=16.0dev,<16.1dev', 'odoo-addon-l10n_ro_vat_on_payment>=16.0dev,<16.1dev', ], classifiers=[ From 10eefde0715ceb2bd680c3e2412c5963d1b1e650 Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 30 May 2023 16:45:45 +0000 Subject: [PATCH 67/68] l10n_ro_stock_account_date_wizard 16.0.1.1.0 --- l10n_ro_stock_account_date_wizard/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/l10n_ro_stock_account_date_wizard/__manifest__.py b/l10n_ro_stock_account_date_wizard/__manifest__.py index df4fafe9a..dc10ce525 100644 --- a/l10n_ro_stock_account_date_wizard/__manifest__.py +++ b/l10n_ro_stock_account_date_wizard/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date Wizard", - "version": "16.0.1.0.0", + "version": "16.0.1.1.0", "category": "Localization", "summary": "Romania - Stock Accounting Date Wizard", "author": "NextERP Romania," "Odoo Community Association (OCA)", From b009a2873fd0ea67d51bb428ed8c7cdd76962ddc Mon Sep 17 00:00:00 2001 From: OCA-git-bot <oca-git-bot@odoo-community.org> Date: Tue, 30 May 2023 16:45:50 +0000 Subject: [PATCH 68/68] [UPD] addons table in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b94c225a..74458e886 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ addon | version | maintainers | summary [l10n_ro_stock](l10n_ro_stock/) | 16.0.0.1.0 | [](https://github.com/feketemihai) | Romania - Stock [l10n_ro_stock_account](l10n_ro_stock_account/) | 16.0.1.1.0 | [](https://github.com/dhongu) [](https://github.com/feketemihai) | Romania - Stock Accounting [l10n_ro_stock_account_date](l10n_ro_stock_account_date/) | 16.0.1.1.0 | [](https://github.com/feketemihai) | Romania - Stock Accounting Date -[l10n_ro_stock_account_date_wizard](l10n_ro_stock_account_date_wizard/) | 16.0.1.0.0 | [](https://github.com/feketemihai) | Romania - Stock Accounting Date Wizard +[l10n_ro_stock_account_date_wizard](l10n_ro_stock_account_date_wizard/) | 16.0.1.1.0 | [](https://github.com/feketemihai) | Romania - Stock Accounting Date Wizard [l10n_ro_vat_on_payment](l10n_ro_vat_on_payment/) | 16.0.1.1.0 | [](https://github.com/feketemihai) | Romania - VAT on Payment [//]: # (end addons)