Skip to content

Commit

Permalink
[12.0][4320][ADD] stock_picking_delivery_slip_required (#217)
Browse files Browse the repository at this point in the history
[ADD] stock_picking_delivery_slip_required
  • Loading branch information
AungKoKoLin1997 authored Apr 17, 2024
1 parent a06b126 commit 412d67a
Show file tree
Hide file tree
Showing 13 changed files with 594 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/stock_picking_delivery_slip_required/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
53 changes: 53 additions & 0 deletions stock_picking_delivery_slip_required/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
====================================
Stock Picking Delivery Slip Required
====================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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-qrtl%2Fhls--custom-lightgray.png?logo=github
:target: https://github.com/qrtl/hls-custom/tree/12.0/stock_picking_delivery_slip_required
:alt: qrtl/hls-custom

|badge1| |badge2| |badge3|

This module adds the is_delivery_slip_required field for both partner and picking.
It determines the necessity of a delivery slip for each picking based on the associated partner.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/qrtl/hls-custom/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/qrtl/hls-custom/issues/new?body=module:%20stock_picking_delivery_slip_required%0Aversion:%2012.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
~~~~~~~

* Quartile Limited

Maintainers
~~~~~~~~~~~

This module is part of the `qrtl/hls-custom <https://github.com/qrtl/hls-custom/tree/12.0/stock_picking_delivery_slip_required>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions stock_picking_delivery_slip_required/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
13 changes: 13 additions & 0 deletions stock_picking_delivery_slip_required/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Quartile Limited
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock Picking Delivery Slip Required",
"version": "12.0.1.0.0",
"author": "Quartile Limited",
"website": "https://www.quartile.co",
"category": "Stock",
"license": "AGPL-3",
"depends": ["sale_stock"],
"data": ["views/res_partner_views.xml", "views/stock_picking_views.xml"],
"installable": True,
}
43 changes: 43 additions & 0 deletions stock_picking_delivery_slip_required/i18n/ja.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_picking_delivery_slip_required
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-17 02:58+0000\n"
"PO-Revision-Date: 2024-04-17 02:58+0000\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: stock_picking_delivery_slip_required
#: model:ir.model,name:stock_picking_delivery_slip_required.model_res_partner
msgid "Contact"
msgstr "連絡先"

#. module: stock_picking_delivery_slip_required
#: model_terms:ir.ui.view,arch_db:stock_picking_delivery_slip_required.view_picking_internal_search
msgid "Delivery Slip Not Required"
msgstr "納品書不要"

#. module: stock_picking_delivery_slip_required
#: model_terms:ir.ui.view,arch_db:stock_picking_delivery_slip_required.view_picking_internal_search
msgid "Delivery Slip Required"
msgstr "納品書必要"

#. module: stock_picking_delivery_slip_required
#: model:ir.model.fields,field_description:stock_picking_delivery_slip_required.field_res_partner__is_delivery_slip_required
#: model:ir.model.fields,field_description:stock_picking_delivery_slip_required.field_res_users__is_delivery_slip_required
#: model:ir.model.fields,field_description:stock_picking_delivery_slip_required.field_stock_picking__is_delivery_slip_required
msgid "Is Delivery Slip Required"
msgstr "要納品書"

#. module: stock_picking_delivery_slip_required
#: model:ir.model,name:stock_picking_delivery_slip_required.model_stock_picking
msgid "Transfer"
msgstr "運送"
2 changes: 2 additions & 0 deletions stock_picking_delivery_slip_required/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import res_partner
from . import stock_picking
10 changes: 10 additions & 0 deletions stock_picking_delivery_slip_required/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2024 Quartile Limited
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResPartner(models.Model):
_inherit = "res.partner"

is_delivery_slip_required = fields.Boolean()
27 changes: 27 additions & 0 deletions stock_picking_delivery_slip_required/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2024 Quartile Limited
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class StockPicking(models.Model):
_inherit = "stock.picking"

is_delivery_slip_required = fields.Boolean()

@api.model
def create(self, vals):
res = super(StockPicking, self).create(vals)
if res.partner_id:
res.is_delivery_slip_required = res.partner_id.is_delivery_slip_required
return res

@api.multi
def write(self, vals):
partner_id = vals.get("partner_id")
if partner_id:
partner = self.env["res.partner"].browse(partner_id)
vals.update(
{"is_delivery_slip_required": partner.is_delivery_slip_required}
)
return super(StockPicking, self).write(vals)
2 changes: 2 additions & 0 deletions stock_picking_delivery_slip_required/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module adds the is_delivery_slip_required field for both partner and picking.
It determines the necessity of a delivery slip for each picking based on the associated partner.
Loading

0 comments on commit 412d67a

Please sign in to comment.