[IMP] sale_order_batch: apply pre-commit
This commit is contained in:
parent
9c46372caf
commit
70a5e93839
17 changed files with 229 additions and 122 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
.. image:: https://odoo-community.org/readme-banner-image
|
||||||
|
:target: https://odoo-community.org/get-involved?utm_source=readme
|
||||||
|
:alt: Odoo Community Association
|
||||||
|
|
||||||
================
|
================
|
||||||
Sale Order Batch
|
Sale Order Batch
|
||||||
================
|
================
|
||||||
|
|
@ -13,12 +17,12 @@ Sale Order Batch
|
||||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||||
:target: https://odoo-community.org/page/development-status
|
:target: https://odoo-community.org/page/development-status
|
||||||
:alt: Beta
|
:alt: Beta
|
||||||
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
|
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
|
||||||
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
|
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
|
||||||
:alt: License: LGPL-3
|
:alt: License: LGPL-3
|
||||||
.. |badge3| image:: https://img.shields.io/badge/github-bakeupboys%2Fnfu-lightgray.png?logo=github
|
.. |badge3| image:: https://img.shields.io/badge/github-madmooose%2Fodooapps-lightgray.png?logo=github
|
||||||
:target: https://github.com/bakeupboys/nfu/tree/16.0/sale_order_batch
|
:target: https://github.com/madmooose/odooapps/tree/16.0/sale_order_batch
|
||||||
:alt: bakeupboys/nfu
|
:alt: madmooose/odooapps
|
||||||
|
|
||||||
|badge1| |badge2| |badge3|
|
|badge1| |badge2| |badge3|
|
||||||
|
|
||||||
|
|
@ -49,10 +53,10 @@ Changelog
|
||||||
Bug Tracker
|
Bug Tracker
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Bugs are tracked on `GitHub Issues <https://github.com/bakeupboys/nfu/issues>`_.
|
Bugs are tracked on `GitHub Issues <https://github.com/madmooose/odooapps/issues>`_.
|
||||||
In case of trouble, please check there if your issue has already been reported.
|
In case of trouble, please check there if your issue has already been reported.
|
||||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||||
`feedback <https://github.com/bakeupboys/nfu/issues/new?body=module:%20sale_order_batch%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
`feedback <https://github.com/madmooose/odooapps/issues/new?body=module:%20sale_order_batch%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.
|
Do not contact contributors directly about support or help with technical issues.
|
||||||
|
|
||||||
|
|
@ -63,6 +67,7 @@ Authors
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
|
||||||
* BAKEUP
|
* BAKEUP
|
||||||
|
* Niels Göttsch
|
||||||
|
|
||||||
Contributors
|
Contributors
|
||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
|
@ -72,6 +77,6 @@ Contributors
|
||||||
Maintainers
|
Maintainers
|
||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
|
|
||||||
This module is part of the `bakeupboys/nfu <https://github.com/bakeupboys/nfu/tree/16.0/sale_order_batch>`_ project on GitHub.
|
This module is part of the `madmooose/odooapps <https://github.com/madmooose/odooapps/tree/16.0/sale_order_batch>`_ project on GitHub.
|
||||||
|
|
||||||
You are welcome to contribute.
|
You are welcome to contribute.
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"name": "Sale Order Batch",
|
"name": "Sale Order Batch",
|
||||||
"summary": "Group Sale Orders into a batch",
|
"summary": "Group Sale Orders into a batch",
|
||||||
"author": "BAKEUP",
|
"author": "BAKEUP,Niels Göttsch",
|
||||||
"website": "https://www.bakeup.org",
|
"website": "https://ziemlichoptimal.de",
|
||||||
"category": "Sale",
|
"category": "Sale",
|
||||||
"version": "16.0.2.3.1",
|
"version": "16.0.2.3.1",
|
||||||
"depends": ["sale", "product"],
|
"depends": ["sale", "product"],
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo noupdate="1">
|
<odoo noupdate="1">
|
||||||
|
|
||||||
<record id="seq_sale_order_batch" model="ir.sequence">
|
<record id="seq_sale_order_batch" model="ir.sequence">
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<field name="code">sale.order.batch</field>
|
<field name="code">sale.order.batch</field>
|
||||||
<field name="prefix">SOB</field>
|
<field name="prefix">SOB</field>
|
||||||
<field name="padding">5</field>
|
<field name="padding">5</field>
|
||||||
<field name="company_id" eval="False"/>
|
<field name="company_id" eval="False" />
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ from odoo.exceptions import UserError
|
||||||
|
|
||||||
from odoo.addons.sale.models.sale_order import INVOICE_STATUS
|
from odoo.addons.sale.models.sale_order import INVOICE_STATUS
|
||||||
|
|
||||||
|
|
||||||
STATES = [
|
STATES = [
|
||||||
("open", "Open"),
|
("open", "Open"),
|
||||||
("in_progress", "In Progress"),
|
("in_progress", "In Progress"),
|
||||||
|
|
@ -207,7 +206,8 @@ class SaleOrderBatch(models.Model):
|
||||||
self.write({"state": "cancel"})
|
self.write({"state": "cancel"})
|
||||||
|
|
||||||
def _show_cancel_wizard(self):
|
def _show_cancel_wizard(self):
|
||||||
"""Decide whether the sale.order.batch.cancel wizard should be shown to cancel specified orders.
|
"""Decide whether the sale.order.batch.cancel wizard should be shown to cancel
|
||||||
|
specified orders.
|
||||||
|
|
||||||
:return: True if there is any non-draft order in the given orders
|
:return: True if there is any non-draft order in the given orders
|
||||||
:rtype: bool
|
:rtype: bool
|
||||||
|
|
@ -250,7 +250,8 @@ class SaleOrderBatchCancelWizard(models.TransientModel):
|
||||||
if not_draft_orders:
|
if not_draft_orders:
|
||||||
raise UserError(
|
raise UserError(
|
||||||
_(
|
_(
|
||||||
"You can only cancel batches where all sale orders are in draft state."
|
"You can only cancel batches where all sale orders are in "
|
||||||
|
"draft state."
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
# use _action_cancel to skip the wizzard
|
# use _action_cancel to skip the wizzard
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ class SaleOrderLine(models.Model):
|
||||||
batch_product_id = fields.Many2one("sale.order.batch.product", ondelete="restrict")
|
batch_product_id = fields.Many2one("sale.order.batch.product", ondelete="restrict")
|
||||||
|
|
||||||
def _link_batch_product(self):
|
def _link_batch_product(self):
|
||||||
lines_with_batch = self.filtered(lambda l: l.batch_id)
|
lines_with_batch = self.filtered(lambda line: line.batch_id)
|
||||||
for line in lines_with_batch:
|
for line in lines_with_batch:
|
||||||
batch_id = line.batch_id
|
batch_id = line.batch_id
|
||||||
batch_product = self.env["sale.order.batch.product"].search(
|
batch_product = self.env["sale.order.batch.product"].search(
|
||||||
|
|
@ -25,17 +25,17 @@ class SaleOrderLine(models.Model):
|
||||||
line.batch_product_id = batch_product
|
line.batch_product_id = batch_product
|
||||||
|
|
||||||
def _unlink_batch_product(self):
|
def _unlink_batch_product(self):
|
||||||
lines_to_unlink = self.filtered(lambda l: l.batch_product_id)
|
lines_to_unlink = self.filtered(lambda line: line.batch_product_id)
|
||||||
batch_products = lines_to_unlink.mapped("batch_product_id")
|
batch_products = lines_to_unlink.mapped("batch_product_id")
|
||||||
lines_to_unlink.update({"batch_product_id": False})
|
lines_to_unlink.update({"batch_product_id": False})
|
||||||
batch_products.filtered(lambda p: len(p.sale_order_line_ids) == 0).unlink()
|
batch_products.filtered(lambda p: len(p.sale_order_line_ids) == 0).unlink()
|
||||||
|
|
||||||
def _update_batch_product(self):
|
def _update_batch_product(self):
|
||||||
lines_with_batch = self.filtered(lambda l: l.batch_id)
|
lines_with_batch = self.filtered(lambda line: line.batch_id)
|
||||||
lines_without_batch = self - lines_with_batch
|
lines_without_batch = self - lines_with_batch
|
||||||
lines_with_batch.filtered(
|
lines_with_batch.filtered(
|
||||||
lambda l: l.batch_product_id
|
lambda line: line.batch_product_id
|
||||||
and l.batch_product_id.product_id != l.product_id
|
and line.batch_product_id.product_id != line.product_id
|
||||||
)._unlink_batch_product()
|
)._unlink_batch_product()
|
||||||
lines_with_batch._link_batch_product()
|
lines_with_batch._link_batch_product()
|
||||||
lines_without_batch._unlink_batch_product()
|
lines_without_batch._unlink_batch_product()
|
||||||
|
|
|
||||||
3
sale_order_batch/pyproject.toml
Normal file
3
sale_order_batch/pyproject.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
[build-system]
|
||||||
|
requires = ["whool"]
|
||||||
|
build-backend = "whool.buildapi"
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo noupdate="1">
|
<odoo noupdate="1">
|
||||||
|
|
||||||
<!-- Multi - Company Rules -->
|
<!-- Multi - Company Rules -->
|
||||||
<record id="sale_order_batch_comp_rule" model="ir.rule">
|
<record id="sale_order_batch_comp_rule" model="ir.rule">
|
||||||
<field name="name">Sales Order Batch multi-company</field>
|
<field name="name">Sales Order Batch multi-company</field>
|
||||||
<field name="model_id" ref="model_sale_order_batch"/>
|
<field name="model_id" ref="model_sale_order_batch" />
|
||||||
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
|
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
||||||
<title>Sale Order Batch</title>
|
<title>README.rst</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -360,16 +360,21 @@ ul.auto-toc {
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="document" id="sale-order-batch">
|
<div class="document">
|
||||||
<h1 class="title">Sale Order Batch</h1>
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
|
||||||
|
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
|
||||||
|
</a>
|
||||||
|
<div class="section" id="sale-order-batch">
|
||||||
|
<h1>Sale Order Batch</h1>
|
||||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
!! This file is generated by oca-gen-addon-readme !!
|
!! This file is generated by oca-gen-addon-readme !!
|
||||||
!! changes will be overwritten. !!
|
!! changes will be overwritten. !!
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
!! source digest: sha256:6686f0672ede8093b17d5d7b165f72f8e49341c7849f9e0d5a162e350fc36d71
|
!! source digest: sha256:6686f0672ede8093b17d5d7b165f72f8e49341c7849f9e0d5a162e350fc36d71
|
||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||||
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/bakeupboys/nfu/tree/16.0/sale_order_batch"><img alt="bakeupboys/nfu" src="https://img.shields.io/badge/github-bakeupboys%2Fnfu-lightgray.png?logo=github" /></a></p>
|
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/madmooose/odooapps/tree/16.0/sale_order_batch"><img alt="madmooose/odooapps" src="https://img.shields.io/badge/github-madmooose%2Fodooapps-lightgray.png?logo=github" /></a></p>
|
||||||
<p>This module adds the possibility to group Sale orders into batches. Attributes of a Sale Order Batch will be written to all
|
<p>This module adds the possibility to group Sale orders into batches. Attributes of a Sale Order Batch will be written to all
|
||||||
Sale Order. Wenn attached to a batch they can be processed together. On the other hand they cannot be proccesed individual
|
Sale Order. Wenn attached to a batch they can be processed together. On the other hand they cannot be proccesed individual
|
||||||
anymore as log as they are part of a batch. Only Sale Orders in state Qutotation or Quotation Send can be attached to a batch.</p>
|
anymore as log as they are part of a batch. Only Sale Orders in state Qutotation or Quotation Send can be attached to a batch.</p>
|
||||||
|
|
@ -387,7 +392,7 @@ anymore as log as they are part of a batch. Only Sale Orders in state Qutotation
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="changelog">
|
<div class="section" id="changelog">
|
||||||
<h1><a class="toc-backref" href="#toc-entry-1">Changelog</a></h1>
|
<h2><a class="toc-backref" href="#toc-entry-1">Changelog</a></h2>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li>16.0.0.0.1: Initial module.</li>
|
<li>16.0.0.0.1: Initial module.</li>
|
||||||
<li>16.0.0.1: Add Multi Company ability</li>
|
<li>16.0.0.1: Add Multi Company ability</li>
|
||||||
|
|
@ -403,33 +408,35 @@ anymore as log as they are part of a batch. Only Sale Orders in state Qutotation
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="bug-tracker">
|
<div class="section" id="bug-tracker">
|
||||||
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
|
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
|
||||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/bakeupboys/nfu/issues">GitHub Issues</a>.
|
<p>Bugs are tracked on <a class="reference external" href="https://github.com/madmooose/odooapps/issues">GitHub Issues</a>.
|
||||||
In case of trouble, please check there if your issue has already been reported.
|
In case of trouble, please check there if your issue has already been reported.
|
||||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||||
<a class="reference external" href="https://github.com/bakeupboys/nfu/issues/new?body=module:%20sale_order_batch%0Aversion:%2016.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/madmooose/odooapps/issues/new?body=module:%20sale_order_batch%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>
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="credits">
|
<div class="section" id="credits">
|
||||||
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
|
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
|
||||||
<div class="section" id="authors">
|
<div class="section" id="authors">
|
||||||
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
|
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li>BAKEUP</li>
|
<li>BAKEUP</li>
|
||||||
|
<li>Niels Göttsch</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="contributors">
|
<div class="section" id="contributors">
|
||||||
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
|
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li>Niels Göttsch <<a class="reference external" href="mailto:niels@ziemlichoptimal.de">niels@ziemlichoptimal.de</a>></li>
|
<li>Niels Göttsch <<a class="reference external" href="mailto:niels@ziemlichoptimal.de">niels@ziemlichoptimal.de</a>></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="maintainers">
|
<div class="section" id="maintainers">
|
||||||
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
|
<h3><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h3>
|
||||||
<p>This module is part of the <a class="reference external" href="https://github.com/bakeupboys/nfu/tree/16.0/sale_order_batch">bakeupboys/nfu</a> project on GitHub.</p>
|
<p>This module is part of the <a class="reference external" href="https://github.com/madmooose/odooapps/tree/16.0/sale_order_batch">madmooose/odooapps</a> project on GitHub.</p>
|
||||||
<p>You are welcome to contribute.</p>
|
<p>You are welcome to contribute.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="view_order_batch_product_form" model="ir.ui.view">
|
<record id="view_order_batch_product_form" model="ir.ui.view">
|
||||||
<field name="name">sale.order.batch.product.form</field>
|
<field name="name">sale.order.batch.product.form</field>
|
||||||
|
|
@ -6,38 +6,41 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form>
|
<form>
|
||||||
<header>
|
<header>
|
||||||
<field name="state" invisible="1"/>
|
<field name="state" invisible="1" />
|
||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_button_box" name="button_box">
|
<div class="oe_button_box" name="button_box">
|
||||||
</div>
|
</div>
|
||||||
<h1>
|
<h1>
|
||||||
<field name="product_id"/>
|
<field name="product_id" />
|
||||||
</h1>
|
</h1>
|
||||||
<group>
|
<group>
|
||||||
<group name="product_info">
|
<group name="product_info">
|
||||||
<field name="batch_id"/>
|
<field name="batch_id" />
|
||||||
<field name="product_uom_qty"/>
|
<field name="product_uom_qty" />
|
||||||
</group>
|
</group>
|
||||||
<group name="packaging_info">
|
<group name="packaging_info">
|
||||||
<field name="product_packaging_id"/>
|
<field name="product_packaging_id" />
|
||||||
<field name="product_packaging_qty"/>
|
<field name="product_packaging_qty" />
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<notebook>
|
<notebook>
|
||||||
<page string="Sale Order Lines" name="order_line">
|
<page string="Sale Order Lines" name="order_line">
|
||||||
<field name="sale_order_line_ids" widget="section_and_note_one2many">
|
<field
|
||||||
|
name="sale_order_line_ids"
|
||||||
|
widget="section_and_note_one2many"
|
||||||
|
>
|
||||||
<tree editable="bottom" create="0">
|
<tree editable="bottom" create="0">
|
||||||
<field name="company_id" invisible="1"/>
|
<field name="company_id" invisible="1" />
|
||||||
<field name="sequence" widget="handle"/>
|
<field name="sequence" widget="handle" />
|
||||||
<field name="order_id"/>
|
<field name="order_id" />
|
||||||
<field name="order_partner_id"/>
|
<field name="order_partner_id" />
|
||||||
<field name="product_template_id" optional="hide"/>
|
<field name="product_template_id" optional="hide" />
|
||||||
<field name="product_id" optional="hide"/>
|
<field name="product_id" optional="hide" />
|
||||||
<field name="name"/>
|
<field name="name" />
|
||||||
<field name="product_uom_qty"/>
|
<field name="product_uom_qty" />
|
||||||
<field name="price_unit"/>
|
<field name="price_unit" />
|
||||||
<field name="price_subtotal"/>
|
<field name="price_subtotal" />
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,24 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="view_order_batch_tree" model="ir.ui.view">
|
<record id="view_order_batch_tree" model="ir.ui.view">
|
||||||
<field name="name">sale.order.batch.tree</field>
|
<field name="name">sale.order.batch.tree</field>
|
||||||
<field name="model">sale.order.batch</field>
|
<field name="model">sale.order.batch</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree>
|
<tree>
|
||||||
<field name="name"/>
|
<field name="name" />
|
||||||
<field name="date_order"/>
|
<field name="date_order" />
|
||||||
<field name="company_id" groups="base.group_multi_company" optional="show" readonly="1"/>
|
<field
|
||||||
<field name="company_id" groups="!base.group_multi_company" invisible="1"/>
|
name="company_id"
|
||||||
<field name="sale_order_ids" widget="many2many_tags"/>
|
groups="base.group_multi_company"
|
||||||
|
optional="show"
|
||||||
|
readonly="1"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="company_id"
|
||||||
|
groups="!base.group_multi_company"
|
||||||
|
invisible="1"
|
||||||
|
/>
|
||||||
|
<field name="sale_order_ids" widget="many2many_tags" />
|
||||||
<field
|
<field
|
||||||
name="state"
|
name="state"
|
||||||
decoration-success="state == 'sale' or state == 'done'"
|
decoration-success="state == 'sale' or state == 'done'"
|
||||||
|
|
@ -34,11 +43,20 @@
|
||||||
<field name="model">sale.order.batch</field>
|
<field name="model">sale.order.batch</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree>
|
<tree>
|
||||||
<field name="name"/>
|
<field name="name" />
|
||||||
<field name="date_order"/>
|
<field name="date_order" />
|
||||||
<field name="company_id" groups="base.group_multi_company" optional="show" readonly="1"/>
|
<field
|
||||||
<field name="company_id" groups="!base.group_multi_company" invisible="1"/>
|
name="company_id"
|
||||||
<field name="sale_order_ids" widget="many2many_tags"/>
|
groups="base.group_multi_company"
|
||||||
|
optional="show"
|
||||||
|
readonly="1"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="company_id"
|
||||||
|
groups="!base.group_multi_company"
|
||||||
|
invisible="1"
|
||||||
|
/>
|
||||||
|
<field name="sale_order_ids" widget="many2many_tags" />
|
||||||
<field
|
<field
|
||||||
name="state"
|
name="state"
|
||||||
decoration-success="state == 'sale' or state == 'done'"
|
decoration-success="state == 'sale' or state == 'done'"
|
||||||
|
|
@ -113,14 +131,14 @@
|
||||||
type="object"
|
type="object"
|
||||||
states="cancel"
|
states="cancel"
|
||||||
/>
|
/>
|
||||||
<field name="state" widget="statusbar"/>
|
<field name="state" widget="statusbar" />
|
||||||
</header>
|
</header>
|
||||||
<div
|
<div
|
||||||
class="alert alert-warning mb-0"
|
class="alert alert-warning mb-0"
|
||||||
role="alert"
|
role="alert"
|
||||||
attrs="{'invisible': [('partner_credit_warning', '=', '')]}"
|
attrs="{'invisible': [('partner_credit_warning', '=', '')]}"
|
||||||
>
|
>
|
||||||
<field name="partner_credit_warning"/>
|
<field name="partner_credit_warning" />
|
||||||
</div>
|
</div>
|
||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_button_box" name="button_box">
|
<div class="oe_button_box" name="button_box">
|
||||||
|
|
@ -131,7 +149,11 @@
|
||||||
icon="fa-pencil-square-o"
|
icon="fa-pencil-square-o"
|
||||||
attrs="{'invisible': [('sale_order_count', '=', 0)]}"
|
attrs="{'invisible': [('sale_order_count', '=', 0)]}"
|
||||||
>
|
>
|
||||||
<field string="Sale Orders" name="sale_order_count" widget="statinfo"/>
|
<field
|
||||||
|
string="Sale Orders"
|
||||||
|
name="sale_order_count"
|
||||||
|
widget="statinfo"
|
||||||
|
/>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="oe_stat_button"
|
class="oe_stat_button"
|
||||||
|
|
@ -140,7 +162,11 @@
|
||||||
icon="fa-cart-plus"
|
icon="fa-cart-plus"
|
||||||
attrs="{'invisible': [('product_count', '=', 0)]}"
|
attrs="{'invisible': [('product_count', '=', 0)]}"
|
||||||
>
|
>
|
||||||
<field string="Products" name="product_count" widget="statinfo"/>
|
<field
|
||||||
|
string="Products"
|
||||||
|
name="product_count"
|
||||||
|
widget="statinfo"
|
||||||
|
/>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
name="action_view_invoice"
|
name="action_view_invoice"
|
||||||
|
|
@ -149,33 +175,45 @@
|
||||||
icon="fa-pencil-square-o"
|
icon="fa-pencil-square-o"
|
||||||
attrs="{'invisible': [('invoice_count', '=', 0)]}"
|
attrs="{'invisible': [('invoice_count', '=', 0)]}"
|
||||||
>
|
>
|
||||||
<field name="invoice_count" widget="statinfo" string="Invoices"/>
|
<field
|
||||||
|
name="invoice_count"
|
||||||
|
widget="statinfo"
|
||||||
|
string="Invoices"
|
||||||
|
/>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<h1>
|
<h1>
|
||||||
<field name="name"/>
|
<field name="name" />
|
||||||
</h1>
|
</h1>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="amount_total" colspan="2" readonly="1"/>
|
<field name="amount_total" colspan="2" readonly="1" />
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="date_order"/>
|
<field name="date_order" />
|
||||||
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
|
<field
|
||||||
<field name="company_id" invisible="1" groups="!base.group_multi_company"/>
|
name="company_id"
|
||||||
|
options="{'no_create': True}"
|
||||||
|
groups="base.group_multi_company"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="company_id"
|
||||||
|
invisible="1"
|
||||||
|
groups="!base.group_multi_company"
|
||||||
|
/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<notebook>
|
<notebook>
|
||||||
<page string="Sale Orders" name="orders">
|
<page string="Sale Orders" name="orders">
|
||||||
<field name="state" invisible="1"/>
|
<field name="state" invisible="1" />
|
||||||
<field name="sale_order_ids">
|
<field name="sale_order_ids">
|
||||||
<tree delete="0" editable="0" create="0">
|
<tree delete="0" editable="0" create="0">
|
||||||
<field name="name"/>
|
<field name="name" />
|
||||||
<field name="partner_id" readonly="1"/>
|
<field name="partner_id" readonly="1" />
|
||||||
<field name="date_order" readonly="1"/>
|
<field name="date_order" readonly="1" />
|
||||||
<field name="amount_untaxed"/>
|
<field name="amount_untaxed" />
|
||||||
<field name="amount_total"/>
|
<field name="amount_total" />
|
||||||
<field name="company_id" invisible="1"/>
|
<field name="company_id" invisible="1" />
|
||||||
<field
|
<field
|
||||||
name="state"
|
name="state"
|
||||||
decoration-success="state == 'sale' or state == 'done'"
|
decoration-success="state == 'sale' or state == 'done'"
|
||||||
|
|
@ -195,38 +233,47 @@
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
<page string="Sale Order Lines" name="order_line">
|
<page string="Sale Order Lines" name="order_line">
|
||||||
<field name="sale_order_line_ids" widget="section_and_note_one2many">
|
<field
|
||||||
|
name="sale_order_line_ids"
|
||||||
|
widget="section_and_note_one2many"
|
||||||
|
>
|
||||||
<tree create="0" editable="bottom">
|
<tree create="0" editable="bottom">
|
||||||
<field name="sequence" widget="handle"/>
|
<field name="sequence" widget="handle" />
|
||||||
<field name="order_id"/>
|
<field name="order_id" />
|
||||||
<field name="order_partner_id"/>
|
<field name="order_partner_id" />
|
||||||
<field name="product_template_id" optional="hide"/>
|
<field name="product_template_id" optional="hide" />
|
||||||
<field name="product_id" optional="hide"/>
|
<field name="product_id" optional="hide" />
|
||||||
<field name="name"/>
|
<field name="name" />
|
||||||
<field name="product_uom_qty"/>
|
<field name="product_uom_qty" />
|
||||||
<field name="company_id" invisible="1"/>
|
<field name="company_id" invisible="1" />
|
||||||
<field name="price_unit"/>
|
<field name="price_unit" />
|
||||||
<field name="price_subtotal"/>
|
<field name="price_subtotal" />
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
<page string="Products" name="products">
|
<page string="Products" name="products">
|
||||||
<field name="product_ids">
|
<field name="product_ids">
|
||||||
<tree create="0" delete="0">
|
<tree create="0" delete="0">
|
||||||
<field name="product_template_id" optional="hide"/>
|
<field name="product_template_id" optional="hide" />
|
||||||
<field name="product_id"/>
|
<field name="product_id" />
|
||||||
<field name="product_uom_qty"/>
|
<field name="product_uom_qty" />
|
||||||
<field name="lst_price"/>
|
<field name="lst_price" />
|
||||||
<field name="product_packaging_qty" groups="product.group_stock_packaging"/>
|
<field
|
||||||
<field name="product_packaging_id" groups="product.group_stock_packaging"/>
|
name="product_packaging_qty"
|
||||||
|
groups="product.group_stock_packaging"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="product_packaging_id"
|
||||||
|
groups="product.group_stock_packaging"
|
||||||
|
/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</page>
|
</page>
|
||||||
</notebook>
|
</notebook>
|
||||||
</sheet>
|
</sheet>
|
||||||
<div class="oe_chatter">
|
<div class="oe_chatter">
|
||||||
<field name="message_follower_ids" widget="mail_followers"/>
|
<field name="message_follower_ids" widget="mail_followers" />
|
||||||
<field name="message_ids" widget="mail_thread"/>
|
<field name="message_ids" widget="mail_thread" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
|
|
@ -237,9 +284,21 @@
|
||||||
<field name="model">sale.order.batch</field>
|
<field name="model">sale.order.batch</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search>
|
<search>
|
||||||
<filter string="Active" name="filter_batch_open" domain="[('state', 'in', ['open', 'in_progress'])]"/>
|
<filter
|
||||||
<filter string="Finished" name="filter_batch_finished" domain="[('state', '=', 'closed')]"/>
|
string="Active"
|
||||||
<filter string="Cancelled" name="filter_batch_cancel" domain="[('state', '=', 'cancel')]"/>
|
name="filter_batch_open"
|
||||||
|
domain="[('state', 'in', ['open', 'in_progress'])]"
|
||||||
|
/>
|
||||||
|
<filter
|
||||||
|
string="Finished"
|
||||||
|
name="filter_batch_finished"
|
||||||
|
domain="[('state', '=', 'closed')]"
|
||||||
|
/>
|
||||||
|
<filter
|
||||||
|
string="Cancelled"
|
||||||
|
name="filter_batch_cancel"
|
||||||
|
domain="[('state', '=', 'cancel')]"
|
||||||
|
/>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
@ -249,7 +308,7 @@
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">sale.order.batch</field>
|
<field name="res_model">sale.order.batch</field>
|
||||||
<field name="view_mode">tree,form,activity</field>
|
<field name="view_mode">tree,form,activity</field>
|
||||||
<field name="view_id" ref="view_order_batch_quotation_tree"/>
|
<field name="view_id" ref="view_order_batch_quotation_tree" />
|
||||||
<field name="context">{'search_default_filter_batch_open': 1}</field>
|
<field name="context">{'search_default_filter_batch_open': 1}</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
@ -258,7 +317,7 @@
|
||||||
<field name="type">ir.actions.act_window</field>
|
<field name="type">ir.actions.act_window</field>
|
||||||
<field name="res_model">sale.order.batch</field>
|
<field name="res_model">sale.order.batch</field>
|
||||||
<field name="view_mode">tree,form,activity</field>
|
<field name="view_mode">tree,form,activity</field>
|
||||||
<field name="view_id" ref="view_order_batch_tree"/>
|
<field name="view_id" ref="view_order_batch_tree" />
|
||||||
<field name="context">{'search_default_filter_batch_finished': 1}</field>
|
<field name="context">{'search_default_filter_batch_finished': 1}</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
@ -269,7 +328,7 @@
|
||||||
<field name="view_mode">tree,form,activity</field>
|
<field name="view_mode">tree,form,activity</field>
|
||||||
<field name="context">{'create': False}</field>
|
<field name="context">{'create': False}</field>
|
||||||
<field name="domain">[('invoice_status','=','to invoice')]</field>
|
<field name="domain">[('invoice_status','=','to invoice')]</field>
|
||||||
<field name="search_view_id" ref="sale_order_batch_view_search"/>
|
<field name="search_view_id" ref="sale_order_batch_view_search" />
|
||||||
<field name="help" type="html">
|
<field name="help" type="html">
|
||||||
<p class="o_view_nocontent_smiling_face">
|
<p class="o_view_nocontent_smiling_face">
|
||||||
No batches to invoice found
|
No batches to invoice found
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="view_order_form" model="ir.ui.view">
|
<record id="view_order_form" model="ir.ui.view">
|
||||||
<field name="name">sale.order.form.inherit.batch</field>
|
<field name="name">sale.order.form.inherit.batch</field>
|
||||||
<field name="model">sale.order</field>
|
<field name="model">sale.order</field>
|
||||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
<field name="inherit_id" ref="sale.view_order_form" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//button[@name='action_draft']" position="after">
|
<xpath expr="//button[@name='action_draft']" position="after">
|
||||||
<field name="batch_id" invisible="True"/>
|
<field name="batch_id" invisible="True" />
|
||||||
<button
|
<button
|
||||||
name="action_add_to_batch"
|
name="action_add_to_batch"
|
||||||
type="object"
|
type="object"
|
||||||
|
|
@ -23,21 +23,30 @@
|
||||||
icon="fa-tasks"
|
icon="fa-tasks"
|
||||||
attrs="{'invisible': [('batch_id', '=', False)]}"
|
attrs="{'invisible': [('batch_id', '=', False)]}"
|
||||||
>
|
>
|
||||||
<field name="batch_id" attrs="{'readonly': True}"/>
|
<field
|
||||||
|
name="batch_id"
|
||||||
|
attrs="{'readonly': True}"
|
||||||
|
/>
|
||||||
</button>
|
</button>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//button[@name='action_confirm']" position="attributes">
|
<xpath
|
||||||
|
expr="//button[@name='action_confirm']"
|
||||||
|
position="attributes"
|
||||||
|
>
|
||||||
<attribute
|
<attribute
|
||||||
name="attrs"
|
name="attrs"
|
||||||
>{'invisible': ['|',('batch_id','!=',False),('state', 'not in', ['sent'])]}</attribute>
|
>{'invisible': ['|',('batch_id','!=',False),('state', 'not in', ['sent'])]}</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//button[@name='action_confirm'][2]" position="attributes">
|
<xpath
|
||||||
|
expr="//button[@name='action_confirm'][2]"
|
||||||
|
position="attributes"
|
||||||
|
>
|
||||||
<attribute
|
<attribute
|
||||||
name="attrs"
|
name="attrs"
|
||||||
>{'invisible': ['|',('batch_id','!=',False),('state', 'not in', ['draft'])]}</attribute>
|
>{'invisible': ['|',('batch_id','!=',False),('state', 'not in', ['draft'])]}</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<group name="partner_details" position="inside">
|
<group name="partner_details" position="inside">
|
||||||
<field name="batch_id"/>
|
<field name="batch_id" />
|
||||||
</group>
|
</group>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
@ -45,15 +54,19 @@
|
||||||
<record id="view_quatation_tree_inherit_batch" model="ir.ui.view">
|
<record id="view_quatation_tree_inherit_batch" model="ir.ui.view">
|
||||||
<field name="name">sale.order.tree.inherited.batch</field>
|
<field name="name">sale.order.tree.inherited.batch</field>
|
||||||
<field name="model">sale.order</field>
|
<field name="model">sale.order</field>
|
||||||
<field name="inherit_id" ref="sale.view_quotation_tree"/>
|
<field name="inherit_id" ref="sale.view_quotation_tree" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//tree" position="inside">
|
<xpath expr="//tree" position="inside">
|
||||||
<header>
|
<header>
|
||||||
<button type="object" name="action_add_to_batch" string="Add to Batch"/>
|
<button
|
||||||
|
type="object"
|
||||||
|
name="action_add_to_batch"
|
||||||
|
string="Add to Batch"
|
||||||
|
/>
|
||||||
</header>
|
</header>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='name']" position="after">
|
<xpath expr="//field[@name='name']" position="after">
|
||||||
<field name="batch_id"/>
|
<field name="batch_id" />
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
@ -61,10 +74,10 @@
|
||||||
<record id="view_order_tree_inherit_batch" model="ir.ui.view">
|
<record id="view_order_tree_inherit_batch" model="ir.ui.view">
|
||||||
<field name="name">sale.order.tree.inherited.batch</field>
|
<field name="name">sale.order.tree.inherited.batch</field>
|
||||||
<field name="model">sale.order</field>
|
<field name="model">sale.order</field>
|
||||||
<field name="inherit_id" ref="sale.view_order_tree"/>
|
<field name="inherit_id" ref="sale.view_order_tree" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='name']" position="after">
|
<xpath expr="//field[@name='name']" position="after">
|
||||||
<field name="batch_id"/>
|
<field name="batch_id" />
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,19 @@
|
||||||
<span>Are you sure you want to cancel this order?</span>
|
<span>Are you sure you want to cancel this order?</span>
|
||||||
</div>
|
</div>
|
||||||
<group col="2">
|
<group col="2">
|
||||||
<field name="batch_ids" invisible="1"/>
|
<field name="batch_ids" invisible="1" />
|
||||||
<field name="order_ids" widget="many2many_tags"/>
|
<field name="order_ids" widget="many2many_tags" />
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<footer>
|
<footer>
|
||||||
<button string="Cancel" name="action_cancel" type="object" class="btn-primary mx-1"/>
|
<button
|
||||||
<button string="Discard" class="btn-secondary" special="cancel"/>
|
string="Cancel"
|
||||||
|
name="action_cancel"
|
||||||
|
type="object"
|
||||||
|
class="btn-primary mx-1"
|
||||||
|
/>
|
||||||
|
<button string="Discard" class="btn-secondary" special="cancel" />
|
||||||
</footer>
|
</footer>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
|
|
|
||||||
2
setup/.setuptools-odoo-make-default-ignore
Normal file
2
setup/.setuptools-odoo-make-default-ignore
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
# addons listed in this file are ignored by
|
||||||
|
# setuptools-odoo-make-default (one addon per line)
|
||||||
2
setup/README
Normal file
2
setup/README
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
To learn more about this directory, please visit
|
||||||
|
https://pypi.python.org/pypi/setuptools-odoo
|
||||||
1
setup/sale_order_batch/odoo/addons/sale_order_batch
Symbolic link
1
setup/sale_order_batch/odoo/addons/sale_order_batch
Symbolic link
|
|
@ -0,0 +1 @@
|
||||||
|
../../../../sale_order_batch
|
||||||
6
setup/sale_order_batch/setup.py
Normal file
6
setup/sale_order_batch/setup.py
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
import setuptools
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
setup_requires=['setuptools-odoo'],
|
||||||
|
odoo_addon=True,
|
||||||
|
)
|
||||||
Loading…
Reference in a new issue